1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

sokol: type alias all sgl structs, support sgl_context (#13018)

This commit is contained in:
Larpon
2022-01-03 14:05:24 +01:00
committed by GitHub
parent 9974495f5e
commit 88a973b617
16 changed files with 128 additions and 39 deletions

View File

@ -1,24 +1,47 @@
module sgl
// should be in a proper module
pub enum SglError {
no_error
vertices_full
commands_full
stack_overflow
stack_underfloat
}
import sokol.gfx
pub struct C.sgl_pipeline {
[typedef]
struct C.sgl_pipeline {
id u32
}
pub struct C.sgl_desc_t {
pub type Pipeline = C.sgl_pipeline
[typedef]
struct C.sgl_context {
id u32
}
pub type Context = C.sgl_context
// ContextDesc
//
// Describes the initialization parameters of a rendering context.
// Creating additional contexts is useful if you want to render
// in separate sokol-gfx passes.
// ContextDesc is sgl_context_desc_t
pub type ContextDesc = C.sgl_context_desc_t
[typedef]
struct C.sgl_context_desc_t {
max_vertices int // default: 64k
max_commands int // default: 16k
color_format gfx.PixelFormat // C.sg_pixel_format
depth_format gfx.PixelFormat // C.sg_pixel_format
sample_count int
}
pub type Desc = C.sgl_desc_t
[typedef]
struct C.sgl_desc_t {
max_vertices int // size for vertex buffer
max_commands int // size of uniform- and command-buffers
pipeline_pool_size int // size of the internal pipeline pool, default is 64
color_format C.sg_pixel_format
depth_format C.sg_pixel_format
color_format gfx.PixelFormat // C.sg_pixel_format
depth_format gfx.PixelFormat // C.sg_pixel_format
sample_count int
face_winding C.sg_face_winding // default front face winding is CCW
face_winding gfx.FaceWinding // C.sg_face_winding // default front face winding is CCW
}