v2 / vlib / sokol / sgl / sgl_structs.c.v
52 lines · 43 sloc · 1.52 KB · 227dbc7d4a3943fe8f1541f595b6ef9851bef552
Raw
1module sgl
2
3import sokol.gfx
4
5@[typedef]
6pub struct C.sgl_pipeline {
7 id u32
8}
9
10pub type Pipeline = C.sgl_pipeline
11
12@[typedef]
13pub struct C.sgl_context {
14 id u32
15}
16
17pub 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
25pub type ContextDesc = C.sgl_context_desc_t
26
27@[typedef]
28pub 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
36pub type Desc = C.sgl_desc_t
37
38@[typedef]
39pub struct C.sgl_desc_t {
40pub:
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
49pub 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