1 // machine generated, do not edit 2 3 module sokol.gl; 4 import sg = sokol.gfx; 5 6 enum LogItem { 7 Ok, 8 Malloc_failed, 9 Make_pipeline_failed, 10 Pipeline_pool_exhausted, 11 Add_commit_listener_failed, 12 Context_pool_exhausted, 13 Cannot_destroy_default_context, 14 } 15 extern(C) 16 struct Logger { 17 extern(C) void function(const(char)*, uint, uint, const(char)*, uint, const(char)*, void*) func = null; 18 void* user_data = null; 19 } 20 extern(C) 21 struct Pipeline { 22 uint id = 0; 23 } 24 extern(C) 25 struct Context { 26 uint id = 0; 27 } 28 extern(C) 29 struct Error { 30 bool any = false; 31 bool vertices_full = false; 32 bool uniforms_full = false; 33 bool commands_full = false; 34 bool stack_overflow = false; 35 bool stack_underflow = false; 36 bool no_context = false; 37 } 38 extern(C) 39 struct ContextDesc { 40 int max_vertices = 0; 41 int max_commands = 0; 42 sg.PixelFormat color_format; 43 sg.PixelFormat depth_format; 44 int sample_count = 0; 45 } 46 extern(C) 47 struct Allocator { 48 extern(C) void* function(size_t, void*) alloc_fn = null; 49 extern(C) void function(void*, void*) free_fn = null; 50 void* user_data = null; 51 } 52 extern(C) 53 struct Desc { 54 int max_vertices = 0; 55 int max_commands = 0; 56 int context_pool_size = 0; 57 int pipeline_pool_size = 0; 58 sg.PixelFormat color_format; 59 sg.PixelFormat depth_format; 60 int sample_count = 0; 61 sg.FaceWinding face_winding; 62 Allocator allocator; 63 Logger logger; 64 } 65 extern(C) void sgl_setup(const Desc *) @system @nogc nothrow; 66 void setup(scope ref Desc desc) @trusted @nogc nothrow { 67 sgl_setup(&desc); 68 } 69 extern(C) void sgl_shutdown() @system @nogc nothrow; 70 void shutdown() @trusted @nogc nothrow { 71 sgl_shutdown(); 72 } 73 extern(C) float sgl_rad(float) @system @nogc nothrow; 74 float asRadians(float deg) @trusted @nogc nothrow { 75 return sgl_rad(deg); 76 } 77 extern(C) float sgl_deg(float) @system @nogc nothrow; 78 float asDegrees(float rad) @trusted @nogc nothrow { 79 return sgl_deg(rad); 80 } 81 extern(C) Error sgl_error() @system @nogc nothrow; 82 Error getError() @trusted @nogc nothrow { 83 return sgl_error(); 84 } 85 extern(C) Error sgl_context_error(Context) @system @nogc nothrow; 86 Error contextError(Context ctx) @trusted @nogc nothrow { 87 return sgl_context_error(ctx); 88 } 89 extern(C) Context sgl_make_context(const ContextDesc *) @system @nogc nothrow; 90 Context makeContext(scope ref ContextDesc desc) @trusted @nogc nothrow { 91 return sgl_make_context(&desc); 92 } 93 extern(C) void sgl_destroy_context(Context) @system @nogc nothrow; 94 void destroyContext(Context ctx) @trusted @nogc nothrow { 95 sgl_destroy_context(ctx); 96 } 97 extern(C) void sgl_set_context(Context) @system @nogc nothrow; 98 void setContext(Context ctx) @trusted @nogc nothrow { 99 sgl_set_context(ctx); 100 } 101 extern(C) Context sgl_get_context() @system @nogc nothrow; 102 Context getContext() @trusted @nogc nothrow { 103 return sgl_get_context(); 104 } 105 extern(C) Context sgl_default_context() @system @nogc nothrow; 106 Context defaultContext() @trusted @nogc nothrow { 107 return sgl_default_context(); 108 } 109 extern(C) int sgl_num_vertices() @system @nogc nothrow; 110 int numVertices() @trusted @nogc nothrow { 111 return sgl_num_vertices(); 112 } 113 extern(C) int sgl_num_commands() @system @nogc nothrow; 114 int numCommands() @trusted @nogc nothrow { 115 return sgl_num_commands(); 116 } 117 extern(C) void sgl_draw() @system @nogc nothrow; 118 void draw() @trusted @nogc nothrow { 119 sgl_draw(); 120 } 121 extern(C) void sgl_context_draw(Context) @system @nogc nothrow; 122 void contextDraw(Context ctx) @trusted @nogc nothrow { 123 sgl_context_draw(ctx); 124 } 125 extern(C) void sgl_draw_layer(int) @system @nogc nothrow; 126 void drawLayer(int layer_id) @trusted @nogc nothrow { 127 sgl_draw_layer(layer_id); 128 } 129 extern(C) void sgl_context_draw_layer(Context, int) @system @nogc nothrow; 130 void contextDrawLayer(Context ctx, int layer_id) @trusted @nogc nothrow { 131 sgl_context_draw_layer(ctx, layer_id); 132 } 133 extern(C) Pipeline sgl_make_pipeline(const sg.PipelineDesc *) @system @nogc nothrow; 134 Pipeline makePipeline(scope ref sg.PipelineDesc desc) @trusted @nogc nothrow { 135 return sgl_make_pipeline(&desc); 136 } 137 extern(C) Pipeline sgl_context_make_pipeline(Context, const sg.PipelineDesc *) @system @nogc nothrow; 138 Pipeline contextMakePipeline(Context ctx, scope ref sg.PipelineDesc desc) @trusted @nogc nothrow { 139 return sgl_context_make_pipeline(ctx, &desc); 140 } 141 extern(C) void sgl_destroy_pipeline(Pipeline) @system @nogc nothrow; 142 void destroyPipeline(Pipeline pip) @trusted @nogc nothrow { 143 sgl_destroy_pipeline(pip); 144 } 145 extern(C) void sgl_defaults() @system @nogc nothrow; 146 void defaults() @trusted @nogc nothrow { 147 sgl_defaults(); 148 } 149 extern(C) void sgl_viewport(int, int, int, int, bool) @system @nogc nothrow; 150 void viewport(int x, int y, int w, int h, bool origin_top_left) @trusted @nogc nothrow { 151 sgl_viewport(x, y, w, h, origin_top_left); 152 } 153 extern(C) void sgl_viewportf(float, float, float, float, bool) @system @nogc nothrow; 154 void viewportf(float x, float y, float w, float h, bool origin_top_left) @trusted @nogc nothrow { 155 sgl_viewportf(x, y, w, h, origin_top_left); 156 } 157 extern(C) void sgl_scissor_rect(int, int, int, int, bool) @system @nogc nothrow; 158 void scissorRect(int x, int y, int w, int h, bool origin_top_left) @trusted @nogc nothrow { 159 sgl_scissor_rect(x, y, w, h, origin_top_left); 160 } 161 extern(C) void sgl_scissor_rectf(float, float, float, float, bool) @system @nogc nothrow; 162 void scissorRectf(float x, float y, float w, float h, bool origin_top_left) @trusted @nogc nothrow { 163 sgl_scissor_rectf(x, y, w, h, origin_top_left); 164 } 165 extern(C) void sgl_enable_texture() @system @nogc nothrow; 166 void enableTexture() @trusted @nogc nothrow { 167 sgl_enable_texture(); 168 } 169 extern(C) void sgl_disable_texture() @system @nogc nothrow; 170 void disableTexture() @trusted @nogc nothrow { 171 sgl_disable_texture(); 172 } 173 extern(C) void sgl_texture(sg.Image, sg.Sampler) @system @nogc nothrow; 174 void texture(sg.Image img, sg.Sampler smp) @trusted @nogc nothrow { 175 sgl_texture(img, smp); 176 } 177 extern(C) void sgl_layer(int) @system @nogc nothrow; 178 void layer(int layer_id) @trusted @nogc nothrow { 179 sgl_layer(layer_id); 180 } 181 extern(C) void sgl_load_default_pipeline() @system @nogc nothrow; 182 void loadDefaultPipeline() @trusted @nogc nothrow { 183 sgl_load_default_pipeline(); 184 } 185 extern(C) void sgl_load_pipeline(Pipeline) @system @nogc nothrow; 186 void loadPipeline(Pipeline pip) @trusted @nogc nothrow { 187 sgl_load_pipeline(pip); 188 } 189 extern(C) void sgl_push_pipeline() @system @nogc nothrow; 190 void pushPipeline() @trusted @nogc nothrow { 191 sgl_push_pipeline(); 192 } 193 extern(C) void sgl_pop_pipeline() @system @nogc nothrow; 194 void popPipeline() @trusted @nogc nothrow { 195 sgl_pop_pipeline(); 196 } 197 extern(C) void sgl_matrix_mode_modelview() @system @nogc nothrow; 198 void matrixModeModelview() @trusted @nogc nothrow { 199 sgl_matrix_mode_modelview(); 200 } 201 extern(C) void sgl_matrix_mode_projection() @system @nogc nothrow; 202 void matrixModeProjection() @trusted @nogc nothrow { 203 sgl_matrix_mode_projection(); 204 } 205 extern(C) void sgl_matrix_mode_texture() @system @nogc nothrow; 206 void matrixModeTexture() @trusted @nogc nothrow { 207 sgl_matrix_mode_texture(); 208 } 209 extern(C) void sgl_load_identity() @system @nogc nothrow; 210 void loadIdentity() @trusted @nogc nothrow { 211 sgl_load_identity(); 212 } 213 extern(C) void sgl_load_matrix(const float *) @system @nogc nothrow; 214 void loadMatrix(scope const float * m) @trusted @nogc nothrow { 215 sgl_load_matrix(m); 216 } 217 extern(C) void sgl_load_transpose_matrix(const float *) @system @nogc nothrow; 218 void loadTransposeMatrix(scope const float * m) @trusted @nogc nothrow { 219 sgl_load_transpose_matrix(m); 220 } 221 extern(C) void sgl_mult_matrix(const float *) @system @nogc nothrow; 222 void multMatrix(scope const float * m) @trusted @nogc nothrow { 223 sgl_mult_matrix(m); 224 } 225 extern(C) void sgl_mult_transpose_matrix(const float *) @system @nogc nothrow; 226 void multTransposeMatrix(scope const float * m) @trusted @nogc nothrow { 227 sgl_mult_transpose_matrix(m); 228 } 229 extern(C) void sgl_rotate(float, float, float, float) @system @nogc nothrow; 230 void rotate(float angle_rad, float x, float y, float z) @trusted @nogc nothrow { 231 sgl_rotate(angle_rad, x, y, z); 232 } 233 extern(C) void sgl_scale(float, float, float) @system @nogc nothrow; 234 void scale(float x, float y, float z) @trusted @nogc nothrow { 235 sgl_scale(x, y, z); 236 } 237 extern(C) void sgl_translate(float, float, float) @system @nogc nothrow; 238 void translate(float x, float y, float z) @trusted @nogc nothrow { 239 sgl_translate(x, y, z); 240 } 241 extern(C) void sgl_frustum(float, float, float, float, float, float) @system @nogc nothrow; 242 void frustum(float l, float r, float b, float t, float n, float f) @trusted @nogc nothrow { 243 sgl_frustum(l, r, b, t, n, f); 244 } 245 extern(C) void sgl_ortho(float, float, float, float, float, float) @system @nogc nothrow; 246 void ortho(float l, float r, float b, float t, float n, float f) @trusted @nogc nothrow { 247 sgl_ortho(l, r, b, t, n, f); 248 } 249 extern(C) void sgl_perspective(float, float, float, float) @system @nogc nothrow; 250 void perspective(float fov_y, float aspect, float z_near, float z_far) @trusted @nogc nothrow { 251 sgl_perspective(fov_y, aspect, z_near, z_far); 252 } 253 extern(C) void sgl_lookat(float, float, float, float, float, float, float, float, float) @system @nogc nothrow; 254 void lookat(float eye_x, float eye_y, float eye_z, float center_x, float center_y, float center_z, float up_x, float up_y, float up_z) @trusted @nogc nothrow { 255 sgl_lookat(eye_x, eye_y, eye_z, center_x, center_y, center_z, up_x, up_y, up_z); 256 } 257 extern(C) void sgl_push_matrix() @system @nogc nothrow; 258 void pushMatrix() @trusted @nogc nothrow { 259 sgl_push_matrix(); 260 } 261 extern(C) void sgl_pop_matrix() @system @nogc nothrow; 262 void popMatrix() @trusted @nogc nothrow { 263 sgl_pop_matrix(); 264 } 265 extern(C) void sgl_t2f(float, float) @system @nogc nothrow; 266 void t2f(float u, float v) @trusted @nogc nothrow { 267 sgl_t2f(u, v); 268 } 269 extern(C) void sgl_c3f(float, float, float) @system @nogc nothrow; 270 void c3f(float r, float g, float b) @trusted @nogc nothrow { 271 sgl_c3f(r, g, b); 272 } 273 extern(C) void sgl_c4f(float, float, float, float) @system @nogc nothrow; 274 void c4f(float r, float g, float b, float a) @trusted @nogc nothrow { 275 sgl_c4f(r, g, b, a); 276 } 277 extern(C) void sgl_c3b(ubyte, ubyte, ubyte) @system @nogc nothrow; 278 void c3b(ubyte r, ubyte g, ubyte b) @trusted @nogc nothrow { 279 sgl_c3b(r, g, b); 280 } 281 extern(C) void sgl_c4b(ubyte, ubyte, ubyte, ubyte) @system @nogc nothrow; 282 void c4b(ubyte r, ubyte g, ubyte b, ubyte a) @trusted @nogc nothrow { 283 sgl_c4b(r, g, b, a); 284 } 285 extern(C) void sgl_c1i(uint) @system @nogc nothrow; 286 void c1i(uint rgba) @trusted @nogc nothrow { 287 sgl_c1i(rgba); 288 } 289 extern(C) void sgl_point_size(float) @system @nogc nothrow; 290 void pointSize(float s) @trusted @nogc nothrow { 291 sgl_point_size(s); 292 } 293 extern(C) void sgl_begin_points() @system @nogc nothrow; 294 void beginPoints() @trusted @nogc nothrow { 295 sgl_begin_points(); 296 } 297 extern(C) void sgl_begin_lines() @system @nogc nothrow; 298 void beginLines() @trusted @nogc nothrow { 299 sgl_begin_lines(); 300 } 301 extern(C) void sgl_begin_line_strip() @system @nogc nothrow; 302 void beginLineStrip() @trusted @nogc nothrow { 303 sgl_begin_line_strip(); 304 } 305 extern(C) void sgl_begin_triangles() @system @nogc nothrow; 306 void beginTriangles() @trusted @nogc nothrow { 307 sgl_begin_triangles(); 308 } 309 extern(C) void sgl_begin_triangle_strip() @system @nogc nothrow; 310 void beginTriangleStrip() @trusted @nogc nothrow { 311 sgl_begin_triangle_strip(); 312 } 313 extern(C) void sgl_begin_quads() @system @nogc nothrow; 314 void beginQuads() @trusted @nogc nothrow { 315 sgl_begin_quads(); 316 } 317 extern(C) void sgl_v2f(float, float) @system @nogc nothrow; 318 void v2f(float x, float y) @trusted @nogc nothrow { 319 sgl_v2f(x, y); 320 } 321 extern(C) void sgl_v3f(float, float, float) @system @nogc nothrow; 322 void v3f(float x, float y, float z) @trusted @nogc nothrow { 323 sgl_v3f(x, y, z); 324 } 325 extern(C) void sgl_v2f_t2f(float, float, float, float) @system @nogc nothrow; 326 void v2fT2f(float x, float y, float u, float v) @trusted @nogc nothrow { 327 sgl_v2f_t2f(x, y, u, v); 328 } 329 extern(C) void sgl_v3f_t2f(float, float, float, float, float) @system @nogc nothrow; 330 void v3fT2f(float x, float y, float z, float u, float v) @trusted @nogc nothrow { 331 sgl_v3f_t2f(x, y, z, u, v); 332 } 333 extern(C) void sgl_v2f_c3f(float, float, float, float, float) @system @nogc nothrow; 334 void v2fC3f(float x, float y, float r, float g, float b) @trusted @nogc nothrow { 335 sgl_v2f_c3f(x, y, r, g, b); 336 } 337 extern(C) void sgl_v2f_c3b(float, float, ubyte, ubyte, ubyte) @system @nogc nothrow; 338 void v2fC3b(float x, float y, ubyte r, ubyte g, ubyte b) @trusted @nogc nothrow { 339 sgl_v2f_c3b(x, y, r, g, b); 340 } 341 extern(C) void sgl_v2f_c4f(float, float, float, float, float, float) @system @nogc nothrow; 342 void v2fC4f(float x, float y, float r, float g, float b, float a) @trusted @nogc nothrow { 343 sgl_v2f_c4f(x, y, r, g, b, a); 344 } 345 extern(C) void sgl_v2f_c4b(float, float, ubyte, ubyte, ubyte, ubyte) @system @nogc nothrow; 346 void v2fC4b(float x, float y, ubyte r, ubyte g, ubyte b, ubyte a) @trusted @nogc nothrow { 347 sgl_v2f_c4b(x, y, r, g, b, a); 348 } 349 extern(C) void sgl_v2f_c1i(float, float, uint) @system @nogc nothrow; 350 void v2fC1i(float x, float y, uint rgba) @trusted @nogc nothrow { 351 sgl_v2f_c1i(x, y, rgba); 352 } 353 extern(C) void sgl_v3f_c3f(float, float, float, float, float, float) @system @nogc nothrow; 354 void v3fC3f(float x, float y, float z, float r, float g, float b) @trusted @nogc nothrow { 355 sgl_v3f_c3f(x, y, z, r, g, b); 356 } 357 extern(C) void sgl_v3f_c3b(float, float, float, ubyte, ubyte, ubyte) @system @nogc nothrow; 358 void v3fC3b(float x, float y, float z, ubyte r, ubyte g, ubyte b) @trusted @nogc nothrow { 359 sgl_v3f_c3b(x, y, z, r, g, b); 360 } 361 extern(C) void sgl_v3f_c4f(float, float, float, float, float, float, float) @system @nogc nothrow; 362 void v3fC4f(float x, float y, float z, float r, float g, float b, float a) @trusted @nogc nothrow { 363 sgl_v3f_c4f(x, y, z, r, g, b, a); 364 } 365 extern(C) void sgl_v3f_c4b(float, float, float, ubyte, ubyte, ubyte, ubyte) @system @nogc nothrow; 366 void v3fC4b(float x, float y, float z, ubyte r, ubyte g, ubyte b, ubyte a) @trusted @nogc nothrow { 367 sgl_v3f_c4b(x, y, z, r, g, b, a); 368 } 369 extern(C) void sgl_v3f_c1i(float, float, float, uint) @system @nogc nothrow; 370 void v3fC1i(float x, float y, float z, uint rgba) @trusted @nogc nothrow { 371 sgl_v3f_c1i(x, y, z, rgba); 372 } 373 extern(C) void sgl_v2f_t2f_c3f(float, float, float, float, float, float, float) @system @nogc nothrow; 374 void v2fT2fC3f(float x, float y, float u, float v, float r, float g, float b) @trusted @nogc nothrow { 375 sgl_v2f_t2f_c3f(x, y, u, v, r, g, b); 376 } 377 extern(C) void sgl_v2f_t2f_c3b(float, float, float, float, ubyte, ubyte, ubyte) @system @nogc nothrow; 378 void v2fT2fC3b(float x, float y, float u, float v, ubyte r, ubyte g, ubyte b) @trusted @nogc nothrow { 379 sgl_v2f_t2f_c3b(x, y, u, v, r, g, b); 380 } 381 extern(C) void sgl_v2f_t2f_c4f(float, float, float, float, float, float, float, float) @system @nogc nothrow; 382 void v2fT2fC4f(float x, float y, float u, float v, float r, float g, float b, float a) @trusted @nogc nothrow { 383 sgl_v2f_t2f_c4f(x, y, u, v, r, g, b, a); 384 } 385 extern(C) void sgl_v2f_t2f_c4b(float, float, float, float, ubyte, ubyte, ubyte, ubyte) @system @nogc nothrow; 386 void v2fT2fC4b(float x, float y, float u, float v, ubyte r, ubyte g, ubyte b, ubyte a) @trusted @nogc nothrow { 387 sgl_v2f_t2f_c4b(x, y, u, v, r, g, b, a); 388 } 389 extern(C) void sgl_v2f_t2f_c1i(float, float, float, float, uint) @system @nogc nothrow; 390 void v2fT2fC1i(float x, float y, float u, float v, uint rgba) @trusted @nogc nothrow { 391 sgl_v2f_t2f_c1i(x, y, u, v, rgba); 392 } 393 extern(C) void sgl_v3f_t2f_c3f(float, float, float, float, float, float, float, float) @system @nogc nothrow; 394 void v3fT2fC3f(float x, float y, float z, float u, float v, float r, float g, float b) @trusted @nogc nothrow { 395 sgl_v3f_t2f_c3f(x, y, z, u, v, r, g, b); 396 } 397 extern(C) void sgl_v3f_t2f_c3b(float, float, float, float, float, ubyte, ubyte, ubyte) @system @nogc nothrow; 398 void v3fT2fC3b(float x, float y, float z, float u, float v, ubyte r, ubyte g, ubyte b) @trusted @nogc nothrow { 399 sgl_v3f_t2f_c3b(x, y, z, u, v, r, g, b); 400 } 401 extern(C) void sgl_v3f_t2f_c4f(float, float, float, float, float, float, float, float, float) @system @nogc nothrow; 402 void v3fT2fC4f(float x, float y, float z, float u, float v, float r, float g, float b, float a) @trusted @nogc nothrow { 403 sgl_v3f_t2f_c4f(x, y, z, u, v, r, g, b, a); 404 } 405 extern(C) void sgl_v3f_t2f_c4b(float, float, float, float, float, ubyte, ubyte, ubyte, ubyte) @system @nogc nothrow; 406 void v3fT2fC4b(float x, float y, float z, float u, float v, ubyte r, ubyte g, ubyte b, ubyte a) @trusted @nogc nothrow { 407 sgl_v3f_t2f_c4b(x, y, z, u, v, r, g, b, a); 408 } 409 extern(C) void sgl_v3f_t2f_c1i(float, float, float, float, float, uint) @system @nogc nothrow; 410 void v3fT2fC1i(float x, float y, float z, float u, float v, uint rgba) @trusted @nogc nothrow { 411 sgl_v3f_t2f_c1i(x, y, z, u, v, rgba); 412 } 413 extern(C) void sgl_end() @system @nogc nothrow; 414 void end() @trusted @nogc nothrow { 415 sgl_end(); 416 }