1 /++
2 + Machine generated D bindings for Sokol library.
3 + 
4 +     Source header: sokol_gfx_imgui.h
5 +     Module: sokol.gfximgui
6 + 
7 +     Do not edit manually; regenerate using gen_d.py.
8 +/
9 module sokol.gfximgui;
10 import sg = sokol.gfx;
11 import sapp = sokol.app;
12 
13 extern(C) struct Str {
14     char[96] buf = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
15 }
16 extern(C) struct Buffer {
17     sg.Buffer res_id = {};
18     Str label = {};
19     sg.BufferDesc desc = {};
20 }
21 extern(C) struct Image {
22     sg.Image res_id = {};
23     float ui_scale = 0.0f;
24     Str label = {};
25     sg.ImageDesc desc = {};
26 }
27 extern(C) struct Sampler {
28     sg.Sampler res_id = {};
29     Str label = {};
30     sg.SamplerDesc desc = {};
31 }
32 extern(C) struct Shader {
33     sg.Shader res_id = {};
34     Str label = {};
35     Str vs_entry = {};
36     Str vs_d3d11_target = {};
37     Str fs_entry = {};
38     Str fs_d3d11_target = {};
39     Str[32] glsl_texture_sampler_name = [];
40     Str[8][16] glsl_uniform_name = [];
41     Str[16] attr_glsl_name = [];
42     Str[16] attr_hlsl_sem_name = [];
43     sg.ShaderDesc desc = {};
44 }
45 extern(C) struct Pipeline {
46     sg.Pipeline res_id = {};
47     Str label = {};
48     sg.PipelineDesc desc = {};
49 }
50 extern(C) struct View {
51     sg.View res_id = {};
52     float ui_scale = 0.0f;
53     Str label = {};
54     sg.ViewDesc desc = {};
55 }
56 extern(C) struct BufferWindow {
57     bool open = false;
58     sg.Buffer sel_buf = {};
59     int num_slots = 0;
60     Buffer* slots = null;
61 }
62 extern(C) struct ImageWindow {
63     bool open = false;
64     sg.Image sel_img = {};
65     int num_slots = 0;
66     Image* slots = null;
67 }
68 extern(C) struct SamplerWindow {
69     bool open = false;
70     sg.Sampler sel_smp = {};
71     int num_slots = 0;
72     Sampler* slots = null;
73 }
74 extern(C) struct ShaderWindow {
75     bool open = false;
76     sg.Shader sel_shd = {};
77     int num_slots = 0;
78     Shader* slots = null;
79 }
80 extern(C) struct PipelineWindow {
81     bool open = false;
82     sg.Pipeline sel_pip = {};
83     int num_slots = 0;
84     Pipeline* slots = null;
85 }
86 extern(C) struct ViewWindow {
87     bool open = false;
88     sg.View sel_view = {};
89     int num_slots = 0;
90     View* slots = null;
91 }
92 enum Cmd {
93     Invalid,
94     Reset_state_cache,
95     Make_buffer,
96     Make_image,
97     Make_sampler,
98     Make_shader,
99     Make_pipeline,
100     Make_view,
101     Destroy_buffer,
102     Destroy_image,
103     Destroy_sampler,
104     Destroy_shader,
105     Destroy_pipeline,
106     Destroy_view,
107     Update_buffer,
108     Update_image,
109     Append_buffer,
110     Begin_pass,
111     Apply_viewport,
112     Apply_scissor_rect,
113     Apply_pipeline,
114     Apply_bindings,
115     Apply_uniforms,
116     Draw,
117     Dispatch,
118     End_pass,
119     Commit,
120     Alloc_buffer,
121     Alloc_image,
122     Alloc_sampler,
123     Alloc_shader,
124     Alloc_pipeline,
125     Alloc_view,
126     Dealloc_buffer,
127     Dealloc_image,
128     Dealloc_sampler,
129     Dealloc_shader,
130     Dealloc_pipeline,
131     Dealloc_view,
132     Init_buffer,
133     Init_image,
134     Init_sampler,
135     Init_shader,
136     Init_pipeline,
137     Init_view,
138     Uninit_buffer,
139     Uninit_image,
140     Uninit_sampler,
141     Uninit_shader,
142     Uninit_pipeline,
143     Uninit_view,
144     Fail_buffer,
145     Fail_image,
146     Fail_sampler,
147     Fail_shader,
148     Fail_pipeline,
149     Fail_view,
150     Push_debug_group,
151     Pop_debug_group,
152 }
153 extern(C) struct ArgsMakeBuffer {
154     sg.Buffer result = {};
155 }
156 extern(C) struct ArgsMakeImage {
157     sg.Image result = {};
158 }
159 extern(C) struct ArgsMakeSampler {
160     sg.Sampler result = {};
161 }
162 extern(C) struct ArgsMakeShader {
163     sg.Shader result = {};
164 }
165 extern(C) struct ArgsMakePipeline {
166     sg.Pipeline result = {};
167 }
168 extern(C) struct ArgsMakeView {
169     sg.View result = {};
170 }
171 extern(C) struct ArgsDestroyBuffer {
172     sg.Buffer buffer = {};
173 }
174 extern(C) struct ArgsDestroyImage {
175     sg.Image image = {};
176 }
177 extern(C) struct ArgsDestroySampler {
178     sg.Sampler sampler = {};
179 }
180 extern(C) struct ArgsDestroyShader {
181     sg.Shader shader = {};
182 }
183 extern(C) struct ArgsDestroyPipeline {
184     sg.Pipeline pipeline = {};
185 }
186 extern(C) struct ArgsDestroyView {
187     sg.View view = {};
188 }
189 extern(C) struct ArgsUpdateBuffer {
190     sg.Buffer buffer = {};
191     size_t data_size = 0;
192 }
193 extern(C) struct ArgsUpdateImage {
194     sg.Image image = {};
195 }
196 extern(C) struct ArgsAppendBuffer {
197     sg.Buffer buffer = {};
198     size_t data_size = 0;
199     int result = 0;
200 }
201 extern(C) struct ArgsBeginPass {
202     sg.Pass pass = {};
203 }
204 extern(C) struct ArgsApplyViewport {
205     int x = 0;
206     int y = 0;
207     int width = 0;
208     int height = 0;
209     bool origin_top_left = false;
210 }
211 extern(C) struct ArgsApplyScissorRect {
212     int x = 0;
213     int y = 0;
214     int width = 0;
215     int height = 0;
216     bool origin_top_left = false;
217 }
218 extern(C) struct ArgsApplyPipeline {
219     sg.Pipeline pipeline = {};
220 }
221 extern(C) struct ArgsApplyBindings {
222     sg.Bindings bindings = {};
223 }
224 extern(C) struct ArgsApplyUniforms {
225     int ub_slot = 0;
226     size_t data_size = 0;
227     sg.Pipeline pipeline = {};
228     size_t ubuf_pos = 0;
229 }
230 extern(C) struct ArgsDraw {
231     int base_element = 0;
232     int num_elements = 0;
233     int num_instances = 0;
234 }
235 extern(C) struct ArgsDispatch {
236     int num_groups_x = 0;
237     int num_groups_y = 0;
238     int num_groups_z = 0;
239 }
240 extern(C) struct ArgsAllocBuffer {
241     sg.Buffer result = {};
242 }
243 extern(C) struct ArgsAllocImage {
244     sg.Image result = {};
245 }
246 extern(C) struct ArgsAllocSampler {
247     sg.Sampler result = {};
248 }
249 extern(C) struct ArgsAllocShader {
250     sg.Shader result = {};
251 }
252 extern(C) struct ArgsAllocPipeline {
253     sg.Pipeline result = {};
254 }
255 extern(C) struct ArgsAllocView {
256     sg.View result = {};
257 }
258 extern(C) struct ArgsDeallocBuffer {
259     sg.Buffer buffer = {};
260 }
261 extern(C) struct ArgsDeallocImage {
262     sg.Image image = {};
263 }
264 extern(C) struct ArgsDeallocSampler {
265     sg.Sampler sampler = {};
266 }
267 extern(C) struct ArgsDeallocShader {
268     sg.Shader shader = {};
269 }
270 extern(C) struct ArgsDeallocPipeline {
271     sg.Pipeline pipeline = {};
272 }
273 extern(C) struct ArgsDeallocView {
274     sg.View view = {};
275 }
276 extern(C) struct ArgsInitBuffer {
277     sg.Buffer buffer = {};
278 }
279 extern(C) struct ArgsInitImage {
280     sg.Image image = {};
281 }
282 extern(C) struct ArgsInitSampler {
283     sg.Sampler sampler = {};
284 }
285 extern(C) struct ArgsInitShader {
286     sg.Shader shader = {};
287 }
288 extern(C) struct ArgsInitPipeline {
289     sg.Pipeline pipeline = {};
290 }
291 extern(C) struct ArgsInitView {
292     sg.View view = {};
293 }
294 extern(C) struct ArgsUninitBuffer {
295     sg.Buffer buffer = {};
296 }
297 extern(C) struct ArgsUninitImage {
298     sg.Image image = {};
299 }
300 extern(C) struct ArgsUninitSampler {
301     sg.Sampler sampler = {};
302 }
303 extern(C) struct ArgsUninitShader {
304     sg.Shader shader = {};
305 }
306 extern(C) struct ArgsUninitPipeline {
307     sg.Pipeline pipeline = {};
308 }
309 extern(C) struct ArgsUninitView {
310     sg.View view = {};
311 }
312 extern(C) struct ArgsFailBuffer {
313     sg.Buffer buffer = {};
314 }
315 extern(C) struct ArgsFailImage {
316     sg.Image image = {};
317 }
318 extern(C) struct ArgsFailSampler {
319     sg.Sampler sampler = {};
320 }
321 extern(C) struct ArgsFailShader {
322     sg.Shader shader = {};
323 }
324 extern(C) struct ArgsFailPipeline {
325     sg.Pipeline pipeline = {};
326 }
327 extern(C) struct ArgsFailView {
328     sg.View view = {};
329 }
330 extern(C) struct ArgsPushDebugGroup {
331     Str name = {};
332 }
333 extern(C) struct Args {
334     ArgsMakeBuffer make_buffer = {};
335     ArgsMakeImage make_image = {};
336     ArgsMakeSampler make_sampler = {};
337     ArgsMakeShader make_shader = {};
338     ArgsMakePipeline make_pipeline = {};
339     ArgsMakeView make_view = {};
340     ArgsDestroyBuffer destroy_buffer = {};
341     ArgsDestroyImage destroy_image = {};
342     ArgsDestroySampler destroy_sampler = {};
343     ArgsDestroyShader destroy_shader = {};
344     ArgsDestroyPipeline destroy_pipeline = {};
345     ArgsDestroyView destroy_view = {};
346     ArgsUpdateBuffer update_buffer = {};
347     ArgsUpdateImage update_image = {};
348     ArgsAppendBuffer append_buffer = {};
349     ArgsBeginPass begin_pass = {};
350     ArgsApplyViewport apply_viewport = {};
351     ArgsApplyScissorRect apply_scissor_rect = {};
352     ArgsApplyPipeline apply_pipeline = {};
353     ArgsApplyBindings apply_bindings = {};
354     ArgsApplyUniforms apply_uniforms = {};
355     ArgsDraw draw = {};
356     ArgsDispatch dispatch = {};
357     ArgsAllocBuffer alloc_buffer = {};
358     ArgsAllocImage alloc_image = {};
359     ArgsAllocSampler alloc_sampler = {};
360     ArgsAllocShader alloc_shader = {};
361     ArgsAllocPipeline alloc_pipeline = {};
362     ArgsAllocView alloc_view = {};
363     ArgsDeallocBuffer dealloc_buffer = {};
364     ArgsDeallocImage dealloc_image = {};
365     ArgsDeallocSampler dealloc_sampler = {};
366     ArgsDeallocShader dealloc_shader = {};
367     ArgsDeallocPipeline dealloc_pipeline = {};
368     ArgsDeallocView dealloc_view = {};
369     ArgsInitBuffer init_buffer = {};
370     ArgsInitImage init_image = {};
371     ArgsInitSampler init_sampler = {};
372     ArgsInitShader init_shader = {};
373     ArgsInitPipeline init_pipeline = {};
374     ArgsInitView init_view = {};
375     ArgsUninitBuffer uninit_buffer = {};
376     ArgsUninitImage uninit_image = {};
377     ArgsUninitSampler uninit_sampler = {};
378     ArgsUninitShader uninit_shader = {};
379     ArgsUninitPipeline uninit_pipeline = {};
380     ArgsUninitView uninit_view = {};
381     ArgsFailBuffer fail_buffer = {};
382     ArgsFailImage fail_image = {};
383     ArgsFailSampler fail_sampler = {};
384     ArgsFailShader fail_shader = {};
385     ArgsFailPipeline fail_pipeline = {};
386     ArgsFailView fail_view = {};
387     ArgsPushDebugGroup push_debug_group = {};
388 }
389 extern(C) struct CaptureItem {
390     Cmd cmd = Cmd.Invalid;
391     uint color = 0;
392     Args args = {};
393 }
394 extern(C) struct CaptureBucket {
395     size_t ubuf_size = 0;
396     size_t ubuf_pos = 0;
397     ubyte* ubuf;
398     int num_items = 0;
399     CaptureItem[4096] items = [];
400 }
401 /++
402 + double-buffered call-capture buckets, one bucket is currently recorded,
403 +    the previous bucket is displayed
404 +/
405 extern(C) struct CaptureWindow {
406     bool open = false;
407     int bucket_index = 0;
408     int sel_item = 0;
409     CaptureBucket[2] bucket = [];
410 }
411 extern(C) struct CapsWindow {
412     bool open = false;
413 }
414 extern(C) struct FrameStatsWindow {
415     bool open = false;
416     bool disable_sokol_imgui_stats = false;
417     bool in_sokol_imgui = false;
418     sg.FrameStats stats = {};
419 }
420 /++
421 + sgimgui_allocator_t
422 + 
423 +     Used in sgimgui_desc_t to provide custom memory-alloc and -free functions
424 +     to sokol_gfx_imgui.h. If memory management should be overridden, both the
425 +     alloc and free function must be provided (e.g. it's not valid to
426 +     override one function but not the other).
427 +/
428 extern(C) struct Allocator {
429     extern(C) void* function(size_t, void*) alloc_fn = null;
430     extern(C) void function(void*, void*) free_fn = null;
431     void* user_data = null;
432 }
433 /++
434 + sgimgui_desc_t
435 + 
436 +     Initialization options for sgimgui_init().
437 +/
438 extern(C) struct Desc {
439     Allocator allocator = {};
440 }
441 extern(C) struct Sgimgui {
442     uint init_tag = 0;
443     Desc desc = {};
444     BufferWindow buffer_window = {};
445     ImageWindow image_window = {};
446     SamplerWindow sampler_window = {};
447     ShaderWindow shader_window = {};
448     PipelineWindow pipeline_window = {};
449     ViewWindow view_window = {};
450     CaptureWindow capture_window = {};
451     CapsWindow caps_window = {};
452     FrameStatsWindow frame_stats_window = {};
453     sg.Pipeline cur_pipeline = {};
454     sg.TraceHooks hooks = {};
455 }
456 extern(C) void sgimgui_init(const Sgimgui* ctx, const Desc* desc) @system @nogc nothrow pure;
457 void init(scope ref Sgimgui ctx, scope ref Desc desc) @trusted @nogc nothrow pure {
458     sgimgui_init(&ctx, &desc);
459 }
460 extern(C) void sgimgui_discard(const Sgimgui* ctx) @system @nogc nothrow pure;
461 void discard(scope ref Sgimgui ctx) @trusted @nogc nothrow pure {
462     sgimgui_discard(&ctx);
463 }
464 extern(C) void sgimgui_draw(const Sgimgui* ctx) @system @nogc nothrow pure;
465 void draw(scope ref Sgimgui ctx) @trusted @nogc nothrow pure {
466     sgimgui_draw(&ctx);
467 }
468 extern(C) void sgimgui_draw_menu(const Sgimgui* ctx, const(char)* title) @system @nogc nothrow pure;
469 void drawMenu(scope ref Sgimgui ctx, const(char)* title) @trusted @nogc nothrow pure {
470     sgimgui_draw_menu(&ctx, title);
471 }
472 extern(C) void sgimgui_draw_buffer_window_content(const Sgimgui* ctx) @system @nogc nothrow pure;
473 void drawBufferWindowContent(scope ref Sgimgui ctx) @trusted @nogc nothrow pure {
474     sgimgui_draw_buffer_window_content(&ctx);
475 }
476 extern(C) void sgimgui_draw_image_window_content(const Sgimgui* ctx) @system @nogc nothrow pure;
477 void drawImageWindowContent(scope ref Sgimgui ctx) @trusted @nogc nothrow pure {
478     sgimgui_draw_image_window_content(&ctx);
479 }
480 extern(C) void sgimgui_draw_sampler_window_content(const Sgimgui* ctx) @system @nogc nothrow pure;
481 void drawSamplerWindowContent(scope ref Sgimgui ctx) @trusted @nogc nothrow pure {
482     sgimgui_draw_sampler_window_content(&ctx);
483 }
484 extern(C) void sgimgui_draw_shader_window_content(const Sgimgui* ctx) @system @nogc nothrow pure;
485 void drawShaderWindowContent(scope ref Sgimgui ctx) @trusted @nogc nothrow pure {
486     sgimgui_draw_shader_window_content(&ctx);
487 }
488 extern(C) void sgimgui_draw_pipeline_window_content(const Sgimgui* ctx) @system @nogc nothrow pure;
489 void drawPipelineWindowContent(scope ref Sgimgui ctx) @trusted @nogc nothrow pure {
490     sgimgui_draw_pipeline_window_content(&ctx);
491 }
492 extern(C) void sgimgui_draw_view_window_content(const Sgimgui* ctx) @system @nogc nothrow pure;
493 void drawViewWindowContent(scope ref Sgimgui ctx) @trusted @nogc nothrow pure {
494     sgimgui_draw_view_window_content(&ctx);
495 }
496 extern(C) void sgimgui_draw_capture_window_content(const Sgimgui* ctx) @system @nogc nothrow pure;
497 void drawCaptureWindowContent(scope ref Sgimgui ctx) @trusted @nogc nothrow pure {
498     sgimgui_draw_capture_window_content(&ctx);
499 }
500 extern(C) void sgimgui_draw_capabilities_window_content(const Sgimgui* ctx) @system @nogc nothrow pure;
501 void drawCapabilitiesWindowContent(scope ref Sgimgui ctx) @trusted @nogc nothrow pure {
502     sgimgui_draw_capabilities_window_content(&ctx);
503 }
504 extern(C) void sgimgui_draw_frame_stats_window_content(const Sgimgui* ctx) @system @nogc nothrow pure;
505 void drawFrameStatsWindowContent(scope ref Sgimgui ctx) @trusted @nogc nothrow pure {
506     sgimgui_draw_frame_stats_window_content(&ctx);
507 }
508 extern(C) void sgimgui_draw_buffer_window(const Sgimgui* ctx) @system @nogc nothrow pure;
509 void drawBufferWindow(scope ref Sgimgui ctx) @trusted @nogc nothrow pure {
510     sgimgui_draw_buffer_window(&ctx);
511 }
512 extern(C) void sgimgui_draw_image_window(const Sgimgui* ctx) @system @nogc nothrow pure;
513 void drawImageWindow(scope ref Sgimgui ctx) @trusted @nogc nothrow pure {
514     sgimgui_draw_image_window(&ctx);
515 }
516 extern(C) void sgimgui_draw_sampler_window(const Sgimgui* ctx) @system @nogc nothrow pure;
517 void drawSamplerWindow(scope ref Sgimgui ctx) @trusted @nogc nothrow pure {
518     sgimgui_draw_sampler_window(&ctx);
519 }
520 extern(C) void sgimgui_draw_shader_window(const Sgimgui* ctx) @system @nogc nothrow pure;
521 void drawShaderWindow(scope ref Sgimgui ctx) @trusted @nogc nothrow pure {
522     sgimgui_draw_shader_window(&ctx);
523 }
524 extern(C) void sgimgui_draw_pipeline_window(const Sgimgui* ctx) @system @nogc nothrow pure;
525 void drawPipelineWindow(scope ref Sgimgui ctx) @trusted @nogc nothrow pure {
526     sgimgui_draw_pipeline_window(&ctx);
527 }
528 extern(C) void sgimgui_draw_view_window(const Sgimgui* ctx) @system @nogc nothrow pure;
529 void drawViewWindow(scope ref Sgimgui ctx) @trusted @nogc nothrow pure {
530     sgimgui_draw_view_window(&ctx);
531 }
532 extern(C) void sgimgui_draw_capture_window(const Sgimgui* ctx) @system @nogc nothrow pure;
533 void drawCaptureWindow(scope ref Sgimgui ctx) @trusted @nogc nothrow pure {
534     sgimgui_draw_capture_window(&ctx);
535 }
536 extern(C) void sgimgui_draw_capabilities_window(const Sgimgui* ctx) @system @nogc nothrow pure;
537 void drawCapabilitiesWindow(scope ref Sgimgui ctx) @trusted @nogc nothrow pure {
538     sgimgui_draw_capabilities_window(&ctx);
539 }
540 extern(C) void sgimgui_draw_frame_stats_window(const Sgimgui* ctx) @system @nogc nothrow pure;
541 void drawFrameStatsWindow(scope ref Sgimgui ctx) @trusted @nogc nothrow pure {
542     sgimgui_draw_frame_stats_window(&ctx);
543 }