1 // machine generated, do not edit
2 
3 module sokol.shape;
4 import sg = sokol.gfx;
5 
6 extern(C)
7 struct Range {
8     const(void)* ptr = null;
9     size_t size = 0;
10 }
11 extern(C)
12 struct Mat4 {
13     float[4][4] m = 0.0f;
14 }
15 extern(C)
16 struct Vertex {
17     float x = 0.0f;
18     float y = 0.0f;
19     float z = 0.0f;
20     uint normal = 0;
21     ushort u = 0;
22     ushort v = 0;
23     uint color = 0;
24 }
25 extern(C)
26 struct ElementRange {
27     uint base_element = 0;
28     uint num_elements = 0;
29 }
30 extern(C)
31 struct SizesItem {
32     uint num = 0;
33     uint size = 0;
34 }
35 extern(C)
36 struct Sizes {
37     SizesItem vertices;
38     SizesItem indices;
39 }
40 extern(C)
41 struct BufferItem {
42     Range buffer;
43     size_t data_size = 0;
44     size_t shape_offset = 0;
45 }
46 extern(C)
47 struct Buffer {
48     bool valid = false;
49     BufferItem vertices;
50     BufferItem indices;
51 }
52 extern(C)
53 struct Plane {
54     float width = 0.0f;
55     float depth = 0.0f;
56     ushort tiles = 0;
57     uint color = 0;
58     bool random_colors = false;
59     bool merge = false;
60     Mat4 transform;
61 }
62 extern(C)
63 struct Box {
64     float width = 0.0f;
65     float height = 0.0f;
66     float depth = 0.0f;
67     ushort tiles = 0;
68     uint color = 0;
69     bool random_colors = false;
70     bool merge = false;
71     Mat4 transform;
72 }
73 extern(C)
74 struct Sphere {
75     float radius = 0.0f;
76     ushort slices = 0;
77     ushort stacks = 0;
78     uint color = 0;
79     bool random_colors = false;
80     bool merge = false;
81     Mat4 transform;
82 }
83 extern(C)
84 struct Cylinder {
85     float radius = 0.0f;
86     float height = 0.0f;
87     ushort slices = 0;
88     ushort stacks = 0;
89     uint color = 0;
90     bool random_colors = false;
91     bool merge = false;
92     Mat4 transform;
93 }
94 extern(C)
95 struct Torus {
96     float radius = 0.0f;
97     float ring_radius = 0.0f;
98     ushort sides = 0;
99     ushort rings = 0;
100     uint color = 0;
101     bool random_colors = false;
102     bool merge = false;
103     Mat4 transform;
104 }
105 extern(C) Buffer sshape_build_plane(const Buffer *, const Plane *) @system @nogc nothrow;
106 Buffer buildPlane(scope ref Buffer buf, scope ref Plane params) @trusted @nogc nothrow {
107     return sshape_build_plane(&buf, &params);
108 }
109 extern(C) Buffer sshape_build_box(const Buffer *, const Box *) @system @nogc nothrow;
110 Buffer buildBox(scope ref Buffer buf, scope ref Box params) @trusted @nogc nothrow {
111     return sshape_build_box(&buf, &params);
112 }
113 extern(C) Buffer sshape_build_sphere(const Buffer *, const Sphere *) @system @nogc nothrow;
114 Buffer buildSphere(scope ref Buffer buf, scope ref Sphere params) @trusted @nogc nothrow {
115     return sshape_build_sphere(&buf, &params);
116 }
117 extern(C) Buffer sshape_build_cylinder(const Buffer *, const Cylinder *) @system @nogc nothrow;
118 Buffer buildCylinder(scope ref Buffer buf, scope ref Cylinder params) @trusted @nogc nothrow {
119     return sshape_build_cylinder(&buf, &params);
120 }
121 extern(C) Buffer sshape_build_torus(const Buffer *, const Torus *) @system @nogc nothrow;
122 Buffer buildTorus(scope ref Buffer buf, scope ref Torus params) @trusted @nogc nothrow {
123     return sshape_build_torus(&buf, &params);
124 }
125 extern(C) Sizes sshape_plane_sizes(uint) @system @nogc nothrow;
126 Sizes planeSizes(uint tiles) @trusted @nogc nothrow {
127     return sshape_plane_sizes(tiles);
128 }
129 extern(C) Sizes sshape_box_sizes(uint) @system @nogc nothrow;
130 Sizes boxSizes(uint tiles) @trusted @nogc nothrow {
131     return sshape_box_sizes(tiles);
132 }
133 extern(C) Sizes sshape_sphere_sizes(uint, uint) @system @nogc nothrow;
134 Sizes sphereSizes(uint slices, uint stacks) @trusted @nogc nothrow {
135     return sshape_sphere_sizes(slices, stacks);
136 }
137 extern(C) Sizes sshape_cylinder_sizes(uint, uint) @system @nogc nothrow;
138 Sizes cylinderSizes(uint slices, uint stacks) @trusted @nogc nothrow {
139     return sshape_cylinder_sizes(slices, stacks);
140 }
141 extern(C) Sizes sshape_torus_sizes(uint, uint) @system @nogc nothrow;
142 Sizes torusSizes(uint sides, uint rings) @trusted @nogc nothrow {
143     return sshape_torus_sizes(sides, rings);
144 }
145 extern(C) ElementRange sshape_element_range(const Buffer *) @system @nogc nothrow;
146 ElementRange elementRange(scope ref Buffer buf) @trusted @nogc nothrow {
147     return sshape_element_range(&buf);
148 }
149 extern(C) sg.BufferDesc sshape_vertex_buffer_desc(const Buffer *) @system @nogc nothrow;
150 sg.BufferDesc vertexBufferDesc(scope ref Buffer buf) @trusted @nogc nothrow {
151     return sshape_vertex_buffer_desc(&buf);
152 }
153 extern(C) sg.BufferDesc sshape_index_buffer_desc(const Buffer *) @system @nogc nothrow;
154 sg.BufferDesc indexBufferDesc(scope ref Buffer buf) @trusted @nogc nothrow {
155     return sshape_index_buffer_desc(&buf);
156 }
157 extern(C) sg.VertexBufferLayoutState sshape_vertex_buffer_layout_state() @system @nogc nothrow;
158 sg.VertexBufferLayoutState vertexBufferLayoutState() @trusted @nogc nothrow {
159     return sshape_vertex_buffer_layout_state();
160 }
161 extern(C) sg.VertexAttrState sshape_position_vertex_attr_state() @system @nogc nothrow;
162 sg.VertexAttrState positionVertexAttrState() @trusted @nogc nothrow {
163     return sshape_position_vertex_attr_state();
164 }
165 extern(C) sg.VertexAttrState sshape_normal_vertex_attr_state() @system @nogc nothrow;
166 sg.VertexAttrState normalVertexAttrState() @trusted @nogc nothrow {
167     return sshape_normal_vertex_attr_state();
168 }
169 extern(C) sg.VertexAttrState sshape_texcoord_vertex_attr_state() @system @nogc nothrow;
170 sg.VertexAttrState texcoordVertexAttrState() @trusted @nogc nothrow {
171     return sshape_texcoord_vertex_attr_state();
172 }
173 extern(C) sg.VertexAttrState sshape_color_vertex_attr_state() @system @nogc nothrow;
174 sg.VertexAttrState colorVertexAttrState() @trusted @nogc nothrow {
175     return sshape_color_vertex_attr_state();
176 }
177 extern(C) uint sshape_color_4f(float, float, float, float) @system @nogc nothrow;
178 uint color4f(float r, float g, float b, float a) @trusted @nogc nothrow {
179     return sshape_color_4f(r, g, b, a);
180 }
181 extern(C) uint sshape_color_3f(float, float, float) @system @nogc nothrow;
182 uint color3f(float r, float g, float b) @trusted @nogc nothrow {
183     return sshape_color_3f(r, g, b);
184 }
185 extern(C) uint sshape_color_4b(ubyte, ubyte, ubyte, ubyte) @system @nogc nothrow;
186 uint color4b(ubyte r, ubyte g, ubyte b, ubyte a) @trusted @nogc nothrow {
187     return sshape_color_4b(r, g, b, a);
188 }
189 extern(C) uint sshape_color_3b(ubyte, ubyte, ubyte) @system @nogc nothrow;
190 uint color3b(ubyte r, ubyte g, ubyte b) @trusted @nogc nothrow {
191     return sshape_color_3b(r, g, b);
192 }
193 extern(C) Mat4 sshape_mat4(const float *) @system @nogc nothrow;
194 Mat4 mat4(scope const float * m) @trusted @nogc nothrow {
195     return sshape_mat4(m);
196 }
197 extern(C) Mat4 sshape_mat4_transpose(const float *) @system @nogc nothrow;
198 Mat4 mat4Transpose(scope const float * m) @trusted @nogc nothrow {
199     return sshape_mat4_transpose(m);
200 }