- Notifications
You must be signed in to change notification settings - Fork14
/
Copy pathvideo.c.v
3503 lines (3137 loc) · 155 KB
/
video.c.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright(C) 2025 Lars Pontoppidan. All rights reserved.
// Use of this source code is governed by an MIT license
// that can be found in the LICENSE file.
modulesdl
//
// SDL_video.h
//
// SDL's video subsystem is largely interested in abstracting window
// management from the underlying operating system. You can create windows,
// manage them in various ways, set them fullscreen, and get events when
// interesting things happen with them, such as the mouse or keyboard
// interacting with a window.
//
// The video subsystem is also interested in abstracting away some
// platform-specific differences in OpenGL: context creation, swapping
// buffers, etc. This may be crucial to your app, but also you are not
// required to use OpenGL at all. In fact, SDL can provide rendering to those
// windows as well, either with an easy-to-use
// [2D API](https://wiki.libsdl.org/SDL3/CategoryRender)
// or with a more-powerful
// [GPU API](https://wiki.libsdl.org/SDL3/CategoryGPU)
// . Of course, it can simply get out of your way and give you the window
// handles you need to use Vulkan, Direct3D, Metal, or whatever else you like
// directly, too.
//
// The video subsystem covers a lot of functionality, out of necessity, so it
// is worth perusing the list of functions just to see what's available, but
// most apps can get by with simply creating a window and listening for
// events, so start with SDL_CreateWindow() and SDL_PollEvent().
// This is a unique ID for a display for the time it is connected to the
// system, and is never reused for the lifetime of the application.
//
// If the display is disconnected and reconnected, it will get a new ID.
//
// The value 0 is an invalid ID.
//
// NOTE: This datatype is available since SDL 3.2.0.
pubtypeDisplayID=u32
// This is a unique ID for a window.
//
// The value 0 is an invalid ID.
//
// NOTE: This datatype is available since SDL 3.2.0.
pubtypeWindowID=u32
// The flags on a window.
//
// These cover a lot of true/false, or on/off, window state. Some of it is
// immutable after being set through SDL_CreateWindow(), some of it can be
// changed on existing windows by the app, and some of it might be altered by
// the user or system outside of the app's control.
//
// NOTE: This datatype is available since SDL 3.2.0.
//
// See also: get_window_flags (SDL_GetWindowFlags)
pubtypeWindowFlags=u64
// Opaque type for an EGL display.
//
// NOTE: This datatype is available since SDL 3.2.0.
pubtypeEGLDisplay=voidptr
// Opaque type for an EGL config.
//
// NOTE: This datatype is available since SDL 3.2.0.
pubtypeEGLConfig=voidptr
// Opaque type for an EGL surface.
//
// NOTE: This datatype is available since SDL 3.2.0.
pubtypeEGLSurface=voidptr
// An EGL attribute, used when creating an EGL context.
//
// NOTE: This datatype is available since SDL 3.2.0.
pubtypeEGLAttrib=voidptr
// An EGL integer attribute, used when creating an EGL surface.
//
// NOTE: This datatype is available since SDL 3.2.0.
pubtypeEgLint=int
// Possible values to be set for the SDL_GL_CONTEXT_PROFILE_MASK attribute.
//
// NOTE: This datatype is available since SDL 3.2.0.
pubtypeGlProfile=u32
// Opaque type for an GL context.
//
// NOTE: This datatype is available since SDL 3.2.0.
pubtypeGLContext=voidptr
// Possible flags to be set for the SDL_GL_CONTEXT_FLAGS attribute.
//
// NOTE: This datatype is available since SDL 3.2.0.
pubtypeGLContextFlag=u32
// Possible values to be set for the SDL_GL_CONTEXT_RELEASE_BEHAVIOR
// attribute.
//
// NOTE: This datatype is available since SDL 3.2.0.
pubtypeGLContextReleaseFlag=u32
// Possible values to be set SDL_GL_CONTEXT_RESET_NOTIFICATION attribute.
//
// NOTE: This datatype is available since SDL 3.2.0.
pubtypeGLContextResetNotification=u32
// The pointer to the global `wl_display` object used by the Wayland video
// backend.
//
// Can be set before the video subsystem is initialized to import an external
// `wl_display` object from an application or toolkit for use in SDL, or read
// after initialization to export the `wl_display` used by the Wayland video
// backend. Setting this property after the video subsystem has been
// initialized has no effect, and reading it when the video subsystem is
// uninitialized will either return the user provided value, if one was set
// prior to initialization, or NULL. See docs/README-wayland.md for more
// information.
pubconstprop_global_video_wayland_wl_display_pointer=&char(C.SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER)// 'SDL.video.wayland.wl_display'
// SystemTheme is C.SDL_SystemTheme
pubenumSystemTheme {
unknown= C.SDL_SYSTEM_THEME_UNKNOWN// `unknown` Unknown system theme
light= C.SDL_SYSTEM_THEME_LIGHT// `light` Light colored system theme
dark= C.SDL_SYSTEM_THEME_DARK// `dark` Dark colored system theme
}
@[noinit; typedef]
pubstructC.SDL_DisplayModeData {
// NOTE: Opaque type
}
pubtypeDisplayModeData= C.SDL_DisplayModeData
@[typedef]
pubstructC.SDL_DisplayMode {
pubmut:
displayID DisplayID// the display this mode is associated with
format PixelFormat// pixel format
wint// width
hint// height
pixel_densityf32// scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels)
refresh_ratef32// refresh rate (or 0.0f for unspecified)
refresh_rate_numeratorint// precise refresh rate numerator (or 0 for unspecified)
refresh_rate_denominatorint// precise refresh rate denominator
internal&DisplayModeData=unsafe { nil }// Private
}
pubtypeDisplayMode= C.SDL_DisplayMode
// DisplayOrientation is C.SDL_DisplayOrientation
pubenumDisplayOrientation {
unknown= C.SDL_ORIENTATION_UNKNOWN// `unknown` The display orientation can't be determined
landscape= C.SDL_ORIENTATION_LANDSCAPE// `landscape` The display is in landscape mode, with the right side up, relative to portrait mode
landscape_flipped= C.SDL_ORIENTATION_LANDSCAPE_FLIPPED// `landscape_flipped` The display is in landscape mode, with the left side up, relative to portrait mode
portrait= C.SDL_ORIENTATION_PORTRAIT// `portrait` The display is in portrait mode
portrait_flipped= C.SDL_ORIENTATION_PORTRAIT_FLIPPED// `portrait_flipped` The display is in portrait mode, upside down
}
@[noinit; typedef]
pubstructC.SDL_Window {
// NOTE: Opaque type
}
pubtypeWindow= C.SDL_Window
// WindowFlags are defined here
pubconstwindow_fullscreen=u64(C.SDL_WINDOW_FULLSCREEN)// SDL_UINT64_C(0x0000000000000001)
pubconstwindow_opengl=u64(C.SDL_WINDOW_OPENGL)// SDL_UINT64_C(0x0000000000000002)
pubconstwindow_occluded=u64(C.SDL_WINDOW_OCCLUDED)// SDL_UINT64_C(0x0000000000000004)
pubconstwindow_hidden=u64(C.SDL_WINDOW_HIDDEN)// SDL_UINT64_C(0x0000000000000008)
pubconstwindow_borderless=u64(C.SDL_WINDOW_BORDERLESS)// SDL_UINT64_C(0x0000000000000010)
pubconstwindow_resizable=u64(C.SDL_WINDOW_RESIZABLE)// SDL_UINT64_C(0x0000000000000020)
pubconstwindow_minimized=u64(C.SDL_WINDOW_MINIMIZED)// SDL_UINT64_C(0x0000000000000040)
pubconstwindow_maximized=u64(C.SDL_WINDOW_MAXIMIZED)// SDL_UINT64_C(0x0000000000000080)
pubconstwindow_mouse_grabbed=u64(C.SDL_WINDOW_MOUSE_GRABBED)// SDL_UINT64_C(0x0000000000000100)
pubconstwindow_input_focus=u64(C.SDL_WINDOW_INPUT_FOCUS)// SDL_UINT64_C(0x0000000000000200)
pubconstwindow_mouse_focus=u64(C.SDL_WINDOW_MOUSE_FOCUS)// SDL_UINT64_C(0x0000000000000400)
pubconstwindow_external=u64(C.SDL_WINDOW_EXTERNAL)// SDL_UINT64_C(0x0000000000000800)
pubconstwindow_modal=u64(C.SDL_WINDOW_MODAL)// SDL_UINT64_C(0x0000000000001000)
pubconstwindow_high_pixel_density=u64(C.SDL_WINDOW_HIGH_PIXEL_DENSITY)// SDL_UINT64_C(0x0000000000002000)
pubconstwindow_mouse_capture=u64(C.SDL_WINDOW_MOUSE_CAPTURE)// SDL_UINT64_C(0x0000000000004000)
pubconstwindow_mouse_relative_mode=u64(C.SDL_WINDOW_MOUSE_RELATIVE_MODE)// SDL_UINT64_C(0x0000000000008000)
pubconstwindow_always_on_top=u64(C.SDL_WINDOW_ALWAYS_ON_TOP)// SDL_UINT64_C(0x0000000000010000)
pubconstwindow_utility=u64(C.SDL_WINDOW_UTILITY)// SDL_UINT64_C(0x0000000000020000)
pubconstwindow_tooltip=u64(C.SDL_WINDOW_TOOLTIP)// SDL_UINT64_C(0x0000000000040000)
pubconstwindow_popup_menu=u64(C.SDL_WINDOW_POPUP_MENU)// SDL_UINT64_C(0x0000000000080000)
pubconstwindow_keyboard_grabbed=u64(C.SDL_WINDOW_KEYBOARD_GRABBED)// SDL_UINT64_C(0x0000000000100000)
pubconstwindow_vulkan=u64(C.SDL_WINDOW_VULKAN)// SDL_UINT64_C(0x0000000010000000)
pubconstwindow_metal=u64(C.SDL_WINDOW_METAL)// SDL_UINT64_C(0x0000000020000000)
pubconstwindow_transparent=u64(C.SDL_WINDOW_TRANSPARENT)// SDL_UINT64_C(0x0000000040000000)
pubconstwindow_not_focusable=u64(C.SDL_WINDOW_NOT_FOCUSABLE)// SDL_UINT64_C(0x0000000080000000)
pubconstwindowpos_undefined_mask= C.SDL_WINDOWPOS_UNDEFINED_MASK// 0x1FFF0000u
// TODO: Function: #define SDL_WINDOWPOS_UNDEFINED_DISPLAY(X) (SDL_WINDOWPOS_UNDEFINED_MASK|(X))
pubconstwindowpos_undefined= C.SDL_WINDOWPOS_UNDEFINED// SDL_WINDOWPOS_UNDEFINED_DISPLAY(0)
// TODO: Function: #define SDL_WINDOWPOS_ISUNDEFINED(X) (((X)&0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK)
pubconstwindowpos_centered_mask= C.SDL_WINDOWPOS_CENTERED_MASK// 0x2FFF0000u
// TODO: Function: #define SDL_WINDOWPOS_CENTERED_DISPLAY(X) (SDL_WINDOWPOS_CENTERED_MASK|(X))
pubconstwindowpos_centered= C.SDL_WINDOWPOS_CENTERED// SDL_WINDOWPOS_CENTERED_DISPLAY(0)
// TODO: Non-numerical: #define SDL_WINDOWPOS_ISCENTERED(X) \
// FlashOperation is C.SDL_FlashOperation
pubenumFlashOperation {
cancel= C.SDL_FLASH_CANCEL// `cancel` Cancel any window flash state
briefly= C.SDL_FLASH_BRIEFLY// `briefly` Flash the window briefly to get attention
until_focused= C.SDL_FLASH_UNTIL_FOCUSED// `until_focused` Flash the window until it gets focus
}
// EGLAttribArrayCallback egls platform attribute initialization callback.
//
// This is called when SDL is attempting to create an EGL context, to let the
// app add extra attributes to its eglGetPlatformDisplay() call.
//
// The callback should return a pointer to an EGL attribute array terminated
// with `EGL_NONE`. If this function returns NULL, the SDL_CreateWindow
// process will fail gracefully.
//
// The returned pointer should be allocated with SDL_malloc() and will be
// passed to SDL_free().
//
// The arrays returned by each callback will be appended to the existing
// attribute arrays defined by SDL.
//
// `userdata` userdata an app-controlled pointer that is passed to the callback.
// returns a newly-allocated array of attributes, terminated with `EGL_NONE`.
//
// NOTE: This datatype is available since SDL 3.2.0.
//
// See also: egl_set_attribute_callbacks (SDL_EGL_SetAttributeCallbacks)
//
// [Official documentation](https://wiki.libsdl.org/SDL3/SDL_EGLAttribArrayCallback)
pubtypeEGLAttribArrayCallback=fn (userdatavoidptr) EGLAttrib
// EGLIntArrayCallback egls surface/context attribute initialization callback types.
//
// This is called when SDL is attempting to create an EGL surface, to let the
// app add extra attributes to its eglCreateWindowSurface() or
// eglCreateContext calls.
//
// For convenience, the EGLDisplay and EGLConfig to use are provided to the
// callback.
//
// The callback should return a pointer to an EGL attribute array terminated
// with `EGL_NONE`. If this function returns NULL, the SDL_CreateWindow
// process will fail gracefully.
//
// The returned pointer should be allocated with SDL_malloc() and will be
// passed to SDL_free().
//
// The arrays returned by each callback will be appended to the existing
// attribute arrays defined by SDL.
//
// `userdata` userdata an app-controlled pointer that is passed to the callback.
// `display` display the EGL display to be used.
// `config` config the EGL config to be used.
// returns a newly-allocated array of attributes, terminated with `EGL_NONE`.
//
// NOTE: This datatype is available since SDL 3.2.0.
//
// See also: egl_set_attribute_callbacks (SDL_EGL_SetAttributeCallbacks)
//
// [Official documentation](https://wiki.libsdl.org/SDL3/SDL_EGLIntArrayCallback)
pubtypeEGLIntArrayCallback=fn (userdatavoidptr, display EGLDisplay, config EGLConfig)&int
// GLAttr is C.SDL_GLAttr
pubenumGLAttr {
red_size= C.SDL_GL_RED_SIZE// `red_size` the minimum number of bits for the red channel of the color buffer; defaults to 3.
green_size= C.SDL_GL_GREEN_SIZE// `green_size` the minimum number of bits for the green channel of the color buffer; defaults to 3.
blue_size= C.SDL_GL_BLUE_SIZE// `blue_size` the minimum number of bits for the blue channel of the color buffer; defaults to 2.
alpha_size= C.SDL_GL_ALPHA_SIZE// `alpha_size` the minimum number of bits for the alpha channel of the color buffer; defaults to 0.
buffer_size= C.SDL_GL_BUFFER_SIZE// `buffer_size` the minimum number of bits for frame buffer size; defaults to 0.
doublebuffer= C.SDL_GL_DOUBLEBUFFER// `doublebuffer` whether the output is single or double buffered; defaults to double buffering on.
depth_size= C.SDL_GL_DEPTH_SIZE// `depth_size` the minimum number of bits in the depth buffer; defaults to 16.
stencil_size= C.SDL_GL_STENCIL_SIZE// `stencil_size` the minimum number of bits in the stencil buffer; defaults to 0.
accum_red_size= C.SDL_GL_ACCUM_RED_SIZE// `accum_red_size` the minimum number of bits for the red channel of the accumulation buffer; defaults to 0.
accum_green_size= C.SDL_GL_ACCUM_GREEN_SIZE// `accum_green_size` the minimum number of bits for the green channel of the accumulation buffer; defaults to 0.
accum_blue_size= C.SDL_GL_ACCUM_BLUE_SIZE// `accum_blue_size` the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0.
accum_alpha_size= C.SDL_GL_ACCUM_ALPHA_SIZE// `accum_alpha_size` the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0.
stereo= C.SDL_GL_STEREO// `stereo` whether the output is stereo 3D; defaults to off.
multisamplebuffers= C.SDL_GL_MULTISAMPLEBUFFERS// `multisamplebuffers` the number of buffers used for multisample anti-aliasing; defaults to 0.
multisamplesamples= C.SDL_GL_MULTISAMPLESAMPLES// `multisamplesamples` the number of samples used around the current pixel used for multisample anti-aliasing.
accelerated_visual= C.SDL_GL_ACCELERATED_VISUAL// `accelerated_visual` set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either.
retained_backing= C.SDL_GL_RETAINED_BACKING// `retained_backing` not used (deprecated).
context_major_version= C.SDL_GL_CONTEXT_MAJOR_VERSION// `context_major_version` OpenGL context major version.
context_minor_version= C.SDL_GL_CONTEXT_MINOR_VERSION// `context_minor_version` OpenGL context minor version.
context_flags= C.SDL_GL_CONTEXT_FLAGS// `context_flags` some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0.
context_profile_mask= C.SDL_GL_CONTEXT_PROFILE_MASK// `context_profile_mask` type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform.
share_with_current_context= C.SDL_GL_SHARE_WITH_CURRENT_CONTEXT// `share_with_current_context` OpenGL context sharing; defaults to 0.
framebuffer_srgb_capable= C.SDL_GL_FRAMEBUFFER_SRGB_CAPABLE// `framebuffer_srgb_capable` requests sRGB capable visual; defaults to 0.
context_release_behavior= C.SDL_GL_CONTEXT_RELEASE_BEHAVIOR// `context_release_behavior` sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH.
context_reset_notification= C.SDL_GL_CONTEXT_RESET_NOTIFICATION// `context_reset_notification` set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION.
context_no_error= C.SDL_GL_CONTEXT_NO_ERROR
floatbuffers= C.SDL_GL_FLOATBUFFERS
egl_platform= C.SDL_GL_EGL_PLATFORM
}
// < OpenGL Core Profile context
pubconstgl_context_profile_core= C.SDL_GL_CONTEXT_PROFILE_CORE// 0x0001
// < OpenGL Compatibility Profile context
pubconstgl_context_profile_compatibility= C.SDL_GL_CONTEXT_PROFILE_COMPATIBILITY// 0x0002
// < GLX_CONTEXT_ES2_PROFILE_BIT_EXT
pubconstgl_context_profile_es= C.SDL_GL_CONTEXT_PROFILE_ES// 0x0004
pubconstgl_context_debug_flag= C.SDL_GL_CONTEXT_DEBUG_FLAG// 0x0001
pubconstgl_context_forward_compatible_flag= C.SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG// 0x0002
pubconstgl_context_robust_access_flag= C.SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG// 0x0004
pubconstgl_context_reset_isolation_flag= C.SDL_GL_CONTEXT_RESET_ISOLATION_FLAG// 0x0008
pubconstgl_context_release_behavior_none= C.SDL_GL_CONTEXT_RELEASE_BEHAVIOR_NONE// 0x0000
pubconstgl_context_release_behavior_flush= C.SDL_GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH// 0x0001
pubconstgl_context_reset_no_notification= C.SDL_GL_CONTEXT_RESET_NO_NOTIFICATION// 0x0000
pubconstgl_context_reset_lose_context= C.SDL_GL_CONTEXT_RESET_LOSE_CONTEXT// 0x0001
// C.SDL_GetNumVideoDrivers [official documentation](https://wiki.libsdl.org/SDL3/SDL_GetNumVideoDrivers)
fn C.SDL_GetNumVideoDrivers()int
// get_num_video_drivers gets the number of video drivers compiled into SDL.
//
// returns the number of built in video drivers.
//
// NOTE: (thread safety) This function should only be called on the main thread.
//
// NOTE: This function is available since SDL 3.2.0.
//
// See also: get_video_driver (SDL_GetVideoDriver)
pubfnget_num_video_drivers()int {
return C.SDL_GetNumVideoDrivers()
}
// C.SDL_GetVideoDriver [official documentation](https://wiki.libsdl.org/SDL3/SDL_GetVideoDriver)
fn C.SDL_GetVideoDriver(indexint)&char
// get_video_driver gets the name of a built in video driver.
//
// The video drivers are presented in the order in which they are normally
// checked during initialization.
//
// The names of drivers are all simple, low-ASCII identifiers, like "cocoa",
// "x11" or "windows". These never have Unicode characters, and are not meant
// to be proper names.
//
// `index` index the index of a video driver.
// returns the name of the video driver with the given **index**.
//
// NOTE: (thread safety) This function should only be called on the main thread.
//
// NOTE: This function is available since SDL 3.2.0.
//
// See also: get_num_video_drivers (SDL_GetNumVideoDrivers)
pubfnget_video_driver(indexint)&char {
return&char(C.SDL_GetVideoDriver(index))
}
// C.SDL_GetCurrentVideoDriver [official documentation](https://wiki.libsdl.org/SDL3/SDL_GetCurrentVideoDriver)
fn C.SDL_GetCurrentVideoDriver()&char
// get_current_video_driver gets the name of the currently initialized video driver.
//
// The names of drivers are all simple, low-ASCII identifiers, like "cocoa",
// "x11" or "windows". These never have Unicode characters, and are not meant
// to be proper names.
//
// returns the name of the current video driver or NULL if no driver has been
// initialized.
//
// NOTE: (thread safety) This function should only be called on the main thread.
//
// NOTE: This function is available since SDL 3.2.0.
//
// See also: get_num_video_drivers (SDL_GetNumVideoDrivers)
// See also: get_video_driver (SDL_GetVideoDriver)
pubfnget_current_video_driver()&char {
return&char(C.SDL_GetCurrentVideoDriver())
}
// C.SDL_GetSystemTheme [official documentation](https://wiki.libsdl.org/SDL3/SDL_GetSystemTheme)
fn C.SDL_GetSystemTheme() SystemTheme
// get_system_theme gets the current system theme.
//
// returns the current system theme, light, dark, or unknown.
//
// NOTE: (thread safety) This function should only be called on the main thread.
//
// NOTE: This function is available since SDL 3.2.0.
pubfnget_system_theme() SystemTheme {
return C.SDL_GetSystemTheme()
}
// C.SDL_GetDisplays [official documentation](https://wiki.libsdl.org/SDL3/SDL_GetDisplays)
fn C.SDL_GetDisplays(count&int)&DisplayID
// get_displays gets a list of currently connected displays.
//
// `count` count a pointer filled in with the number of displays returned, may
// be NULL.
// returns a 0 terminated array of display instance IDs or NULL on failure;
// call SDL_GetError() for more information. This should be freed
// with SDL_free() when it is no longer needed.
//
// NOTE: (thread safety) This function should only be called on the main thread.
//
// NOTE: This function is available since SDL 3.2.0.
pubfnget_displays(count&int)&DisplayID {
return C.SDL_GetDisplays(count)
}
// C.SDL_GetPrimaryDisplay [official documentation](https://wiki.libsdl.org/SDL3/SDL_GetPrimaryDisplay)
fn C.SDL_GetPrimaryDisplay() DisplayID
// get_primary_display returns the primary display.
//
// returns the instance ID of the primary display on success or 0 on failure;
// call SDL_GetError() for more information.
//
// NOTE: (thread safety) This function should only be called on the main thread.
//
// NOTE: This function is available since SDL 3.2.0.
//
// See also: get_displays (SDL_GetDisplays)
pubfnget_primary_display() DisplayID {
return C.SDL_GetPrimaryDisplay()
}
// C.SDL_GetDisplayProperties [official documentation](https://wiki.libsdl.org/SDL3/SDL_GetDisplayProperties)
fn C.SDL_GetDisplayProperties(display_id DisplayID) PropertiesID
// get_display_properties gets the properties associated with a display.
//
// The following read-only properties are provided by SDL:
//
// - `SDL_PROP_DISPLAY_HDR_ENABLED_BOOLEAN`: true if the display has HDR
// headroom above the SDR white point. This is for informational and
// diagnostic purposes only, as not all platforms provide this information
// at the display level.
//
// On KMS/DRM:
//
// - `SDL_PROP_DISPLAY_KMSDRM_PANEL_ORIENTATION_NUMBER`: the "panel
// orientation" property for the display in degrees of clockwise rotation.
// Note that this is provided only as a hint, and the application is
// responsible for any coordinate transformations needed to conform to the
// requested display orientation.
//
// `display_id` displayID the instance ID of the display to query.
// returns a valid property ID on success or 0 on failure; call
// SDL_GetError() for more information.
//
// NOTE: (thread safety) This function should only be called on the main thread.
//
// NOTE: This function is available since SDL 3.2.0.
pubfnget_display_properties(display_id DisplayID) PropertiesID {
return C.SDL_GetDisplayProperties(display_id)
}
pubconstprop_display_hdr_enabled_boolean=&char(C.SDL_PROP_DISPLAY_HDR_ENABLED_BOOLEAN)// 'SDL.display.HDR_enabled'
pubconstprop_display_kmsdrm_panel_orientation_number=&char(C.SDL_PROP_DISPLAY_KMSDRM_PANEL_ORIENTATION_NUMBER)// 'SDL.display.KMSDRM.panel_orientation'
// C.SDL_GetDisplayName [official documentation](https://wiki.libsdl.org/SDL3/SDL_GetDisplayName)
fn C.SDL_GetDisplayName(display_id DisplayID)&char
// get_display_name gets the name of a display in UTF-8 encoding.
//
// `display_id` displayID the instance ID of the display to query.
// returns the name of a display or NULL on failure; call SDL_GetError() for
// more information.
//
// NOTE: (thread safety) This function should only be called on the main thread.
//
// NOTE: This function is available since SDL 3.2.0.
//
// See also: get_displays (SDL_GetDisplays)
pubfnget_display_name(display_id DisplayID)&char {
return&char(C.SDL_GetDisplayName(display_id))
}
// C.SDL_GetDisplayBounds [official documentation](https://wiki.libsdl.org/SDL3/SDL_GetDisplayBounds)
fn C.SDL_GetDisplayBounds(display_id DisplayID, rect&Rect)bool
// get_display_bounds gets the desktop area represented by a display.
//
// The primary display is often located at (0,0), but may be placed at a
// different location depending on monitor layout.
//
// `display_id` displayID the instance ID of the display to query.
// `rect` rect the SDL_Rect structure filled in with the display bounds.
// returns true on success or false on failure; call SDL_GetError() for more
// information.
//
// NOTE: (thread safety) This function should only be called on the main thread.
//
// NOTE: This function is available since SDL 3.2.0.
//
// See also: get_display_usable_bounds (SDL_GetDisplayUsableBounds)
// See also: get_displays (SDL_GetDisplays)
pubfnget_display_bounds(display_id DisplayID, rect&Rect)bool {
return C.SDL_GetDisplayBounds(display_id, rect)
}
// C.SDL_GetDisplayUsableBounds [official documentation](https://wiki.libsdl.org/SDL3/SDL_GetDisplayUsableBounds)
fn C.SDL_GetDisplayUsableBounds(display_id DisplayID, rect&Rect)bool
// get_display_usable_bounds gets the usable desktop area represented by a display, in screen
// coordinates.
//
// This is the same area as SDL_GetDisplayBounds() reports, but with portions
// reserved by the system removed. For example, on Apple's macOS, this
// subtracts the area occupied by the menu bar and dock.
//
// Setting a window to be fullscreen generally bypasses these unusable areas,
// so these are good guidelines for the maximum space available to a
// non-fullscreen window.
//
// `display_id` displayID the instance ID of the display to query.
// `rect` rect the SDL_Rect structure filled in with the display bounds.
// returns true on success or false on failure; call SDL_GetError() for more
// information.
//
// NOTE: (thread safety) This function should only be called on the main thread.
//
// NOTE: This function is available since SDL 3.2.0.
//
// See also: get_display_bounds (SDL_GetDisplayBounds)
// See also: get_displays (SDL_GetDisplays)
pubfnget_display_usable_bounds(display_id DisplayID, rect&Rect)bool {
return C.SDL_GetDisplayUsableBounds(display_id, rect)
}
// C.SDL_GetNaturalDisplayOrientation [official documentation](https://wiki.libsdl.org/SDL3/SDL_GetNaturalDisplayOrientation)
fn C.SDL_GetNaturalDisplayOrientation(display_id DisplayID) DisplayOrientation
// get_natural_display_orientation gets the orientation of a display when it is unrotated.
//
// `display_id` displayID the instance ID of the display to query.
// returns the SDL_DisplayOrientation enum value of the display, or
// `SDL_ORIENTATION_UNKNOWN` if it isn't available.
//
// NOTE: (thread safety) This function should only be called on the main thread.
//
// NOTE: This function is available since SDL 3.2.0.
//
// See also: get_displays (SDL_GetDisplays)
pubfnget_natural_display_orientation(display_id DisplayID) DisplayOrientation {
return C.SDL_GetNaturalDisplayOrientation(display_id)
}
// C.SDL_GetCurrentDisplayOrientation [official documentation](https://wiki.libsdl.org/SDL3/SDL_GetCurrentDisplayOrientation)
fn C.SDL_GetCurrentDisplayOrientation(display_id DisplayID) DisplayOrientation
// get_current_display_orientation gets the orientation of a display.
//
// `display_id` displayID the instance ID of the display to query.
// returns the SDL_DisplayOrientation enum value of the display, or
// `SDL_ORIENTATION_UNKNOWN` if it isn't available.
//
// NOTE: (thread safety) This function should only be called on the main thread.
//
// NOTE: This function is available since SDL 3.2.0.
//
// See also: get_displays (SDL_GetDisplays)
pubfnget_current_display_orientation(display_id DisplayID) DisplayOrientation {
return C.SDL_GetCurrentDisplayOrientation(display_id)
}
// C.SDL_GetDisplayContentScale [official documentation](https://wiki.libsdl.org/SDL3/SDL_GetDisplayContentScale)
fn C.SDL_GetDisplayContentScale(display_id DisplayID)f32
// get_display_content_scale gets the content scale of a display.
//
// The content scale is the expected scale for content based on the DPI
// settings of the display. For example, a 4K display might have a 2.0 (200%)
// display scale, which means that the user expects UI elements to be twice as
// big on this display, to aid in readability.
//
// After window creation, SDL_GetWindowDisplayScale() should be used to query
// the content scale factor for individual windows instead of querying the
// display for a window and calling this function, as the per-window content
// scale factor may differ from the base value of the display it is on,
// particularly on high-DPI and/or multi-monitor desktop configurations.
//
// `display_id` displayID the instance ID of the display to query.
// returns the content scale of the display, or 0.0f on failure; call
// SDL_GetError() for more information.
//
// NOTE: (thread safety) This function should only be called on the main thread.
//
// NOTE: This function is available since SDL 3.2.0.
//
// See also: get_window_display_scale (SDL_GetWindowDisplayScale)
// See also: get_displays (SDL_GetDisplays)
pubfnget_display_content_scale(display_id DisplayID)f32 {
return C.SDL_GetDisplayContentScale(display_id)
}
// C.SDL_GetFullscreenDisplayModes [official documentation](https://wiki.libsdl.org/SDL3/SDL_GetFullscreenDisplayModes)
fn C.SDL_GetFullscreenDisplayModes(display_id DisplayID, count&int)&&C.SDL_DisplayMode
// get_fullscreen_display_modes gets a list of fullscreen display modes available on a display.
//
// The display modes are sorted in this priority:
//
// - w -> largest to smallest
// - h -> largest to smallest
// - bits per pixel -> more colors to fewer colors
// - packed pixel layout -> largest to smallest
// - refresh rate -> highest to lowest
// - pixel density -> lowest to highest
//
// `display_id` displayID the instance ID of the display to query.
// `count` count a pointer filled in with the number of display modes returned,
// may be NULL.
// returns a NULL terminated array of display mode pointers or NULL on
// failure; call SDL_GetError() for more information. This is a
// single allocation that should be freed with SDL_free() when it is
// no longer needed.
//
// NOTE: (thread safety) This function should only be called on the main thread.
//
// NOTE: This function is available since SDL 3.2.0.
//
// See also: get_displays (SDL_GetDisplays)
pubfnget_fullscreen_display_modes(display_id DisplayID, count&int)&&C.SDL_DisplayMode {
return C.SDL_GetFullscreenDisplayModes(display_id, count)
}
// C.SDL_GetClosestFullscreenDisplayMode [official documentation](https://wiki.libsdl.org/SDL3/SDL_GetClosestFullscreenDisplayMode)
fn C.SDL_GetClosestFullscreenDisplayMode(display_id DisplayID, wint, hint, refresh_ratef32, include_high_density_modesbool, closest&DisplayMode)bool
// get_closest_fullscreen_display_mode gets the closest match to the requested display mode.
//
// The available display modes are scanned and `closest` is filled in with the
// closest mode matching the requested mode and returned. The mode format and
// refresh rate default to the desktop mode if they are set to 0. The modes
// are scanned with size being first priority, format being second priority,
// and finally checking the refresh rate. If all the available modes are too
// small, then false is returned.
//
// `display_id` displayID the instance ID of the display to query.
// `w` w the width in pixels of the desired display mode.
// `h` h the height in pixels of the desired display mode.
// `refresh_rate` refresh_rate the refresh rate of the desired display mode, or 0.0f
// for the desktop refresh rate.
// `include_high_density_modes` include_high_density_modes boolean to include high density modes in
// the search.
// `closest` closest a pointer filled in with the closest display mode equal to
// or larger than the desired mode.
// returns true on success or false on failure; call SDL_GetError() for more
// information.
//
// NOTE: (thread safety) This function should only be called on the main thread.
//
// NOTE: This function is available since SDL 3.2.0.
//
// See also: get_displays (SDL_GetDisplays)
// See also: get_fullscreen_display_modes (SDL_GetFullscreenDisplayModes)
pubfnget_closest_fullscreen_display_mode(display_id DisplayID, wint, hint, refresh_ratef32, include_high_density_modesbool, closest&DisplayMode)bool {
return C.SDL_GetClosestFullscreenDisplayMode(display_id, w, h, refresh_rate, include_high_density_modes,
closest)
}
// C.SDL_GetDesktopDisplayMode [official documentation](https://wiki.libsdl.org/SDL3/SDL_GetDesktopDisplayMode)
fn C.SDL_GetDesktopDisplayMode(display_id DisplayID)&DisplayMode
// get_desktop_display_mode gets information about the desktop's display mode.
//
// There's a difference between this function and SDL_GetCurrentDisplayMode()
// when SDL runs fullscreen and has changed the resolution. In that case this
// function will return the previous native display mode, and not the current
// display mode.
//
// `display_id` displayID the instance ID of the display to query.
// returns a pointer to the desktop display mode or NULL on failure; call
// SDL_GetError() for more information.
//
// NOTE: (thread safety) This function should only be called on the main thread.
//
// NOTE: This function is available since SDL 3.2.0.
//
// See also: get_current_display_mode (SDL_GetCurrentDisplayMode)
// See also: get_displays (SDL_GetDisplays)
pubfnget_desktop_display_mode(display_id DisplayID)&DisplayMode {
return C.SDL_GetDesktopDisplayMode(display_id)
}
// C.SDL_GetCurrentDisplayMode [official documentation](https://wiki.libsdl.org/SDL3/SDL_GetCurrentDisplayMode)
fn C.SDL_GetCurrentDisplayMode(display_id DisplayID)&DisplayMode
// get_current_display_mode gets information about the current display mode.
//
// There's a difference between this function and SDL_GetDesktopDisplayMode()
// when SDL runs fullscreen and has changed the resolution. In that case this
// function will return the current display mode, and not the previous native
// display mode.
//
// `display_id` displayID the instance ID of the display to query.
// returns a pointer to the desktop display mode or NULL on failure; call
// SDL_GetError() for more information.
//
// NOTE: (thread safety) This function should only be called on the main thread.
//
// NOTE: This function is available since SDL 3.2.0.
//
// See also: get_desktop_display_mode (SDL_GetDesktopDisplayMode)
// See also: get_displays (SDL_GetDisplays)
pubfnget_current_display_mode(display_id DisplayID)&DisplayMode {
return C.SDL_GetCurrentDisplayMode(display_id)
}
// C.SDL_GetDisplayForPoint [official documentation](https://wiki.libsdl.org/SDL3/SDL_GetDisplayForPoint)
fn C.SDL_GetDisplayForPoint(const_point&Point) DisplayID
// get_display_for_point gets the display containing a point.
//
// `point` point the point to query.
// returns the instance ID of the display containing the point or 0 on
// failure; call SDL_GetError() for more information.
//
// NOTE: (thread safety) This function should only be called on the main thread.
//
// NOTE: This function is available since SDL 3.2.0.
//
// See also: get_display_bounds (SDL_GetDisplayBounds)
// See also: get_displays (SDL_GetDisplays)
pubfnget_display_for_point(const_point&Point) DisplayID {
return C.SDL_GetDisplayForPoint(const_point)
}
// C.SDL_GetDisplayForRect [official documentation](https://wiki.libsdl.org/SDL3/SDL_GetDisplayForRect)
fn C.SDL_GetDisplayForRect(const_rect&Rect) DisplayID
// get_display_for_rect gets the display primarily containing a rect.
//
// `rect` rect the rect to query.
// returns the instance ID of the display entirely containing the rect or
// closest to the center of the rect on success or 0 on failure; call
// SDL_GetError() for more information.
//
// NOTE: (thread safety) This function should only be called on the main thread.
//
// NOTE: This function is available since SDL 3.2.0.
//
// See also: get_display_bounds (SDL_GetDisplayBounds)
// See also: get_displays (SDL_GetDisplays)
pubfnget_display_for_rect(const_rect&Rect) DisplayID {
return C.SDL_GetDisplayForRect(const_rect)
}
// C.SDL_GetDisplayForWindow [official documentation](https://wiki.libsdl.org/SDL3/SDL_GetDisplayForWindow)
fn C.SDL_GetDisplayForWindow(window&Window) DisplayID
// get_display_for_window gets the display associated with a window.
//
// `window` window the window to query.
// returns the instance ID of the display containing the center of the window
// on success or 0 on failure; call SDL_GetError() for more
// information.
//
// NOTE: (thread safety) This function should only be called on the main thread.
//
// NOTE: This function is available since SDL 3.2.0.
//
// See also: get_display_bounds (SDL_GetDisplayBounds)
// See also: get_displays (SDL_GetDisplays)
pubfnget_display_for_window(window&Window) DisplayID {
return C.SDL_GetDisplayForWindow(window)
}
// C.SDL_GetWindowPixelDensity [official documentation](https://wiki.libsdl.org/SDL3/SDL_GetWindowPixelDensity)
fn C.SDL_GetWindowPixelDensity(window&Window)f32
// get_window_pixel_density gets the pixel density of a window.
//
// This is a ratio of pixel size to window size. For example, if the window is
// 1920x1080 and it has a high density back buffer of 3840x2160 pixels, it
// would have a pixel density of 2.0.
//
// `window` window the window to query.
// returns the pixel density or 0.0f on failure; call SDL_GetError() for more
// information.
//
// NOTE: (thread safety) This function should only be called on the main thread.
//
// NOTE: This function is available since SDL 3.2.0.
//
// See also: get_window_display_scale (SDL_GetWindowDisplayScale)
pubfnget_window_pixel_density(window&Window)f32 {
return C.SDL_GetWindowPixelDensity(window)
}
// C.SDL_GetWindowDisplayScale [official documentation](https://wiki.libsdl.org/SDL3/SDL_GetWindowDisplayScale)
fn C.SDL_GetWindowDisplayScale(window&Window)f32
// get_window_display_scale gets the content display scale relative to a window's pixel size.
//
// This is a combination of the window pixel density and the display content
// scale, and is the expected scale for displaying content in this window. For
// example, if a 3840x2160 window had a display scale of 2.0, the user expects
// the content to take twice as many pixels and be the same physical size as
// if it were being displayed in a 1920x1080 window with a display scale of
// 1.0.
//
// Conceptually this value corresponds to the scale display setting, and is
// updated when that setting is changed, or the window moves to a display with
// a different scale setting.
//
// `window` window the window to query.
// returns the display scale, or 0.0f on failure; call SDL_GetError() for
// more information.
//
// NOTE: (thread safety) This function should only be called on the main thread.
//
// NOTE: This function is available since SDL 3.2.0.
pubfnget_window_display_scale(window&Window)f32 {
return C.SDL_GetWindowDisplayScale(window)
}
// C.SDL_SetWindowFullscreenMode [official documentation](https://wiki.libsdl.org/SDL3/SDL_SetWindowFullscreenMode)
fn C.SDL_SetWindowFullscreenMode(window&Window, const_mode&DisplayMode)bool
// set_window_fullscreen_mode sets the display mode to use when a window is visible and fullscreen.
//
// This only affects the display mode used when the window is fullscreen. To
// change the window size when the window is not fullscreen, use
// SDL_SetWindowSize().
//
// If the window is currently in the fullscreen state, this request is
// asynchronous on some windowing systems and the new mode dimensions may not
// be applied immediately upon the return of this function. If an immediate
// change is required, call SDL_SyncWindow() to block until the changes have
// taken effect.
//
// When the new mode takes effect, an SDL_EVENT_WINDOW_RESIZED and/or an
// SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED event will be emitted with the new mode
// dimensions.
//
// `window` window the window to affect.
// `mode` mode a pointer to the display mode to use, which can be NULL for
// borderless fullscreen desktop mode, or one of the fullscreen
// modes returned by SDL_GetFullscreenDisplayModes() to set an
// exclusive fullscreen mode.
// returns true on success or false on failure; call SDL_GetError() for more
// information.
//
// NOTE: (thread safety) This function should only be called on the main thread.
//
// NOTE: This function is available since SDL 3.2.0.
//
// See also: get_window_fullscreen_mode (SDL_GetWindowFullscreenMode)
// See also: set_window_fullscreen (SDL_SetWindowFullscreen)
// See also: sync_window (SDL_SyncWindow)
pubfnset_window_fullscreen_mode(window&Window, const_mode&DisplayMode)bool {
return C.SDL_SetWindowFullscreenMode(window, const_mode)
}
// C.SDL_GetWindowFullscreenMode [official documentation](https://wiki.libsdl.org/SDL3/SDL_GetWindowFullscreenMode)
fn C.SDL_GetWindowFullscreenMode(window&Window)&DisplayMode
// get_window_fullscreen_mode querys the display mode to use when a window is visible at fullscreen.
//
// `window` window the window to query.
// returns a pointer to the exclusive fullscreen mode to use or NULL for
// borderless fullscreen desktop mode.
//
// NOTE: (thread safety) This function should only be called on the main thread.
//
// NOTE: This function is available since SDL 3.2.0.
//
// See also: set_window_fullscreen_mode (SDL_SetWindowFullscreenMode)
// See also: set_window_fullscreen (SDL_SetWindowFullscreen)
pubfnget_window_fullscreen_mode(window&Window)&DisplayMode {
return C.SDL_GetWindowFullscreenMode(window)
}
// C.SDL_GetWindowICCProfile [official documentation](https://wiki.libsdl.org/SDL3/SDL_GetWindowICCProfile)
fn C.SDL_GetWindowICCProfile(window&Window, size&usize)voidptr
// get_window_icc_profile gets the raw ICC profile data for the screen the window is currently on.
//
// `window` window the window to query.
// `size` size the size of the ICC profile.
// returns the raw ICC profile data on success or NULL on failure; call
// SDL_GetError() for more information. This should be freed with
// SDL_free() when it is no longer needed.
//
// NOTE: (thread safety) This function should only be called on the main thread.
//
// NOTE: This function is available since SDL 3.2.0.
pubfnget_window_icc_profile(window&Window, size&usize)voidptr {
return C.SDL_GetWindowICCProfile(window, size)
}
// C.SDL_GetWindowPixelFormat [official documentation](https://wiki.libsdl.org/SDL3/SDL_GetWindowPixelFormat)
fn C.SDL_GetWindowPixelFormat(window&Window) PixelFormat
// get_window_pixel_format gets the pixel format associated with the window.
//
// `window` window the window to query.
// returns the pixel format of the window on success or
// SDL_PIXELFORMAT_UNKNOWN on failure; call SDL_GetError() for more
// information.
//
// NOTE: (thread safety) This function should only be called on the main thread.
//
// NOTE: This function is available since SDL 3.2.0.
pubfnget_window_pixel_format(window&Window) PixelFormat {
return C.SDL_GetWindowPixelFormat(window)
}
// C.SDL_GetWindows [official documentation](https://wiki.libsdl.org/SDL3/SDL_GetWindows)
fn C.SDL_GetWindows(count&int)&&C.SDL_Window
// get_windows gets a list of valid windows.
//
// `count` count a pointer filled in with the number of windows returned, may
// be NULL.
// returns a NULL terminated array of SDL_Window pointers or NULL on failure;
// call SDL_GetError() for more information. This is a single
// allocation that should be freed with SDL_free() when it is no
// longer needed.
//
// NOTE: (thread safety) This function should only be called on the main thread.
//
// NOTE: This function is available since SDL 3.2.0.
pubfnget_windows(count&int)&&C.SDL_Window {
return C.SDL_GetWindows(count)
}
// C.SDL_CreateWindow [official documentation](https://wiki.libsdl.org/SDL3/SDL_CreateWindow)
fn C.SDL_CreateWindow(const_title&char, wint, hint, flags WindowFlags)&Window
// create_window creates a window with the specified dimensions and flags.
//
// `flags` may be any of the following OR'd together:
//
// - `SDL_WINDOW_FULLSCREEN`: fullscreen window at desktop resolution
// - `SDL_WINDOW_OPENGL`: window usable with an OpenGL context
// - `SDL_WINDOW_OCCLUDED`: window partially or completely obscured by another
// window
// - `SDL_WINDOW_HIDDEN`: window is not visible
// - `SDL_WINDOW_BORDERLESS`: no window decoration
// - `SDL_WINDOW_RESIZABLE`: window can be resized
// - `SDL_WINDOW_MINIMIZED`: window is minimized
// - `SDL_WINDOW_MAXIMIZED`: window is maximized
// - `SDL_WINDOW_MOUSE_GRABBED`: window has grabbed mouse focus
// - `SDL_WINDOW_INPUT_FOCUS`: window has input focus
// - `SDL_WINDOW_MOUSE_FOCUS`: window has mouse focus
// - `SDL_WINDOW_EXTERNAL`: window not created by SDL
// - `SDL_WINDOW_MODAL`: window is modal
// - `SDL_WINDOW_HIGH_PIXEL_DENSITY`: window uses high pixel density back
// buffer if possible
// - `SDL_WINDOW_MOUSE_CAPTURE`: window has mouse captured (unrelated to
// MOUSE_GRABBED)
// - `SDL_WINDOW_ALWAYS_ON_TOP`: window should always be above others