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