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 Vulkan_alloc_device_memory_no_suitable_memory_type, 434 Vulkan_allocate_memory_failed, 435 Vulkan_create_instance_failed, 436 Vulkan_enumerate_physical_devices_failed, 437 Vulkan_no_physical_devices_found, 438 Vulkan_no_suitable_physical_device_found, 439 Vulkan_create_device_failed_extension_not_present, 440 Vulkan_create_device_failed_feature_not_present, 441 Vulkan_create_device_failed_initialization_failed, 442 Vulkan_create_device_failed_other, 443 Vulkan_create_surface_failed, 444 Vulkan_create_swapchain_failed, 445 Vulkan_swapchain_create_image_view_failed, 446 Vulkan_swapchain_create_image_failed, 447 Vulkan_swapchain_alloc_image_device_memory_failed, 448 Vulkan_swapchain_bind_image_memory_failed, 449 Vulkan_acquire_next_image_failed, 450 Vulkan_queue_present_failed, 451 Image_data_size_mismatch, 452 Dropped_file_path_too_long, 453 Clipboard_string_too_big, 454 } 455 /++ 456 + sapp_pixel_format 457 + 458 + Defines the pixel format for swapchain surfaces. 459 + 460 + NOTE: when using sokol_gfx.h do not assume that the underlying 461 + values are compatible with sg_pixel_format! 462 +/ 463 enum PixelFormat { 464 Default, 465 None, 466 Rgba8, 467 Srgb8a8, 468 Bgra8, 469 Sbgra8, 470 Depth, 471 Depth_stencil, 472 } 473 /++ 474 + sapp_environment 475 + 476 + Used to provide runtime environment information to the 477 + outside world (like default pixel formats and the backend 478 + 3D API device pointer) via a call to sapp_get_environment(). 479 + 480 + NOTE: when using sokol_gfx.h, don't assume that sapp_environment 481 + is binary compatible with sg_environment! Always use a translation 482 + function like sglue_environment() to populate sg_environment 483 + from sapp_environment! 484 +/ 485 extern(C) struct EnvironmentDefaults { 486 PixelFormat color_format = PixelFormat.Default; 487 PixelFormat depth_format = PixelFormat.Default; 488 int sample_count = 0; 489 } 490 extern(C) struct MetalEnvironment { 491 const(void)* device = null; 492 } 493 extern(C) struct D3d11Environment { 494 const(void)* device = null; 495 const(void)* device_context = null; 496 } 497 extern(C) struct WgpuEnvironment { 498 const(void)* device = null; 499 } 500 extern(C) struct VulkanEnvironment { 501 const(void)* physical_device = null; 502 const(void)* device = null; 503 const(void)* queue = null; 504 uint queue_family_index = 0; 505 } 506 extern(C) struct Environment { 507 EnvironmentDefaults defaults = {}; 508 MetalEnvironment metal = {}; 509 D3d11Environment d3d11 = {}; 510 WgpuEnvironment wgpu = {}; 511 VulkanEnvironment vulkan = {}; 512 } 513 /++ 514 + sapp_swapchain 515 + 516 + Provides swapchain information for the current frame to the outside 517 + world via a call to sapp_get_swapchain(). 518 + 519 + NOTE: sapp_get_swapchain() must be called exactly once per frame since 520 + on some backends it will also acquire the next swapchain image. 521 + 522 + NOTE: when using sokol_gfx.h, don't assume that the sapp_swapchain struct 523 + has the same memory layout as sg_swapchain! Use the sokol_log.h helper 524 + function sglue_swapchain() to translate sapp_swapchain into a 525 + sg_swapchain instead. 526 +/ 527 extern(C) struct MetalSwapchain { 528 const(void)* current_drawable = null; 529 const(void)* depth_stencil_texture = null; 530 const(void)* msaa_color_texture = null; 531 } 532 extern(C) struct D3d11Swapchain { 533 const(void)* render_view = null; 534 const(void)* resolve_view = null; 535 const(void)* depth_stencil_view = null; 536 } 537 extern(C) struct WgpuSwapchain { 538 const(void)* render_view = null; 539 const(void)* resolve_view = null; 540 const(void)* depth_stencil_view = null; 541 } 542 extern(C) struct VulkanSwapchain { 543 const(void)* render_image = null; 544 const(void)* render_view = null; 545 const(void)* resolve_image = null; 546 const(void)* resolve_view = null; 547 const(void)* depth_stencil_image = null; 548 const(void)* depth_stencil_view = null; 549 const(void)* render_finished_semaphore = null; 550 const(void)* present_complete_semaphore = null; 551 } 552 extern(C) struct GlSwapchain { 553 uint framebuffer = 0; 554 } 555 extern(C) struct Swapchain { 556 int width = 0; 557 int height = 0; 558 int sample_count = 0; 559 PixelFormat color_format = PixelFormat.Default; 560 PixelFormat depth_format = PixelFormat.Default; 561 MetalSwapchain metal = {}; 562 D3d11Swapchain d3d11 = {}; 563 WgpuSwapchain wgpu = {}; 564 VulkanSwapchain vulkan = {}; 565 GlSwapchain gl = {}; 566 } 567 /++ 568 + sapp_logger 569 + 570 + Used in sapp_desc to provide a logging function. Please be aware that 571 + without logging function, sokol-app will be completely silent, e.g. it will 572 + not report errors or warnings. For maximum error verbosity, compile in 573 + debug mode (e.g. NDEBUG *not* defined) and install a logger (for instance 574 + the standard logging function from sokol_log.h). 575 +/ 576 extern(C) struct Logger { 577 extern(C) void function(const(char)*, uint, uint, const(char)*, uint, const(char)*, void*) func = null; 578 void* user_data = null; 579 } 580 /++ 581 + sokol-app initialization options, used as return value of sokol_main() 582 + or sapp_run() argument. 583 +/ 584 extern(C) struct GlDesc { 585 int major_version = 0; 586 int minor_version = 0; 587 } 588 extern(C) struct Win32Desc { 589 bool console_utf8 = false; 590 bool console_create = false; 591 bool console_attach = false; 592 } 593 extern(C) struct Html5Desc { 594 const(char)* canvas_selector = null; 595 bool canvas_resize = false; 596 bool preserve_drawing_buffer = false; 597 bool premultiplied_alpha = false; 598 bool ask_leave_site = false; 599 bool update_document_title = false; 600 bool bubble_mouse_events = false; 601 bool bubble_touch_events = false; 602 bool bubble_wheel_events = false; 603 bool bubble_key_events = false; 604 bool bubble_char_events = false; 605 bool use_emsc_set_main_loop = false; 606 bool emsc_set_main_loop_simulate_infinite_loop = false; 607 } 608 extern(C) struct IosDesc { 609 bool keyboard_resizes_canvas = false; 610 } 611 extern(C) struct Desc { 612 extern(C) void function() init_cb = null; 613 extern(C) void function() frame_cb = null; 614 extern(C) void function() cleanup_cb = null; 615 extern(C) void function(const Event*) event_cb = null; 616 void* user_data = null; 617 extern(C) void function(void*) init_userdata_cb = null; 618 extern(C) void function(void*) frame_userdata_cb = null; 619 extern(C) void function(void*) cleanup_userdata_cb = null; 620 extern(C) void function(const Event*, void*) event_userdata_cb = null; 621 int width = 0; 622 int height = 0; 623 int sample_count = 0; 624 int swap_interval = 0; 625 bool high_dpi = false; 626 bool fullscreen = false; 627 bool alpha = false; 628 const(char)* window_title = null; 629 bool enable_clipboard = false; 630 int clipboard_size = 0; 631 bool enable_dragndrop = false; 632 int max_dropped_files = 0; 633 int max_dropped_file_path_length = 0; 634 IconDesc icon = {}; 635 Allocator allocator = {}; 636 Logger logger = {}; 637 GlDesc gl = {}; 638 Win32Desc win32 = {}; 639 Html5Desc html5 = {}; 640 IosDesc ios = {}; 641 } 642 /++ 643 + HTML5 specific: request and response structs for 644 + asynchronously loading dropped-file content. 645 +/ 646 enum Html5FetchError { 647 Fetch_error_no_error, 648 Fetch_error_buffer_too_small, 649 Fetch_error_other, 650 } 651 extern(C) struct Html5FetchResponse { 652 bool succeeded = false; 653 Html5FetchError error_code = Html5FetchError.Fetch_error_no_error; 654 int file_index = 0; 655 Range data = {}; 656 Range buffer = {}; 657 void* user_data = null; 658 } 659 extern(C) struct Html5FetchRequest { 660 int dropped_file_index = 0; 661 extern(C) void function(const Html5FetchResponse*) callback = null; 662 Range buffer = {}; 663 void* user_data = null; 664 } 665 /++ 666 + sapp_mouse_cursor 667 + 668 + Predefined cursor image definitions, set with sapp_set_mouse_cursor(sapp_mouse_cursor cursor) 669 +/ 670 enum MouseCursor { 671 Default = 0, 672 Arrow, 673 Ibeam, 674 Crosshair, 675 Pointing_hand, 676 Resize_ew, 677 Resize_ns, 678 Resize_nwse, 679 Resize_nesw, 680 Resize_all, 681 Not_allowed, 682 Custom_0, 683 Custom_1, 684 Custom_2, 685 Custom_3, 686 Custom_4, 687 Custom_5, 688 Custom_6, 689 Custom_7, 690 Custom_8, 691 Custom_9, 692 Custom_10, 693 Custom_11, 694 Custom_12, 695 Custom_13, 696 Custom_14, 697 Custom_15, 698 Num, 699 } 700 /++ 701 + returns true after sokol-app has been initialized 702 +/ 703 extern(C) bool sapp_isvalid() @system @nogc nothrow pure; 704 bool isvalid() @trusted @nogc nothrow pure { 705 return sapp_isvalid(); 706 } 707 /++ 708 + returns the current framebuffer width in pixels 709 +/ 710 extern(C) int sapp_width() @system @nogc nothrow pure; 711 int width() @trusted @nogc nothrow pure { 712 return sapp_width(); 713 } 714 /++ 715 + same as sapp_width(), but returns float 716 +/ 717 extern(C) float sapp_widthf() @system @nogc nothrow pure; 718 float widthf() @trusted @nogc nothrow pure { 719 return sapp_widthf(); 720 } 721 /++ 722 + returns the current framebuffer height in pixels 723 +/ 724 extern(C) int sapp_height() @system @nogc nothrow pure; 725 int height() @trusted @nogc nothrow pure { 726 return sapp_height(); 727 } 728 /++ 729 + same as sapp_height(), but returns float 730 +/ 731 extern(C) float sapp_heightf() @system @nogc nothrow pure; 732 float heightf() @trusted @nogc nothrow pure { 733 return sapp_heightf(); 734 } 735 /++ 736 + get default framebuffer color pixel format 737 +/ 738 extern(C) PixelFormat sapp_color_format() @system @nogc nothrow pure; 739 PixelFormat colorFormat() @trusted @nogc nothrow pure { 740 return sapp_color_format(); 741 } 742 /++ 743 + get default framebuffer depth pixel format 744 +/ 745 extern(C) PixelFormat sapp_depth_format() @system @nogc nothrow pure; 746 PixelFormat depthFormat() @trusted @nogc nothrow pure { 747 return sapp_depth_format(); 748 } 749 /++ 750 + get default framebuffer sample count 751 +/ 752 extern(C) int sapp_sample_count() @system @nogc nothrow pure; 753 int sampleCount() @trusted @nogc nothrow pure { 754 return sapp_sample_count(); 755 } 756 /++ 757 + returns true when high_dpi was requested and actually running in a high-dpi scenario 758 +/ 759 extern(C) bool sapp_high_dpi() @system @nogc nothrow pure; 760 bool highDpi() @trusted @nogc nothrow pure { 761 return sapp_high_dpi(); 762 } 763 /++ 764 + returns the dpi scaling factor (window pixels to framebuffer pixels) 765 +/ 766 extern(C) float sapp_dpi_scale() @system @nogc nothrow pure; 767 float dpiScale() @trusted @nogc nothrow pure { 768 return sapp_dpi_scale(); 769 } 770 /++ 771 + show or hide the mobile device onscreen keyboard 772 +/ 773 extern(C) void sapp_show_keyboard(bool show) @system @nogc nothrow pure; 774 void showKeyboard(bool show) @trusted @nogc nothrow pure { 775 sapp_show_keyboard(show); 776 } 777 /++ 778 + return true if the mobile device onscreen keyboard is currently shown 779 +/ 780 extern(C) bool sapp_keyboard_shown() @system @nogc nothrow pure; 781 bool keyboardShown() @trusted @nogc nothrow pure { 782 return sapp_keyboard_shown(); 783 } 784 /++ 785 + query fullscreen mode 786 +/ 787 extern(C) bool sapp_is_fullscreen() @system @nogc nothrow pure; 788 bool isFullscreen() @trusted @nogc nothrow pure { 789 return sapp_is_fullscreen(); 790 } 791 /++ 792 + toggle fullscreen mode 793 +/ 794 extern(C) void sapp_toggle_fullscreen() @system @nogc nothrow pure; 795 void toggleFullscreen() @trusted @nogc nothrow pure { 796 sapp_toggle_fullscreen(); 797 } 798 /++ 799 + show or hide the mouse cursor 800 +/ 801 extern(C) void sapp_show_mouse(bool show) @system @nogc nothrow pure; 802 void showMouse(bool show) @trusted @nogc nothrow pure { 803 sapp_show_mouse(show); 804 } 805 /++ 806 + show or hide the mouse cursor 807 +/ 808 extern(C) bool sapp_mouse_shown() @system @nogc nothrow pure; 809 bool mouseShown() @trusted @nogc nothrow pure { 810 return sapp_mouse_shown(); 811 } 812 /++ 813 + enable/disable mouse-pointer-lock mode 814 +/ 815 extern(C) void sapp_lock_mouse(bool lock) @system @nogc nothrow pure; 816 void lockMouse(bool lock) @trusted @nogc nothrow pure { 817 sapp_lock_mouse(lock); 818 } 819 /++ 820 + return true if in mouse-pointer-lock mode (this may toggle a few frames later) 821 +/ 822 extern(C) bool sapp_mouse_locked() @system @nogc nothrow pure; 823 bool mouseLocked() @trusted @nogc nothrow pure { 824 return sapp_mouse_locked(); 825 } 826 /++ 827 + set mouse cursor type 828 +/ 829 extern(C) void sapp_set_mouse_cursor(MouseCursor cursor) @system @nogc nothrow pure; 830 void setMouseCursor(MouseCursor cursor) @trusted @nogc nothrow pure { 831 sapp_set_mouse_cursor(cursor); 832 } 833 /++ 834 + get current mouse cursor type 835 +/ 836 extern(C) MouseCursor sapp_get_mouse_cursor() @system @nogc nothrow pure; 837 MouseCursor getMouseCursor() @trusted @nogc nothrow pure { 838 return sapp_get_mouse_cursor(); 839 } 840 /++ 841 + associate a custom mouse cursor image to a sapp_mouse_cursor enum entry 842 +/ 843 extern(C) MouseCursor sapp_bind_mouse_cursor_image(MouseCursor cursor, const ImageDesc* desc) @system @nogc nothrow pure; 844 MouseCursor bindMouseCursorImage(MouseCursor cursor, scope ref ImageDesc desc) @trusted @nogc nothrow pure { 845 return sapp_bind_mouse_cursor_image(cursor, &desc); 846 } 847 /++ 848 + restore the sapp_mouse_cursor enum entry to it's default system appearance 849 +/ 850 extern(C) void sapp_unbind_mouse_cursor_image(MouseCursor cursor) @system @nogc nothrow pure; 851 void unbindMouseCursorImage(MouseCursor cursor) @trusted @nogc nothrow pure { 852 sapp_unbind_mouse_cursor_image(cursor); 853 } 854 /++ 855 + return the userdata pointer optionally provided in sapp_desc 856 +/ 857 extern(C) void* sapp_userdata() @system @nogc nothrow pure; 858 void* userdata() @trusted @nogc nothrow pure { 859 return sapp_userdata(); 860 } 861 /++ 862 + return a copy of the sapp_desc structure 863 +/ 864 extern(C) Desc sapp_query_desc() @system @nogc nothrow pure; 865 Desc queryDesc() @trusted @nogc nothrow pure { 866 return sapp_query_desc(); 867 } 868 /++ 869 + initiate a "soft quit" (sends SAPP_EVENTTYPE_QUIT_REQUESTED) 870 +/ 871 extern(C) void sapp_request_quit() @system @nogc nothrow pure; 872 void requestQuit() @trusted @nogc nothrow pure { 873 sapp_request_quit(); 874 } 875 /++ 876 + cancel a pending quit (when SAPP_EVENTTYPE_QUIT_REQUESTED has been received) 877 +/ 878 extern(C) void sapp_cancel_quit() @system @nogc nothrow pure; 879 void cancelQuit() @trusted @nogc nothrow pure { 880 sapp_cancel_quit(); 881 } 882 /++ 883 + initiate a "hard quit" (quit application without sending SAPP_EVENTTYPE_QUIT_REQUESTED) 884 +/ 885 extern(C) void sapp_quit() @system @nogc nothrow pure; 886 void quit() @trusted @nogc nothrow pure { 887 sapp_quit(); 888 } 889 /++ 890 + call from inside event callback to consume the current event (don't forward to platform) 891 +/ 892 extern(C) void sapp_consume_event() @system @nogc nothrow pure; 893 void consumeEvent() @trusted @nogc nothrow pure { 894 sapp_consume_event(); 895 } 896 /++ 897 + get the current frame counter (for comparison with sapp_event.frame_count) 898 +/ 899 extern(C) ulong sapp_frame_count() @system @nogc nothrow pure; 900 ulong frameCount() @trusted @nogc nothrow pure { 901 return sapp_frame_count(); 902 } 903 /++ 904 + get an averaged/smoothed frame duration in seconds 905 +/ 906 extern(C) double sapp_frame_duration() @system @nogc nothrow pure; 907 double frameDuration() @trusted @nogc nothrow pure { 908 return sapp_frame_duration(); 909 } 910 /++ 911 + write string into clipboard 912 +/ 913 extern(C) void sapp_set_clipboard_string(const(char)* str) @system @nogc nothrow pure; 914 void setClipboardString(const(char)* str) @trusted @nogc nothrow pure { 915 sapp_set_clipboard_string(str); 916 } 917 /++ 918 + read string from clipboard (usually during SAPP_EVENTTYPE_CLIPBOARD_PASTED) 919 +/ 920 extern(C) const(char)* sapp_get_clipboard_string() @system @nogc nothrow pure; 921 const(char)* getClipboardString() @trusted @nogc nothrow pure { 922 return sapp_get_clipboard_string(); 923 } 924 /++ 925 + set the window title (only on desktop platforms) 926 +/ 927 extern(C) void sapp_set_window_title(const(char)* str) @system @nogc nothrow pure; 928 void setWindowTitle(const(char)* str) @trusted @nogc nothrow pure { 929 sapp_set_window_title(str); 930 } 931 /++ 932 + set the window icon (only on Windows and Linux) 933 +/ 934 extern(C) void sapp_set_icon(const IconDesc* icon_desc) @system @nogc nothrow pure; 935 void setIcon(scope ref IconDesc icon_desc) @trusted @nogc nothrow pure { 936 sapp_set_icon(&icon_desc); 937 } 938 /++ 939 + gets the total number of dropped files (after an SAPP_EVENTTYPE_FILES_DROPPED event) 940 +/ 941 extern(C) int sapp_get_num_dropped_files() @system @nogc nothrow pure; 942 int getNumDroppedFiles() @trusted @nogc nothrow pure { 943 return sapp_get_num_dropped_files(); 944 } 945 /++ 946 + gets the dropped file paths 947 +/ 948 extern(C) const(char)* sapp_get_dropped_file_path(int index) @system @nogc nothrow pure; 949 const(char)* getDroppedFilePath(int index) @trusted @nogc nothrow pure { 950 return sapp_get_dropped_file_path(index); 951 } 952 /++ 953 + special run-function for SOKOL_NO_ENTRY (in standard mode this is an empty stub) 954 +/ 955 extern(C) void sapp_run(const Desc* desc) @system @nogc nothrow pure; 956 void run(scope ref Desc desc) @trusted @nogc nothrow pure { 957 sapp_run(&desc); 958 } 959 /++ 960 + get runtime environment information 961 +/ 962 extern(C) Environment sapp_get_environment() @system @nogc nothrow pure; 963 Environment getEnvironment() @trusted @nogc nothrow pure { 964 return sapp_get_environment(); 965 } 966 /++ 967 + get current frame's swapchain information (call once per frame!) 968 +/ 969 extern(C) Swapchain sapp_get_swapchain() @system @nogc nothrow pure; 970 Swapchain getSwapchain() @trusted @nogc nothrow pure { 971 return sapp_get_swapchain(); 972 } 973 /++ 974 + EGL: get EGLDisplay object 975 +/ 976 extern(C) const(void)* sapp_egl_get_display() @system @nogc nothrow pure; 977 const(void)* eglGetDisplay() @trusted @nogc nothrow pure { 978 return sapp_egl_get_display(); 979 } 980 /++ 981 + EGL: get EGLContext object 982 +/ 983 extern(C) const(void)* sapp_egl_get_context() @system @nogc nothrow pure; 984 const(void)* eglGetContext() @trusted @nogc nothrow pure { 985 return sapp_egl_get_context(); 986 } 987 /++ 988 + HTML5: enable or disable the hardwired "Leave Site?" dialog box 989 +/ 990 extern(C) void sapp_html5_ask_leave_site(bool ask) @system @nogc nothrow pure; 991 void html5AskLeaveSite(bool ask) @trusted @nogc nothrow pure { 992 sapp_html5_ask_leave_site(ask); 993 } 994 /++ 995 + HTML5: get byte size of a dropped file 996 +/ 997 extern(C) uint sapp_html5_get_dropped_file_size(int index) @system @nogc nothrow pure; 998 uint html5GetDroppedFileSize(int index) @trusted @nogc nothrow pure { 999 return sapp_html5_get_dropped_file_size(index); 1000 } 1001 /++ 1002 + HTML5: asynchronously load the content of a dropped file 1003 +/ 1004 extern(C) void sapp_html5_fetch_dropped_file(const Html5FetchRequest* request) @system @nogc nothrow pure; 1005 void html5FetchDroppedFile(scope ref Html5FetchRequest request) @trusted @nogc nothrow pure { 1006 sapp_html5_fetch_dropped_file(&request); 1007 } 1008 /++ 1009 + macOS: get bridged pointer to macOS NSWindow 1010 +/ 1011 extern(C) const(void)* sapp_macos_get_window() @system @nogc nothrow pure; 1012 const(void)* macosGetWindow() @trusted @nogc nothrow pure { 1013 return sapp_macos_get_window(); 1014 } 1015 /++ 1016 + iOS: get bridged pointer to iOS UIWindow 1017 +/ 1018 extern(C) const(void)* sapp_ios_get_window() @system @nogc nothrow pure; 1019 const(void)* iosGetWindow() @trusted @nogc nothrow pure { 1020 return sapp_ios_get_window(); 1021 } 1022 /++ 1023 + D3D11: get pointer to IDXGISwapChain object 1024 +/ 1025 extern(C) const(void)* sapp_d3d11_get_swap_chain() @system @nogc nothrow pure; 1026 const(void)* d3d11GetSwapChain() @trusted @nogc nothrow pure { 1027 return sapp_d3d11_get_swap_chain(); 1028 } 1029 /++ 1030 + Win32: get the HWND window handle 1031 +/ 1032 extern(C) const(void)* sapp_win32_get_hwnd() @system @nogc nothrow pure; 1033 const(void)* win32GetHwnd() @trusted @nogc nothrow pure { 1034 return sapp_win32_get_hwnd(); 1035 } 1036 /++ 1037 + GL: get major version 1038 +/ 1039 extern(C) int sapp_gl_get_major_version() @system @nogc nothrow pure; 1040 int glGetMajorVersion() @trusted @nogc nothrow pure { 1041 return sapp_gl_get_major_version(); 1042 } 1043 /++ 1044 + GL: get minor version 1045 +/ 1046 extern(C) int sapp_gl_get_minor_version() @system @nogc nothrow pure; 1047 int glGetMinorVersion() @trusted @nogc nothrow pure { 1048 return sapp_gl_get_minor_version(); 1049 } 1050 /++ 1051 + GL: return true if the context is GLES 1052 +/ 1053 extern(C) bool sapp_gl_is_gles() @system @nogc nothrow pure; 1054 bool glIsGles() @trusted @nogc nothrow pure { 1055 return sapp_gl_is_gles(); 1056 } 1057 /++ 1058 + X11: get Window 1059 +/ 1060 extern(C) const(void)* sapp_x11_get_window() @system @nogc nothrow pure; 1061 const(void)* x11GetWindow() @trusted @nogc nothrow pure { 1062 return sapp_x11_get_window(); 1063 } 1064 /++ 1065 + X11: get Display 1066 +/ 1067 extern(C) const(void)* sapp_x11_get_display() @system @nogc nothrow pure; 1068 const(void)* x11GetDisplay() @trusted @nogc nothrow pure { 1069 return sapp_x11_get_display(); 1070 } 1071 /++ 1072 + Android: get native activity handle 1073 +/ 1074 extern(C) const(void)* sapp_android_get_native_activity() @system @nogc nothrow pure; 1075 const(void)* androidGetNativeActivity() @trusted @nogc nothrow pure { 1076 return sapp_android_get_native_activity(); 1077 }