1 /++
2 + Machine generated D bindings for Sokol library.
3 + 
4 +     Source header: sokol_app.h
5 +     Module: sokol.app
6 + 
7 +     Do not edit manually; regenerate using gen_d.py.
8 +/
9 module sokol.app;
10 
11 /++
12 + misc constants
13 +/
14 enum max_touchpoints = 8;
15 enum max_mousebuttons = 3;
16 enum max_keycodes = 512;
17 enum max_iconimages = 8;
18 /++
19 + sapp_event_type
20 + 
21 +     The type of event that's passed to the event handler callback
22 +     in the sapp_event.type field. These are not just "traditional"
23 +     input events, but also notify the application about state changes
24 +     or other user-invoked actions.
25 +/
26 enum EventType {
27     Invalid,
28     Key_down,
29     Key_up,
30     Char,
31     Mouse_down,
32     Mouse_up,
33     Mouse_scroll,
34     Mouse_move,
35     Mouse_enter,
36     Mouse_leave,
37     Touches_began,
38     Touches_moved,
39     Touches_ended,
40     Touches_cancelled,
41     Resized,
42     Iconified,
43     Restored,
44     Focused,
45     Unfocused,
46     Suspended,
47     Resumed,
48     Quit_requested,
49     Clipboard_pasted,
50     Files_dropped,
51     Num,
52 }
53 /++
54 + sapp_keycode
55 + 
56 +     The 'virtual keycode' of a KEY_DOWN or KEY_UP event in the
57 +     struct field sapp_event.key_code.
58 + 
59 +     Note that the keycode values are identical with GLFW.
60 +/
61 enum Keycode {
62     Invalid = 0,
63     Space = 32,
64     Apostrophe = 39,
65     Comma = 44,
66     Minus = 45,
67     Period = 46,
68     Slash = 47,
69     _0 = 48,
70     _1 = 49,
71     _2 = 50,
72     _3 = 51,
73     _4 = 52,
74     _5 = 53,
75     _6 = 54,
76     _7 = 55,
77     _8 = 56,
78     _9 = 57,
79     Semicolon = 59,
80     Equal = 61,
81     A = 65,
82     B = 66,
83     C = 67,
84     D = 68,
85     E = 69,
86     F = 70,
87     G = 71,
88     H = 72,
89     I = 73,
90     J = 74,
91     K = 75,
92     L = 76,
93     M = 77,
94     N = 78,
95     O = 79,
96     P = 80,
97     Q = 81,
98     R = 82,
99     S = 83,
100     T = 84,
101     U = 85,
102     V = 86,
103     W = 87,
104     X = 88,
105     Y = 89,
106     Z = 90,
107     Left_bracket = 91,
108     Backslash = 92,
109     Right_bracket = 93,
110     Grave_accent = 96,
111     World_1 = 161,
112     World_2 = 162,
113     Escape = 256,
114     Enter = 257,
115     Tab = 258,
116     Backspace = 259,
117     Insert = 260,
118     Delete = 261,
119     Right = 262,
120     Left = 263,
121     Down = 264,
122     Up = 265,
123     Page_up = 266,
124     Page_down = 267,
125     Home = 268,
126     End = 269,
127     Caps_lock = 280,
128     Scroll_lock = 281,
129     Num_lock = 282,
130     Print_screen = 283,
131     Pause = 284,
132     F1 = 290,
133     F2 = 291,
134     F3 = 292,
135     F4 = 293,
136     F5 = 294,
137     F6 = 295,
138     F7 = 296,
139     F8 = 297,
140     F9 = 298,
141     F10 = 299,
142     F11 = 300,
143     F12 = 301,
144     F13 = 302,
145     F14 = 303,
146     F15 = 304,
147     F16 = 305,
148     F17 = 306,
149     F18 = 307,
150     F19 = 308,
151     F20 = 309,
152     F21 = 310,
153     F22 = 311,
154     F23 = 312,
155     F24 = 313,
156     F25 = 314,
157     Kp_0 = 320,
158     Kp_1 = 321,
159     Kp_2 = 322,
160     Kp_3 = 323,
161     Kp_4 = 324,
162     Kp_5 = 325,
163     Kp_6 = 326,
164     Kp_7 = 327,
165     Kp_8 = 328,
166     Kp_9 = 329,
167     Kp_decimal = 330,
168     Kp_divide = 331,
169     Kp_multiply = 332,
170     Kp_subtract = 333,
171     Kp_add = 334,
172     Kp_enter = 335,
173     Kp_equal = 336,
174     Left_shift = 340,
175     Left_control = 341,
176     Left_alt = 342,
177     Left_super = 343,
178     Right_shift = 344,
179     Right_control = 345,
180     Right_alt = 346,
181     Right_super = 347,
182     Menu = 348,
183 }
184 /++
185 + Android specific 'tool type' enum for touch events. This lets the
186 +     application check what type of input device was used for
187 +     touch events.
188 + 
189 +     NOTE: the values must remain in sync with the corresponding
190 +     Android SDK type, so don't change those.
191 + 
192 +     See https://developer.android.com/reference/android/view/MotionEvent#TOOL_TYPE_UNKNOWN
193 +/
194 enum AndroidTooltype {
195     Unknown = 0,
196     Finger = 1,
197     Stylus = 2,
198     Mouse = 3,
199 }
200 /++
201 + sapp_touchpoint
202 + 
203 +     Describes a single touchpoint in a multitouch event (TOUCHES_BEGAN,
204 +     TOUCHES_MOVED, TOUCHES_ENDED).
205 + 
206 +     Touch points are stored in the nested array sapp_event.touches[],
207 +     and the number of touches is stored in sapp_event.num_touches.
208 +/
209 extern(C) struct Touchpoint {
210     ulong identifier = 0;
211     float pos_x = 0.0f;
212     float pos_y = 0.0f;
213     AndroidTooltype android_tooltype = AndroidTooltype.Unknown;
214     bool changed = false;
215 }
216 /++
217 + sapp_mousebutton
218 + 
219 +     The currently pressed mouse button in the events MOUSE_DOWN
220 +     and MOUSE_UP, stored in the struct field sapp_event.mouse_button.
221 +/
222 enum Mousebutton {
223     Left = 0,
224     Right = 1,
225     Middle = 2,
226     Invalid = 256,
227 }
228 /++
229 + These are currently pressed modifier keys (and mouse buttons) which are
230 +     passed in the event struct field sapp_event.modifiers.
231 +/
232 enum modifier_shift = 1;
233 enum modifier_ctrl = 2;
234 enum modifier_alt = 4;
235 enum modifier_super = 8;
236 enum modifier_lmb = 256;
237 enum modifier_rmb = 512;
238 enum modifier_mmb = 1024;
239 /++
240 + sapp_event
241 + 
242 +     This is an all-in-one event struct passed to the event handler
243 +     user callback function. Note that it depends on the event
244 +     type what struct fields actually contain useful values, so you
245 +     should first check the event type before reading other struct
246 +     fields.
247 +/
248 extern(C) struct Event {
249     ulong frame_count = 0;
250     EventType type = EventType.Invalid;
251     Keycode key_code = Keycode.Invalid;
252     uint char_code = 0;
253     bool key_repeat = false;
254     uint modifiers = 0;
255     Mousebutton mouse_button = Mousebutton.Left;
256     float mouse_x = 0.0f;
257     float mouse_y = 0.0f;
258     float mouse_dx = 0.0f;
259     float mouse_dy = 0.0f;
260     float scroll_x = 0.0f;
261     float scroll_y = 0.0f;
262     int num_touches = 0;
263     Touchpoint[8] touches = [];
264     int window_width = 0;
265     int window_height = 0;
266     int framebuffer_width = 0;
267     int framebuffer_height = 0;
268 }
269 /++
270 + sg_range
271 + 
272 +     A general pointer/size-pair struct and constructor macros for passing binary blobs
273 +     into sokol_app.h.
274 +/
275 extern(C) struct Range {
276     const(void)* ptr = null;
277     size_t size = 0;
278 }
279 /++
280 + sapp_image_desc
281 + 
282 +     This is used to describe image data to sokol_app.h (window icons and cursor images).
283 + 
284 +     The pixel format is RGBA8.
285 + 
286 +     cursor_hotspot_x and _y are used only for cursors, to define which pixel
287 +     of the image should be aligned with the mouse position.
288 +/
289 extern(C) struct ImageDesc {
290     int width = 0;
291     int height = 0;
292     int cursor_hotspot_x = 0;
293     int cursor_hotspot_y = 0;
294     Range pixels = {};
295 }
296 /++
297 + sapp_icon_desc
298 + 
299 +     An icon description structure for use in sapp_desc.icon and
300 +     sapp_set_icon().
301 + 
302 +     When setting a custom image, the application can provide a number of
303 +     candidates differing in size, and sokol_app.h will pick the image(s)
304 +     closest to the size expected by the platform's window system.
305 + 
306 +     To set sokol-app's default icon, set .sokol_default to true.
307 + 
308 +     Otherwise provide candidate images of different sizes in the
309 +     images[] array.
310 + 
311 +     If both the sokol_default flag is set to true, any image candidates
312 +     will be ignored and the sokol_app.h default icon will be set.
313 +/
314 extern(C) struct IconDesc {
315     bool sokol_default = false;
316     ImageDesc[8] images = [];
317 }
318 /++
319 + sapp_allocator
320 + 
321 +     Used in sapp_desc to provide custom memory-alloc and -free functions
322 +     to sokol_app.h. If memory management should be overridden, both the
323 +     alloc_fn and free_fn function must be provided (e.g. it's not valid to
324 +     override one function but not the other).
325 +/
326 extern(C) struct Allocator {
327     extern(C) void* function(size_t, void*) alloc_fn = null;
328     extern(C) void function(void*, void*) free_fn = null;
329     void* user_data = null;
330 }
331 enum LogItem {
332     Ok,
333     Malloc_failed,
334     Macos_invalid_nsopengl_profile,
335     Win32_load_opengl32_dll_failed,
336     Win32_create_helper_window_failed,
337     Win32_helper_window_getdc_failed,
338     Win32_dummy_context_set_pixelformat_failed,
339     Win32_create_dummy_context_failed,
340     Win32_dummy_context_make_current_failed,
341     Win32_get_pixelformat_attrib_failed,
342     Win32_wgl_find_pixelformat_failed,
343     Win32_wgl_describe_pixelformat_failed,
344     Win32_wgl_set_pixelformat_failed,
345     Win32_wgl_arb_create_context_required,
346     Win32_wgl_arb_create_context_profile_required,
347     Win32_wgl_opengl_version_not_supported,
348     Win32_wgl_opengl_profile_not_supported,
349     Win32_wgl_incompatible_device_context,
350     Win32_wgl_create_context_attribs_failed_other,
351     Win32_d3d11_create_device_and_swapchain_with_debug_failed,
352     Win32_d3d11_get_idxgifactory_failed,
353     Win32_d3d11_get_idxgiadapter_failed,
354     Win32_d3d11_query_interface_idxgidevice1_failed,
355     Win32_register_raw_input_devices_failed_mouse_lock,
356     Win32_register_raw_input_devices_failed_mouse_unlock,
357     Win32_get_raw_input_data_failed,
358     Win32_destroyicon_for_cursor_failed,
359     Linux_glx_load_libgl_failed,
360     Linux_glx_load_entry_points_failed,
361     Linux_glx_extension_not_found,
362     Linux_glx_query_version_failed,
363     Linux_glx_version_too_low,
364     Linux_glx_no_glxfbconfigs,
365     Linux_glx_no_suitable_glxfbconfig,
366     Linux_glx_get_visual_from_fbconfig_failed,
367     Linux_glx_required_extensions_missing,
368     Linux_glx_create_context_failed,
369     Linux_glx_create_window_failed,
370     Linux_x11_create_window_failed,
371     Linux_egl_bind_opengl_api_failed,
372     Linux_egl_bind_opengl_es_api_failed,
373     Linux_egl_get_display_failed,
374     Linux_egl_initialize_failed,
375     Linux_egl_no_configs,
376     Linux_egl_no_native_visual,
377     Linux_egl_get_visual_info_failed,
378     Linux_egl_create_window_surface_failed,
379     Linux_egl_create_context_failed,
380     Linux_egl_make_current_failed,
381     Linux_x11_open_display_failed,
382     Linux_x11_query_system_dpi_failed,
383     Linux_x11_dropped_file_uri_wrong_scheme,
384     Linux_x11_failed_to_become_owner_of_clipboard,
385     Android_unsupported_input_event_input_cb,
386     Android_unsupported_input_event_main_cb,
387     Android_read_msg_failed,
388     Android_write_msg_failed,
389     Android_msg_create,
390     Android_msg_resume,
391     Android_msg_pause,
392     Android_msg_focus,
393     Android_msg_no_focus,
394     Android_msg_set_native_window,
395     Android_msg_set_input_queue,
396     Android_msg_destroy,
397     Android_unknown_msg,
398     Android_loop_thread_started,
399     Android_loop_thread_done,
400     Android_native_activity_onstart,
401     Android_native_activity_onresume,
402     Android_native_activity_onsaveinstancestate,
403     Android_native_activity_onwindowfocuschanged,
404     Android_native_activity_onpause,
405     Android_native_activity_onstop,
406     Android_native_activity_onnativewindowcreated,
407     Android_native_activity_onnativewindowdestroyed,
408     Android_native_activity_oninputqueuecreated,
409     Android_native_activity_oninputqueuedestroyed,
410     Android_native_activity_onconfigurationchanged,
411     Android_native_activity_onlowmemory,
412     Android_native_activity_ondestroy,
413     Android_native_activity_done,
414     Android_native_activity_oncreate,
415     Android_create_thread_pipe_failed,
416     Android_native_activity_create_success,
417     Wgpu_device_lost,
418     Wgpu_device_log,
419     Wgpu_device_uncaptured_error,
420     Wgpu_swapchain_create_surface_failed,
421     Wgpu_swapchain_surface_get_capabilities_failed,
422     Wgpu_swapchain_create_depth_stencil_texture_failed,
423     Wgpu_swapchain_create_depth_stencil_view_failed,
424     Wgpu_swapchain_create_msaa_texture_failed,
425     Wgpu_swapchain_create_msaa_view_failed,
426     Wgpu_swapchain_getcurrenttexture_failed,
427     Wgpu_request_device_status_error,
428     Wgpu_request_device_status_unknown,
429     Wgpu_request_adapter_status_unavailable,
430     Wgpu_request_adapter_status_error,
431     Wgpu_request_adapter_status_unknown,
432     Wgpu_create_instance_failed,
433     Image_data_size_mismatch,
434     Dropped_file_path_too_long,
435     Clipboard_string_too_big,
436 }
437 /++
438 + sapp_logger
439 + 
440 +     Used in sapp_desc to provide a logging function. Please be aware that
441 +     without logging function, sokol-app will be completely silent, e.g. it will
442 +     not report errors or warnings. For maximum error verbosity, compile in
443 +     debug mode (e.g. NDEBUG *not* defined) and install a logger (for instance
444 +     the standard logging function from sokol_log.h).
445 +/
446 extern(C) struct Logger {
447     extern(C) void function(const(char)*, uint, uint, const(char)*, uint, const(char)*, void*) func = null;
448     void* user_data = null;
449 }
450 /++
451 + sokol-app initialization options, used as return value of sokol_main()
452 +     or sapp_run() argument.
453 +/
454 extern(C) struct Desc {
455     extern(C) void function() init_cb = null;
456     extern(C) void function() frame_cb = null;
457     extern(C) void function() cleanup_cb = null;
458     extern(C) void function(const Event*) event_cb = null;
459     void* user_data = null;
460     extern(C) void function(void*) init_userdata_cb = null;
461     extern(C) void function(void*) frame_userdata_cb = null;
462     extern(C) void function(void*) cleanup_userdata_cb = null;
463     extern(C) void function(const Event*, void*) event_userdata_cb = null;
464     int width = 0;
465     int height = 0;
466     int sample_count = 0;
467     int swap_interval = 0;
468     bool high_dpi = false;
469     bool fullscreen = false;
470     bool alpha = false;
471     const(char)* window_title = null;
472     bool enable_clipboard = false;
473     int clipboard_size = 0;
474     bool enable_dragndrop = false;
475     int max_dropped_files = 0;
476     int max_dropped_file_path_length = 0;
477     IconDesc icon = {};
478     Allocator allocator = {};
479     Logger logger = {};
480     int gl_major_version = 0;
481     int gl_minor_version = 0;
482     bool win32_console_utf8 = false;
483     bool win32_console_create = false;
484     bool win32_console_attach = false;
485     const(char)* html5_canvas_selector = null;
486     bool html5_canvas_resize = false;
487     bool html5_preserve_drawing_buffer = false;
488     bool html5_premultiplied_alpha = false;
489     bool html5_ask_leave_site = false;
490     bool html5_update_document_title = false;
491     bool html5_bubble_mouse_events = false;
492     bool html5_bubble_touch_events = false;
493     bool html5_bubble_wheel_events = false;
494     bool html5_bubble_key_events = false;
495     bool html5_bubble_char_events = false;
496     bool html5_use_emsc_set_main_loop = false;
497     bool html5_emsc_set_main_loop_simulate_infinite_loop = false;
498     bool ios_keyboard_resizes_canvas = false;
499 }
500 /++
501 + HTML5 specific: request and response structs for
502 +    asynchronously loading dropped-file content.
503 +/
504 enum Html5FetchError {
505     Fetch_error_no_error,
506     Fetch_error_buffer_too_small,
507     Fetch_error_other,
508 }
509 extern(C) struct Html5FetchResponse {
510     bool succeeded = false;
511     Html5FetchError error_code = Html5FetchError.Fetch_error_no_error;
512     int file_index = 0;
513     Range data = {};
514     Range buffer = {};
515     void* user_data = null;
516 }
517 extern(C) struct Html5FetchRequest {
518     int dropped_file_index = 0;
519     extern(C) void function(const Html5FetchResponse*) callback = null;
520     Range buffer = {};
521     void* user_data = null;
522 }
523 /++
524 + sapp_mouse_cursor
525 + 
526 +     Predefined cursor image definitions, set with sapp_set_mouse_cursor(sapp_mouse_cursor cursor)
527 +/
528 enum MouseCursor {
529     Default = 0,
530     Arrow,
531     Ibeam,
532     Crosshair,
533     Pointing_hand,
534     Resize_ew,
535     Resize_ns,
536     Resize_nwse,
537     Resize_nesw,
538     Resize_all,
539     Not_allowed,
540     Custom_0,
541     Custom_1,
542     Custom_2,
543     Custom_3,
544     Custom_4,
545     Custom_5,
546     Custom_6,
547     Custom_7,
548     Custom_8,
549     Custom_9,
550     Custom_10,
551     Custom_11,
552     Custom_12,
553     Custom_13,
554     Custom_14,
555     Custom_15,
556     Num,
557 }
558 /++
559 + returns true after sokol-app has been initialized
560 +/
561 extern(C) bool sapp_isvalid() @system @nogc nothrow pure;
562 bool isvalid() @trusted @nogc nothrow pure {
563     return sapp_isvalid();
564 }
565 /++
566 + returns the current framebuffer width in pixels
567 +/
568 extern(C) int sapp_width() @system @nogc nothrow pure;
569 int width() @trusted @nogc nothrow pure {
570     return sapp_width();
571 }
572 /++
573 + same as sapp_width(), but returns float
574 +/
575 extern(C) float sapp_widthf() @system @nogc nothrow pure;
576 float widthf() @trusted @nogc nothrow pure {
577     return sapp_widthf();
578 }
579 /++
580 + returns the current framebuffer height in pixels
581 +/
582 extern(C) int sapp_height() @system @nogc nothrow pure;
583 int height() @trusted @nogc nothrow pure {
584     return sapp_height();
585 }
586 /++
587 + same as sapp_height(), but returns float
588 +/
589 extern(C) float sapp_heightf() @system @nogc nothrow pure;
590 float heightf() @trusted @nogc nothrow pure {
591     return sapp_heightf();
592 }
593 /++
594 + get default framebuffer color pixel format
595 +/
596 extern(C) int sapp_color_format() @system @nogc nothrow pure;
597 int colorFormat() @trusted @nogc nothrow pure {
598     return sapp_color_format();
599 }
600 /++
601 + get default framebuffer depth pixel format
602 +/
603 extern(C) int sapp_depth_format() @system @nogc nothrow pure;
604 int depthFormat() @trusted @nogc nothrow pure {
605     return sapp_depth_format();
606 }
607 /++
608 + get default framebuffer sample count
609 +/
610 extern(C) int sapp_sample_count() @system @nogc nothrow pure;
611 int sampleCount() @trusted @nogc nothrow pure {
612     return sapp_sample_count();
613 }
614 /++
615 + returns true when high_dpi was requested and actually running in a high-dpi scenario
616 +/
617 extern(C) bool sapp_high_dpi() @system @nogc nothrow pure;
618 bool highDpi() @trusted @nogc nothrow pure {
619     return sapp_high_dpi();
620 }
621 /++
622 + returns the dpi scaling factor (window pixels to framebuffer pixels)
623 +/
624 extern(C) float sapp_dpi_scale() @system @nogc nothrow pure;
625 float dpiScale() @trusted @nogc nothrow pure {
626     return sapp_dpi_scale();
627 }
628 /++
629 + show or hide the mobile device onscreen keyboard
630 +/
631 extern(C) void sapp_show_keyboard(bool show) @system @nogc nothrow pure;
632 void showKeyboard(bool show) @trusted @nogc nothrow pure {
633     sapp_show_keyboard(show);
634 }
635 /++
636 + return true if the mobile device onscreen keyboard is currently shown
637 +/
638 extern(C) bool sapp_keyboard_shown() @system @nogc nothrow pure;
639 bool keyboardShown() @trusted @nogc nothrow pure {
640     return sapp_keyboard_shown();
641 }
642 /++
643 + query fullscreen mode
644 +/
645 extern(C) bool sapp_is_fullscreen() @system @nogc nothrow pure;
646 bool isFullscreen() @trusted @nogc nothrow pure {
647     return sapp_is_fullscreen();
648 }
649 /++
650 + toggle fullscreen mode
651 +/
652 extern(C) void sapp_toggle_fullscreen() @system @nogc nothrow pure;
653 void toggleFullscreen() @trusted @nogc nothrow pure {
654     sapp_toggle_fullscreen();
655 }
656 /++
657 + show or hide the mouse cursor
658 +/
659 extern(C) void sapp_show_mouse(bool show) @system @nogc nothrow pure;
660 void showMouse(bool show) @trusted @nogc nothrow pure {
661     sapp_show_mouse(show);
662 }
663 /++
664 + show or hide the mouse cursor
665 +/
666 extern(C) bool sapp_mouse_shown() @system @nogc nothrow pure;
667 bool mouseShown() @trusted @nogc nothrow pure {
668     return sapp_mouse_shown();
669 }
670 /++
671 + enable/disable mouse-pointer-lock mode
672 +/
673 extern(C) void sapp_lock_mouse(bool lock) @system @nogc nothrow pure;
674 void lockMouse(bool lock) @trusted @nogc nothrow pure {
675     sapp_lock_mouse(lock);
676 }
677 /++
678 + return true if in mouse-pointer-lock mode (this may toggle a few frames later)
679 +/
680 extern(C) bool sapp_mouse_locked() @system @nogc nothrow pure;
681 bool mouseLocked() @trusted @nogc nothrow pure {
682     return sapp_mouse_locked();
683 }
684 /++
685 + set mouse cursor type
686 +/
687 extern(C) void sapp_set_mouse_cursor(MouseCursor cursor) @system @nogc nothrow pure;
688 void setMouseCursor(MouseCursor cursor) @trusted @nogc nothrow pure {
689     sapp_set_mouse_cursor(cursor);
690 }
691 /++
692 + get current mouse cursor type
693 +/
694 extern(C) MouseCursor sapp_get_mouse_cursor() @system @nogc nothrow pure;
695 MouseCursor getMouseCursor() @trusted @nogc nothrow pure {
696     return sapp_get_mouse_cursor();
697 }
698 /++
699 + associate a custom mouse cursor image to a sapp_mouse_cursor enum entry
700 +/
701 extern(C) MouseCursor sapp_bind_mouse_cursor_image(MouseCursor cursor, const ImageDesc* desc) @system @nogc nothrow pure;
702 MouseCursor bindMouseCursorImage(MouseCursor cursor, scope ref ImageDesc desc) @trusted @nogc nothrow pure {
703     return sapp_bind_mouse_cursor_image(cursor, &desc);
704 }
705 /++
706 + restore the sapp_mouse_cursor enum entry to it's default system appearance
707 +/
708 extern(C) void sapp_unbind_mouse_cursor_image(MouseCursor cursor) @system @nogc nothrow pure;
709 void unbindMouseCursorImage(MouseCursor cursor) @trusted @nogc nothrow pure {
710     sapp_unbind_mouse_cursor_image(cursor);
711 }
712 /++
713 + return the userdata pointer optionally provided in sapp_desc
714 +/
715 extern(C) void* sapp_userdata() @system @nogc nothrow pure;
716 void* userdata() @trusted @nogc nothrow pure {
717     return sapp_userdata();
718 }
719 /++
720 + return a copy of the sapp_desc structure
721 +/
722 extern(C) Desc sapp_query_desc() @system @nogc nothrow pure;
723 Desc queryDesc() @trusted @nogc nothrow pure {
724     return sapp_query_desc();
725 }
726 /++
727 + initiate a "soft quit" (sends SAPP_EVENTTYPE_QUIT_REQUESTED)
728 +/
729 extern(C) void sapp_request_quit() @system @nogc nothrow pure;
730 void requestQuit() @trusted @nogc nothrow pure {
731     sapp_request_quit();
732 }
733 /++
734 + cancel a pending quit (when SAPP_EVENTTYPE_QUIT_REQUESTED has been received)
735 +/
736 extern(C) void sapp_cancel_quit() @system @nogc nothrow pure;
737 void cancelQuit() @trusted @nogc nothrow pure {
738     sapp_cancel_quit();
739 }
740 /++
741 + initiate a "hard quit" (quit application without sending SAPP_EVENTTYPE_QUIT_REQUESTED)
742 +/
743 extern(C) void sapp_quit() @system @nogc nothrow pure;
744 void quit() @trusted @nogc nothrow pure {
745     sapp_quit();
746 }
747 /++
748 + call from inside event callback to consume the current event (don't forward to platform)
749 +/
750 extern(C) void sapp_consume_event() @system @nogc nothrow pure;
751 void consumeEvent() @trusted @nogc nothrow pure {
752     sapp_consume_event();
753 }
754 /++
755 + get the current frame counter (for comparison with sapp_event.frame_count)
756 +/
757 extern(C) ulong sapp_frame_count() @system @nogc nothrow pure;
758 ulong frameCount() @trusted @nogc nothrow pure {
759     return sapp_frame_count();
760 }
761 /++
762 + get an averaged/smoothed frame duration in seconds
763 +/
764 extern(C) double sapp_frame_duration() @system @nogc nothrow pure;
765 double frameDuration() @trusted @nogc nothrow pure {
766     return sapp_frame_duration();
767 }
768 /++
769 + write string into clipboard
770 +/
771 extern(C) void sapp_set_clipboard_string(const(char)* str) @system @nogc nothrow pure;
772 void setClipboardString(const(char)* str) @trusted @nogc nothrow pure {
773     sapp_set_clipboard_string(str);
774 }
775 /++
776 + read string from clipboard (usually during SAPP_EVENTTYPE_CLIPBOARD_PASTED)
777 +/
778 extern(C) const(char)* sapp_get_clipboard_string() @system @nogc nothrow pure;
779 const(char)* getClipboardString() @trusted @nogc nothrow pure {
780     return sapp_get_clipboard_string();
781 }
782 /++
783 + set the window title (only on desktop platforms)
784 +/
785 extern(C) void sapp_set_window_title(const(char)* str) @system @nogc nothrow pure;
786 void setWindowTitle(const(char)* str) @trusted @nogc nothrow pure {
787     sapp_set_window_title(str);
788 }
789 /++
790 + set the window icon (only on Windows and Linux)
791 +/
792 extern(C) void sapp_set_icon(const IconDesc* icon_desc) @system @nogc nothrow pure;
793 void setIcon(scope ref IconDesc icon_desc) @trusted @nogc nothrow pure {
794     sapp_set_icon(&icon_desc);
795 }
796 /++
797 + gets the total number of dropped files (after an SAPP_EVENTTYPE_FILES_DROPPED event)
798 +/
799 extern(C) int sapp_get_num_dropped_files() @system @nogc nothrow pure;
800 int getNumDroppedFiles() @trusted @nogc nothrow pure {
801     return sapp_get_num_dropped_files();
802 }
803 /++
804 + gets the dropped file paths
805 +/
806 extern(C) const(char)* sapp_get_dropped_file_path(int index) @system @nogc nothrow pure;
807 const(char)* getDroppedFilePath(int index) @trusted @nogc nothrow pure {
808     return sapp_get_dropped_file_path(index);
809 }
810 /++
811 + special run-function for SOKOL_NO_ENTRY (in standard mode this is an empty stub)
812 +/
813 extern(C) void sapp_run(const Desc* desc) @system @nogc nothrow pure;
814 void run(scope ref Desc desc) @trusted @nogc nothrow pure {
815     sapp_run(&desc);
816 }
817 /++
818 + EGL: get EGLDisplay object
819 +/
820 extern(C) const(void)* sapp_egl_get_display() @system @nogc nothrow pure;
821 const(void)* eglGetDisplay() @trusted @nogc nothrow pure {
822     return sapp_egl_get_display();
823 }
824 /++
825 + EGL: get EGLContext object
826 +/
827 extern(C) const(void)* sapp_egl_get_context() @system @nogc nothrow pure;
828 const(void)* eglGetContext() @trusted @nogc nothrow pure {
829     return sapp_egl_get_context();
830 }
831 /++
832 + HTML5: enable or disable the hardwired "Leave Site?" dialog box
833 +/
834 extern(C) void sapp_html5_ask_leave_site(bool ask) @system @nogc nothrow pure;
835 void html5AskLeaveSite(bool ask) @trusted @nogc nothrow pure {
836     sapp_html5_ask_leave_site(ask);
837 }
838 /++
839 + HTML5: get byte size of a dropped file
840 +/
841 extern(C) uint sapp_html5_get_dropped_file_size(int index) @system @nogc nothrow pure;
842 uint html5GetDroppedFileSize(int index) @trusted @nogc nothrow pure {
843     return sapp_html5_get_dropped_file_size(index);
844 }
845 /++
846 + HTML5: asynchronously load the content of a dropped file
847 +/
848 extern(C) void sapp_html5_fetch_dropped_file(const Html5FetchRequest* request) @system @nogc nothrow pure;
849 void html5FetchDroppedFile(scope ref Html5FetchRequest request) @trusted @nogc nothrow pure {
850     sapp_html5_fetch_dropped_file(&request);
851 }
852 /++
853 + Metal: get bridged pointer to Metal device object
854 +/
855 extern(C) const(void)* sapp_metal_get_device() @system @nogc nothrow pure;
856 const(void)* metalGetDevice() @trusted @nogc nothrow pure {
857     return sapp_metal_get_device();
858 }
859 /++
860 + Metal: get bridged pointer to MTKView's current drawable of type CAMetalDrawable
861 +/
862 extern(C) const(void)* sapp_metal_get_current_drawable() @system @nogc nothrow pure;
863 const(void)* metalGetCurrentDrawable() @trusted @nogc nothrow pure {
864     return sapp_metal_get_current_drawable();
865 }
866 /++
867 + Metal: get bridged pointer to MTKView's depth-stencil texture of type MTLTexture
868 +/
869 extern(C) const(void)* sapp_metal_get_depth_stencil_texture() @system @nogc nothrow pure;
870 const(void)* metalGetDepthStencilTexture() @trusted @nogc nothrow pure {
871     return sapp_metal_get_depth_stencil_texture();
872 }
873 /++
874 + Metal: get bridged pointer to MTKView's msaa-color-texture of type MTLTexture (may be null)
875 +/
876 extern(C) const(void)* sapp_metal_get_msaa_color_texture() @system @nogc nothrow pure;
877 const(void)* metalGetMsaaColorTexture() @trusted @nogc nothrow pure {
878     return sapp_metal_get_msaa_color_texture();
879 }
880 /++
881 + macOS: get bridged pointer to macOS NSWindow
882 +/
883 extern(C) const(void)* sapp_macos_get_window() @system @nogc nothrow pure;
884 const(void)* macosGetWindow() @trusted @nogc nothrow pure {
885     return sapp_macos_get_window();
886 }
887 /++
888 + iOS: get bridged pointer to iOS UIWindow
889 +/
890 extern(C) const(void)* sapp_ios_get_window() @system @nogc nothrow pure;
891 const(void)* iosGetWindow() @trusted @nogc nothrow pure {
892     return sapp_ios_get_window();
893 }
894 /++
895 + D3D11: get pointer to ID3D11Device object
896 +/
897 extern(C) const(void)* sapp_d3d11_get_device() @system @nogc nothrow pure;
898 const(void)* d3d11GetDevice() @trusted @nogc nothrow pure {
899     return sapp_d3d11_get_device();
900 }
901 /++
902 + D3D11: get pointer to ID3D11DeviceContext object
903 +/
904 extern(C) const(void)* sapp_d3d11_get_device_context() @system @nogc nothrow pure;
905 const(void)* d3d11GetDeviceContext() @trusted @nogc nothrow pure {
906     return sapp_d3d11_get_device_context();
907 }
908 /++
909 + D3D11: get pointer to IDXGISwapChain object
910 +/
911 extern(C) const(void)* sapp_d3d11_get_swap_chain() @system @nogc nothrow pure;
912 const(void)* d3d11GetSwapChain() @trusted @nogc nothrow pure {
913     return sapp_d3d11_get_swap_chain();
914 }
915 /++
916 + D3D11: get pointer to ID3D11RenderTargetView object for rendering
917 +/
918 extern(C) const(void)* sapp_d3d11_get_render_view() @system @nogc nothrow pure;
919 const(void)* d3d11GetRenderView() @trusted @nogc nothrow pure {
920     return sapp_d3d11_get_render_view();
921 }
922 /++
923 + D3D11: get pointer ID3D11RenderTargetView object for msaa-resolve (may return null)
924 +/
925 extern(C) const(void)* sapp_d3d11_get_resolve_view() @system @nogc nothrow pure;
926 const(void)* d3d11GetResolveView() @trusted @nogc nothrow pure {
927     return sapp_d3d11_get_resolve_view();
928 }
929 /++
930 + D3D11: get pointer ID3D11DepthStencilView
931 +/
932 extern(C) const(void)* sapp_d3d11_get_depth_stencil_view() @system @nogc nothrow pure;
933 const(void)* d3d11GetDepthStencilView() @trusted @nogc nothrow pure {
934     return sapp_d3d11_get_depth_stencil_view();
935 }
936 /++
937 + Win32: get the HWND window handle
938 +/
939 extern(C) const(void)* sapp_win32_get_hwnd() @system @nogc nothrow pure;
940 const(void)* win32GetHwnd() @trusted @nogc nothrow pure {
941     return sapp_win32_get_hwnd();
942 }
943 /++
944 + WebGPU: get WGPUDevice handle
945 +/
946 extern(C) const(void)* sapp_wgpu_get_device() @system @nogc nothrow pure;
947 const(void)* wgpuGetDevice() @trusted @nogc nothrow pure {
948     return sapp_wgpu_get_device();
949 }
950 /++
951 + WebGPU: get swapchain's WGPUTextureView handle for rendering
952 +/
953 extern(C) const(void)* sapp_wgpu_get_render_view() @system @nogc nothrow pure;
954 const(void)* wgpuGetRenderView() @trusted @nogc nothrow pure {
955     return sapp_wgpu_get_render_view();
956 }
957 /++
958 + WebGPU: get swapchain's MSAA-resolve WGPUTextureView (may return null)
959 +/
960 extern(C) const(void)* sapp_wgpu_get_resolve_view() @system @nogc nothrow pure;
961 const(void)* wgpuGetResolveView() @trusted @nogc nothrow pure {
962     return sapp_wgpu_get_resolve_view();
963 }
964 /++
965 + WebGPU: get swapchain's WGPUTextureView for the depth-stencil surface
966 +/
967 extern(C) const(void)* sapp_wgpu_get_depth_stencil_view() @system @nogc nothrow pure;
968 const(void)* wgpuGetDepthStencilView() @trusted @nogc nothrow pure {
969     return sapp_wgpu_get_depth_stencil_view();
970 }
971 /++
972 + GL: get framebuffer object
973 +/
974 extern(C) uint sapp_gl_get_framebuffer() @system @nogc nothrow pure;
975 uint glGetFramebuffer() @trusted @nogc nothrow pure {
976     return sapp_gl_get_framebuffer();
977 }
978 /++
979 + GL: get major version
980 +/
981 extern(C) int sapp_gl_get_major_version() @system @nogc nothrow pure;
982 int glGetMajorVersion() @trusted @nogc nothrow pure {
983     return sapp_gl_get_major_version();
984 }
985 /++
986 + GL: get minor version
987 +/
988 extern(C) int sapp_gl_get_minor_version() @system @nogc nothrow pure;
989 int glGetMinorVersion() @trusted @nogc nothrow pure {
990     return sapp_gl_get_minor_version();
991 }
992 /++
993 + GL: return true if the context is GLES
994 +/
995 extern(C) bool sapp_gl_is_gles() @system @nogc nothrow pure;
996 bool glIsGles() @trusted @nogc nothrow pure {
997     return sapp_gl_is_gles();
998 }
999 /++
1000 + X11: get Window
1001 +/
1002 extern(C) const(void)* sapp_x11_get_window() @system @nogc nothrow pure;
1003 const(void)* x11GetWindow() @trusted @nogc nothrow pure {
1004     return sapp_x11_get_window();
1005 }
1006 /++
1007 + X11: get Display
1008 +/
1009 extern(C) const(void)* sapp_x11_get_display() @system @nogc nothrow pure;
1010 const(void)* x11GetDisplay() @trusted @nogc nothrow pure {
1011     return sapp_x11_get_display();
1012 }
1013 /++
1014 + Android: get native activity handle
1015 +/
1016 extern(C) const(void)* sapp_android_get_native_activity() @system @nogc nothrow pure;
1017 const(void)* androidGetNativeActivity() @trusted @nogc nothrow pure {
1018     return sapp_android_get_native_activity();
1019 }