1 /++
2 + Machine generated D bindings for Sokol library.
3 + 
4 +     Source header: sokol_imgui.h
5 +     Module: sokol.imgui
6 + 
7 +     Do not edit manually; regenerate using gen_d.py.
8 +/
9 module sokol.imgui;
10 import sg = sokol.gfx;
11 import sapp = sokol.app;
12 
13 enum LogItem {
14     Ok,
15     Buffer_overflow,
16     New_frame_not_called_before_flush,
17     Flush_called_in_sokolgfx_pass,
18     Flush_not_called_before_draw,
19     Draw_called_outside_sokolgfx_render_pass,
20 }
21 /++
22 + simgui_logger
23 + 
24 +     Used in simgui_desc_t to provide a logging function. Please be aware
25 +     that without logging function, sokol-imgui will be completely
26 +     silent, e.g. it will not report errors, warnings and
27 +     validation layer messages. For maximum error verbosity,
28 +     compile in debug mode (e.g. NDEBUG *not* defined) and install
29 +     a logger (for instance the standard logging function from sokol_log.h).
30 +/
31 extern(C) struct Logger {
32     extern(C) void function(const(char)*, uint, uint, const(char)*, uint, const(char)*, void*) func = null;
33     void* user_data = null;
34 }
35 extern(C) struct Desc {
36     int max_vertices = 0;
37     sg.PixelFormat color_format = sg.PixelFormat.Default;
38     sg.PixelFormat depth_format = sg.PixelFormat.Default;
39     int sample_count = 0;
40     const(char)* ini_filename = null;
41     bool no_default_font = false;
42     bool disable_paste_override = false;
43     bool disable_set_mouse_cursor = false;
44     bool disable_windows_resize_from_edges = false;
45     bool write_alpha_channel = false;
46     Logger logger = {};
47 }
48 extern(C) struct FrameDesc {
49     int width = 0;
50     int height = 0;
51     double delta_time = 0.0;
52     float dpi_scale = 0.0f;
53 }
54 extern(C) struct FontTexDesc {
55     sg.Filter min_filter = sg.Filter.Default;
56     sg.Filter mag_filter = sg.Filter.Default;
57 }
58 extern(C) void simgui_setup(const Desc* desc) @system @nogc nothrow pure;
59 void setup(scope ref Desc desc) @trusted @nogc nothrow pure {
60     simgui_setup(&desc);
61 }
62 extern(C) void simgui_new_frame(const FrameDesc* desc) @system @nogc nothrow pure;
63 void newFrame(scope ref FrameDesc desc) @trusted @nogc nothrow pure {
64     simgui_new_frame(&desc);
65 }
66 extern(C) void simgui_flush() @system @nogc nothrow pure;
67 void flush() @trusted @nogc nothrow pure {
68     simgui_flush();
69 }
70 extern(C) void simgui_draw() @system @nogc nothrow pure;
71 void draw() @trusted @nogc nothrow pure {
72     simgui_draw();
73 }
74 extern(C) ulong simgui_imtextureid(sg.View tex_view) @system @nogc nothrow pure;
75 ulong imtextureid(sg.View tex_view) @trusted @nogc nothrow pure {
76     return simgui_imtextureid(tex_view);
77 }
78 extern(C) ulong simgui_imtextureid_with_sampler(sg.View tex_view, sg.Sampler smp) @system @nogc nothrow pure;
79 ulong imtextureidWithSampler(sg.View tex_view, sg.Sampler smp) @trusted @nogc nothrow pure {
80     return simgui_imtextureid_with_sampler(tex_view, smp);
81 }
82 extern(C) sg.View simgui_texture_view_from_imtextureid(ulong imtex_id) @system @nogc nothrow pure;
83 sg.View textureViewFromImtextureid(ulong imtex_id) @trusted @nogc nothrow pure {
84     return simgui_texture_view_from_imtextureid(imtex_id);
85 }
86 extern(C) sg.Sampler simgui_sampler_from_imtextureid(ulong imtex_id) @system @nogc nothrow pure;
87 sg.Sampler samplerFromImtextureid(ulong imtex_id) @trusted @nogc nothrow pure {
88     return simgui_sampler_from_imtextureid(imtex_id);
89 }
90 extern(C) void simgui_add_focus_event(bool focus) @system @nogc nothrow pure;
91 void addFocusEvent(bool focus) @trusted @nogc nothrow pure {
92     simgui_add_focus_event(focus);
93 }
94 extern(C) void simgui_add_mouse_pos_event(float x, float y) @system @nogc nothrow pure;
95 void addMousePosEvent(float x, float y) @trusted @nogc nothrow pure {
96     simgui_add_mouse_pos_event(x, y);
97 }
98 extern(C) void simgui_add_touch_pos_event(float x, float y) @system @nogc nothrow pure;
99 void addTouchPosEvent(float x, float y) @trusted @nogc nothrow pure {
100     simgui_add_touch_pos_event(x, y);
101 }
102 extern(C) void simgui_add_mouse_button_event(int mouse_button, bool down) @system @nogc nothrow pure;
103 void addMouseButtonEvent(int mouse_button, bool down) @trusted @nogc nothrow pure {
104     simgui_add_mouse_button_event(mouse_button, down);
105 }
106 extern(C) void simgui_add_mouse_wheel_event(float wheel_x, float wheel_y) @system @nogc nothrow pure;
107 void addMouseWheelEvent(float wheel_x, float wheel_y) @trusted @nogc nothrow pure {
108     simgui_add_mouse_wheel_event(wheel_x, wheel_y);
109 }
110 extern(C) void simgui_add_key_event(int imgui_key, bool down) @system @nogc nothrow pure;
111 void addKeyEvent(int imgui_key, bool down) @trusted @nogc nothrow pure {
112     simgui_add_key_event(imgui_key, down);
113 }
114 extern(C) void simgui_add_input_character(uint c) @system @nogc nothrow pure;
115 void addInputCharacter(uint c) @trusted @nogc nothrow pure {
116     simgui_add_input_character(c);
117 }
118 extern(C) void simgui_add_input_characters_utf8(const(char)* c) @system @nogc nothrow pure;
119 void addInputCharactersUtf8(const(char)* c) @trusted @nogc nothrow pure {
120     simgui_add_input_characters_utf8(c);
121 }
122 extern(C) void simgui_add_touch_button_event(int mouse_button, bool down) @system @nogc nothrow pure;
123 void addTouchButtonEvent(int mouse_button, bool down) @trusted @nogc nothrow pure {
124     simgui_add_touch_button_event(mouse_button, down);
125 }
126 extern(C) bool simgui_handle_event(const sapp.Event* ev) @system @nogc nothrow pure;
127 bool handleEvent(scope ref sapp.Event ev) @trusted @nogc nothrow pure {
128     return simgui_handle_event(&ev);
129 }
130 extern(C) int simgui_map_keycode(sapp.Keycode keycode) @system @nogc nothrow pure;
131 int mapKeycode(sapp.Keycode keycode) @trusted @nogc nothrow pure {
132     return simgui_map_keycode(keycode);
133 }
134 extern(C) void simgui_shutdown() @system @nogc nothrow pure;
135 void shutdown() @trusted @nogc nothrow pure {
136     simgui_shutdown();
137 }