| 1 | module sgl |
| 2 | |
| 3 | import sokol.gfx |
| 4 | |
| 5 | @[typedef] |
| 6 | pub struct C.sgl_pipeline { |
| 7 | id u32 |
| 8 | } |
| 9 | |
| 10 | pub type Pipeline = C.sgl_pipeline |
| 11 | |
| 12 | @[typedef] |
| 13 | pub struct C.sgl_context { |
| 14 | id u32 |
| 15 | } |
| 16 | |
| 17 | pub type Context = C.sgl_context |
| 18 | |
| 19 | // ContextDesc |
| 20 | // |
| 21 | // Describes the initialization parameters of a rendering context. |
| 22 | // Creating additional contexts is useful if you want to render |
| 23 | // in separate sokol-gfx passes. |
| 24 | // ContextDesc is sgl_context_desc_t |
| 25 | pub type ContextDesc = C.sgl_context_desc_t |
| 26 | |
| 27 | @[typedef] |
| 28 | pub struct C.sgl_context_desc_t { |
| 29 | max_vertices int // default: 64k |
| 30 | max_commands int // default: 16k |
| 31 | color_format gfx.PixelFormat // C.sg_pixel_format |
| 32 | depth_format gfx.PixelFormat // C.sg_pixel_format |
| 33 | sample_count int |
| 34 | } |
| 35 | |
| 36 | pub type Desc = C.sgl_desc_t |
| 37 | |
| 38 | @[typedef] |
| 39 | pub struct C.sgl_desc_t { |
| 40 | pub: |
| 41 | max_vertices int // size for vertex buffer |
| 42 | max_commands int // size of uniform- and command-buffers |
| 43 | context_pool_size int // max number of contexts (including default context), default: 4 |
| 44 | pipeline_pool_size int // size of internal pipeline pool, default: 64 |
| 45 | color_format gfx.PixelFormat // C.sg_pixel_format |
| 46 | depth_format gfx.PixelFormat // C.sg_pixel_format |
| 47 | sample_count int |
| 48 | face_winding gfx.FaceWinding // C.sg_face_winding // default front face winding is CCW |
| 49 | pub mut: |
| 50 | allocator C.sgl_allocator_t // optional memory allocation overrides (default: malloc/free) |
| 51 | logger C.sgl_logger_t // optional memory allocation overrides (default: SOKOL_LOG(message)) |
| 52 | } |
| 53 | |