sokol/shape
sokol_shape
Types
13Box
Box :: struct {
width: f32,
height: f32,
depth: f32,
tiles: u16,
color: u32,
random_colors: bool,
merge: bool,
transform: Mat4,
}SourceBuffer_State
Buffer_State :: struct {
buffer: Range,
data_size: c.size_t,
shape_offset: c.size_t,
}Sourcein/out struct to keep track of mesh-build state
Cylinder
Cylinder :: struct {
radius: f32,
height: f32,
slices: u16,
stacks: u16,
color: u32,
random_colors: bool,
merge: bool,
transform: Mat4,
}SourceElement_Range
Element_Range :: struct {
base_element: c.int,
num_elements: c.int,
}Sourcea range of draw-elements (sg_draw(int base_element, int num_element, ...))
Mat4
Mat4 :: struct {
m: [4][4]f32,
}Sourcea 4x4 matrix wrapper struct
Optional_Components
Optional_Components :: struct {
normals: bool,
texcoords: bool,
colors: bool,
}Sourcea struct for configuring optional vertex components
Plane
Plane :: struct {
width: f32,
depth: f32,
tiles: u16,
color: u32,
random_colors: bool,
merge: bool,
transform: Mat4,
}Sourcecreation parameters for the different shape types
Range
Range :: struct {
ptr: rawptr,
size: c.size_t,
}Sourcesshape_range_t is a pointer-size-pair struct used to pass memory blobs into sokol-shape. When initialized from a value type (array or struct), use the SSHAPE_RANGE() macro to build an sshape_range struct.
Sizes
Sizes :: struct {
vertices: Sizes_Item,
indices: Sizes_Item,
}SourceSizes_Item
Sizes_Item :: struct {
num: u32,
size: u32,
}Sourcenumber of elements and byte size of build actions
Sphere
Sphere :: struct {
radius: f32,
slices: u16,
stacks: u16,
color: u32,
random_colors: bool,
merge: bool,
transform: Mat4,
}SourceState
State :: struct {
valid: bool,
disable: Optional_Components,
vertices: Buffer_State,
indices: Buffer_State,
}SourceTorus
Torus :: struct {
radius: f32,
ring_radius: f32,
sides: u16,
rings: u16,
color: u32,
random_colors: bool,
merge: bool,
transform: Mat4,
}SourceConstants
6DEBUG
DEBUG :: _ = #config(SOKOL_SHAPE_DEBUG, SOKOL_DEBUG)SourceMAX_VERTEX_SIZE
MAX_VERTEX_SIZE :: 24SourceMIN_VERTEX_SIZE
MIN_VERTEX_SIZE :: 12SourceSOKOL_DEBUG
SOKOL_DEBUG :: _ = #config(SOKOL_DEBUG, ODIN_DEBUG)SourceUSE_DLL
USE_DLL :: _ = #config(SOKOL_DLL, false)SourceUSE_GL
USE_GL :: _ = #config(SOKOL_USE_GL, false)Source