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