This repository has been archived by the owner on Mar 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
/
sdl2.vapi
3841 lines (3182 loc) · 126 KB
/
sdl2.vapi
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
/*
The MIT License (MIT)
Copyright (c) 2013-2016
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
//FOR: SDL2.0.3 - This is not official, to be futurely changed for the official binding
//Maintainer: PedroHLC, Txasatonga, Desiderantes
[CCode (cprefix = "SDL_", cheader_filename = "SDL2/SDL.h")]
namespace SDL {
///
/// Initialization
///
/**
* These flags can be OR'd together.
*/
[Flags, CCode (cname = "int", cprefix = "SDL_INIT_")]
public enum InitFlag {
/**
* timer subsystem
*/
TIMER,
/**
* audio subsystem
*/
AUDIO,
/**
* video subsystem
*/
VIDEO,
/**
* joystick subsystem
*/
JOYSTICK,
/**
* haptic (force feedback) subsystem
*/
HAPTIC,
/**
* controller subsystem
*/
GAMECONTROLLER,
/**
* events subsystem
*/
EVENTS,
/**
* All of the above subsystems beside.
*/
EVERYTHING,
/**
* Prevents SDL from catching fatal signals.
*/
NOPARACHUTE
}// InitFlag
/**
* Use this function to initialize the SDL library. This must be called before using any other SDL function.
*
* All subsystems are initialized by default.
*
* If you want to initialize subsystems separately you would call:
*
* {{{
* SDL.init (0);
* }}}
*
* followed by {@link SDL.init_subsystem} with the desired subsystem flag.
*
* @param flags subsystem initialization flags.
*
* @return Returns 0 on success or a negative error code on failure; call {@link SDL.get_error} for more information.
*/
[CCode (cname = "SDL_Init")]
public static int init (uint32 flags = SDL.InitFlag.EVERYTHING);
/**
* Use this function to initialize specific SDL subsystems.
*
* {@link SDL.init} initializes assertions and crash protection and then calls {@link SDL.init_subsystem}.
* If you want to bypass those protections you can call {@link SDL.init_subsystem} directly.
*
* Subsystem initialization is ref-counted, you must call {@link SDL.quit_subsystem} for each {@link SDL.init_subsystem}
* to correctly shutdown a subsystem manually (or call {@link SDL.quit} to force shutdown).
* If a subsystem is already loaded then this call will increase the ref-count and return.
*
* @param flags any of the flags used by {@link SDL.init}.
*
* @return Returns 0 on success or a negative error code on failure; call {@link SDL.get_error} for more information.
*/
[CCode (cname = "SDL_InitSubSystem")]
public static int init_subsystem (uint32 flags);
/**
* Use this function to return a mask of the specified subsystems which have previously been initialized.
*
* Examples:
* {{{
* // Get init data on all the subsystems
* uint32 subsystem_init = SDL.get_initialized (SDL.InitFlag.EVERYTHING);
* if (subsystem_init & SDL.InitFlag.VIDEO)
* //Video is initalized
* }}}
* {{{
* // Just check for one specific subsystem
* if (SDL.get_initialized (SDL.InitFlag.VIDEO) != 0)
* //Video is initialized
* }}}
* {{{
* // Check for two subsystems
* uint32 mask = SDL.InitFlag.VIDEO | SDL.InitFlag.AUDIO;
* if (SDL.get_initialized (mask) == mask)
* //Video and Audio is initialized
* }}}
*
* @param flags any of the flags used by {@link SDL.init}.
*
* @return If flags is 0 it returns a mask of all initialized subsystems, otherwise it returns the initialization status of the specified subsystems.
* The return value does not include {@link SDL.InitFlag.NOPARACHUTE}.
*/
[CCode (cname = "SDL_WasInit")]
public static uint32 get_initialized (uint32 flags);
/**
* Use this function to clean up all initialized subsystems. You should call it upon all exit conditions.
*
* You should call this function even if you have already shutdown each initialized subsystem with {@link SDL.quit_subsystem}.
* It is safe to call this function even in the case of errors in initialization.
*
* If you start a subsystem using a call to that subsystem's init function (for example {@link SDL.Video.init})
* instead of {@link SDL.init} or {@link SDL.init_subsystem}, then you must use that subsystem's quit function ({@link SDL.Video.quit})
* to shut it down before calling {@link SDL.quit}.
*/
[CCode (cname = "SDL_Quit")]
public static void quit ();
/**
* Use this function to shut down specific SDL subsystems.
*
* @param flags any of the flags used by {@link SDL.init}.
*/
[CCode (cname = "SDL_QuitSubSystem")]
public static void quit_subsystem (uint32 flags);
//
// CPU Info
//
[CCode (cheader_filename = "SDL2/SDL_cpuinfo.h")]
[Compact]
public class CPU {
[CCode (cname ="SDL_GetCPUCacheLineSize")]
public static int get_cache_line_size ();
//Actual function name was misleading, you get logical core count, not physical CPU count
[Version (since = "2.0.0")]
[CCode (cname ="SDL_GetCPUCount")]
public static int get_num_cores ();
[Version (since = "2.0.1")]
[CCode (cname ="SDL_GetSystemRAM")]
public static int get_system_ram ();
[CCode (cname ="SDL_Has3DNow")]
public static bool has_3dnow ();
[Version (since = "2.0.2")]
[CCode (cname ="SDL_HasAVX")]
public static bool has_avx ();
[Version (since = "2.0.4")]
[CCode (cname ="SDL_HasAVX2")]
public static bool has_avx2 ();
[CCode (cname ="SDL_HasAltiVec")]
public static bool has_altivec ();
[CCode (cname ="SDL_HasMMX")]
public static bool has_mmx ();
[CCode (cname ="SDL_HasRDTSC")]
public static bool has_rdtsc ();
[CCode (cname ="SDL_HasSSE")]
public static bool has_sse ();
[CCode (cname ="SDL_HasSSE2")]
public static bool has_sse2 ();
[CCode (cname ="SDL_HasSSE3")]
public static bool has_sse3 ();
[CCode (cname ="SDL_HasSSE41")]
public static bool has_sse41 ();
[CCode (cname ="SDL_HasSSE42")]
public static bool has_sse42 ();
}
[CCode (type_id = "SDL_version", cheader_filename = "SDL2/SDL_version.h", cname = "SDL_version")]
public class Version {
public uint8 major;
public uint8 minor;
public uint8 patch;
[CCode (cname = "SDL_GetVersion")]
public static unowned Version get_version ();
[CCode (cname = "SDL_GetRevision")]
public static unowned string get_revision ();
[CCode (cname = "SDL_GetRevisionNumber")]
public static int get_revision_number ();
}// Version
///
/// Hints
///
[CCode (cheader_filename = "SDL2/SDL_hints.h")]
[Compact]
public class Hint {
/**
* A variable controlling how 3D acceleration is used to accelerate the SDL screen surface.
*
* SDL can try to accelerate the SDL screen surface by using streaming
* textures with a 3D rendering engine. This variable controls whether and
* how this is done.
*
* This variable can be set to the following values:
*
* * "0" - Disable 3D acceleration
* * "1" - Enable 3D acceleration, using the default renderer.
* * "X" - Enable 3D acceleration, using X where X is one of the valid rendering drivers. (e.g. "direct3d", "opengl", etc.)
*
* By default SDL tries to make a best guess for each platform whether
* to use acceleration or not.
*/
[CCode (cname = "SDL_HINT_FRAMEBUFFER_ACCELERATION")]
public const string FRAMEBUFFER_ACCELERATION;
/**
* A variable specifying which render driver to use.
*
* If the application doesn't pick a specific renderer to use, this variable
* specifies the name of the preferred renderer. If the preferred renderer
* can't be initialized, the normal default renderer is used.
*
* This variable is case insensitive and can be set to the following values:
*
* * "direct3d"
* * "opengl"
* * "opengles2"
* * "opengles"
* * "software"
*
* The default varies by platform, but it's the first one in the list that
* is available on the current platform.
*/
[CCode (cname = "SDL_HINT_RENDER_DRIVER")]
public const string RENDER_DRIVER;
/**
* A variable controlling whether the OpenGL render driver uses shaders if they are available.
*
* This variable can be set to the following values:
*
* * "0" - Disable shaders
* * "1" - Enable shaders
*
* By default shaders are used if OpenGL supports them.
*/
[CCode (cname = "SDL_HINT_RENDER_OPENGL_SHADERS")]
public const string RENDER_OPENGL_SHADERS;
/**
* A variable controlling whether the Direct3D device is initialized for thread-safe operations.
*
* This variable can be set to the following values:
*
* * "0" - Thread-safety is not enabled (faster)
* * "1" - Thread-safety is enabled
*
* By default the Direct3D device is created with thread-safety disabled.
*/
[Version (since = "2.0.1")]
[CCode (cname = "SDL_HINT_RENDER_DIRECT3D_THREADSAFE")]
public const string RENDER_DIRECT3D_THREADSAFE;
/**
* A variable controlling whether to enable Direct3D 11+'s Debug Layer.
*
* This variable does not have any effect on the Direct3D 9 based renderer.
*
* This variable can be set to the following values:
*
* * "0" - Disable Debug Layer use
* * "1" - Enable Debug Layer use
*
* By default, SDL does not use Direct3D Debug Layer.
*/
[Version (since = "2.0.3")]
[CCode (cname = "SDL_HINT_RENDER_DIRECT3D11_DEBUG")]
public const string RENDER_DIRECT3D11_DEBUG;
/**
* A variable controlling the scaling quality
*
* This variable can be set to the following values:
*
* * "0" or "nearest" - Nearest pixel sampling
* * "1" or "linear" - Linear filtering (supported by OpenGL and Direct3D)
* * "2" or "best" - Currently this is the same as "linear"
*
* By default nearest pixel sampling is used
*/
[CCode (cname = "SDL_HINT_RENDER_SCALE_QUALITY")]
public const string RENDER_SCALE_QUALITY;
/**
* A variable controlling whether updates to the SDL screen surface should be synchronized with the vertical refresh, to avoid tearing.
*
* This variable can be set to the following values:
*
* * "0" - Disable vsync
* * "1" - Enable vsync
*
* By default SDL does not sync screen surface updates with vertical refresh.
*/
[CCode (cname = "SDL_HINT_RENDER_VSYNC")]
public const string RENDER_VSYNC;
/**
* A variable controlling whether the screensaver is enabled.
*
* This variable can be set to the following values:
*
* * "0" - Disable screensaver
* * "1" - Enable screensaver
*
* By default SDL will disable the screensaver.
*/
[Version (since = "2.0.2")]
[CCode (cname = "SDL_HINT_VIDEO_ALLOW_SCREENSAVER")]
public const string VIDEO_ALLOW_SCREENSAVER;
/**
* A variable controlling whether the X11 VidMode extension should be used.
*
* This variable can be set to the following values:
*
* * "0" - Disable XVidMode
* * "1" - Enable XVidMode
*
* By default SDL will use XVidMode if it is available.
*/
[CCode (cname = "SDL_HINT_VIDEO_X11_XVIDMODE")]
public const string VIDEO_X11_XVIDMODE;
/**
* A variable controlling whether the X11 Xinerama extension should be used.
*
* This variable can be set to the following values:
*
* * "0" - Disable Xinerama
* * "1" - Enable Xinerama
*
* By default SDL will use Xinerama if it is available.
*/
[CCode (cname = "SDL_HINT_VIDEO_X11_XINERAMA")]
public const string VIDEO_X11_XINERAMA;
/**
* A variable controlling whether the X11 XRandR extension should be used.
*
* This variable can be set to the following values:
*
* * "0" - Disable XRandR
* * "1" - Enable XRandR
*
* By default SDL will not use XRandR because of window manager issues.
*/
[CCode (cname = "SDL_HINT_VIDEO_X11_XRANDR")]
public const string VIDEO_X11_XRANDR;
/**
* A variable controlling whether grabbing input grabs the keyboard
*
* This variable can be set to the following values:
*
* * "0" - Grab will affect only the mouse
* * "1" - Grab will affect mouse and keyboard
*
* By default SDL will not grab the keyboard so system shortcuts still work.
*/
[CCode (cname = "SDL_HINT_GRAB_KEYBOARD")]
public const string GRAB_KEYBOARD;
/**
* A variable controlling whether relative mouse mode is implemented using mouse warping
*
* This variable can be set to the following values:
*
* * "0" - Relative mouse mode uses raw input
* * "1" - Relative mouse mode uses mouse warping
*
* By default SDL will use raw input for relative mouse mode
*/
[Version (since = "2.0.2")]
[CCode (cname = "SDL_HINT_MOUSE_RELATIVE_MODE_WARP")]
public const string MOUSE_RELATIVE_MODE_WARP;
/**
* Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to true.
*/
[CCode (cname = "SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS")]
public const string VIDEO_MINIMIZE_ON_FOCUS_LOSS;
/**
* A variable controlling whether the idle timer is disabled on iOS.
*
* When an iOS app does not receive touches for some time, the screen is
* dimmed automatically. For games where the accelerometer is the only input
* this is problematic. This functionality can be disabled by setting this
* hint.
*
* This variable can be set to the following values:
*
* * "0" - Enable idle timer
* * "1" - Disable idle timer
*/
[CCode (cname = "SDL_HINT_IOS_IDLE_TIMER_DISABLED")]
public const string IOS_IDLE_TIMER_DISABLED;
/**
* A variable controlling which orientations are allowed on iOS.
*
* In some circumstances it is necessary to be able to explicitly control
* which UI orientations are allowed.
*
* This variable is a space delimited list of the following values:
*
* "LandscapeLeft", "LandscapeRight", "Portrait" "PortraitUpsideDown"
*/
[CCode (cname = "SDL_HINT_IOS_ORIENTATIONS")]
public const string IOS_ORIENTATIONS;
/**
* A variable controlling whether an Android built-in accelerometer should be
* listed as a joystick device, rather than listing actual joysticks only.
*
* This variable can be set to the following values:
*
* * "0" - List only real joysticks and accept input from them
* * "1" - List real joysticks along with the accelerometer as if it were a 3 axis joystick (the default).
*/
[Version (since = "2.0.2")]
[CCode (cname = "SDL_HINT_ACCELEROMETER_AS_JOYSTICK")]
public const string ACCELEROMETER_AS_JOYSTICK;
/**
* A variable that lets you disable the detection and use of Xinput gamepad devices
*
* The variable can be set to the following values:
*
* * "0" - Disable XInput detection (only uses direct input)
* * "1" - Enable XInput detection (the default)
*/
[CCode (cname = "SDL_HINT_XINPUT_ENABLED")]
public const string XINPUT_ENABLED;
/**
* A variable that lets you manually hint extra gamecontroller db entries
*
* The variable should be newline delimited rows of gamecontroller config data, see SDL_gamecontroller.h
*
* This hint must be set before calling SDL_Init (SDL_INIT_GAMECONTROLLER)
* You can update mappings after the system is initialized with SDL_GameControllerMappingForGUID () and SDL_GameControllerAddMapping ()
*/
[CCode (cname = "SDL_HINT_GAMECONTROLLERCONFIG")]
public const string GAMECONTROLLERCONFIG;
/**
* A variable that lets you enable joystick (and gamecontroller) events even when your app is in the background.
*
* The variable can be set to the following values:
*
* * "0" - Disable joystick & gamecontroller input events when the
* application is in the background.
* * "1" - Enable joystick & gamecontroller input events when the
* application is in the background.
*
* The default value is "0". This hint may be set at any time.
*/
[CCode (cname = "SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS")]
public const string JOYSTICK_ALLOW_BACKGROUND_EVENTS;
/**
* If set to 0 then never set the top most bit on a SDL Window, even if the video mode expects it.
* This is a debugging aid for developers and not expected to be used by end users. The default is "1"
*
* This variable can be set to the following values:
*
* * "0" - don't allow topmost
* * "1" - allow topmost
*/
[CCode (cname = "SDL_HINT_ALLOW_TOPMOST")]
public const string ALLOW_TOPMOST;
/**
* A variable that controls the timer resolution, in milliseconds.
*
* The higher resolution the timer, the more frequently the CPU services
* timer interrupts, and the more precise delays are, but this takes up
* power and CPU time. This hint is only used on Windows 7 and earlier.
*
* See this blog post for more information:
* [[http://randomascii.wordpress.com/2013/07/08/windows-timer-resolution-megawatts-wasted/]]
*
* If this variable is set to "0", the system timer resolution is not set.
*
* The default value is "1". This hint may be set at any time.
*/
[CCode (cname = "SDL_HINT_TIMER_RESOLUTION")]
public const string TIMER_RESOLUTION;
/**
* If set to 1, then do not allow high-DPI windows. ("Retina" on Mac).
*
* Supported for iOS since SDL 2.0.4.
*/
[Version (since = "2.0.1")]
[CCode (cname = "SDL_HINT_VIDEO_HIGHDPI_DISABLED")]
public const string VIDEO_HIGHDPI_DISABLED;
/**
* A variable that determines whether ctrl+click should generate a right-click event on Mac
*
* If present, holding ctrl while left clicking will generate a right click
* event when on Mac.
*/
[Version (since = "2.0.2")]
[CCode (cname = "SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK")]
public const string MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK;
/**
* A variable specifying if mouse click events are sent when clicking to focus an SDL window on Apple Mac OS X.
*
* By default no mouse click events are sent when clicking to focus. Only on Mac OS X.
*
* The variable can be set to the following values:
*
* * "0" - No mouse click events are sent when clicking to focus
* * "1" - Mouse click events are sent when clicking to focus
*/
[Version (experimental = true)]
[CCode (cname = "SDL_HINT_MAC_MOUSE_FOCUS_CLICKTHROUGH")]
public const string MAC_MOUSE_FOCUS_CLICKTHROUGH;
/**
* A variable specifying which shader compiler to preload when using the Chrome ANGLE binaries
*
* SDL has EGL and OpenGL ES2 support on Windows via the ANGLE project. It
* can use two different sets of binaries, those compiled by the user from source
* or those provided by the Chrome browser. In the later case, these binaries require
* that SDL loads a DLL providing the shader compiler.
*
* This variable can be set to the following values:
*
* * "d3dcompiler_46.dll" - default, best for Vista or later.
* * "d3dcompiler_43.dll" - for XP support.
* * "none" - do not load any library, useful if you compiled ANGLE from source and included the compiler in your binaries.
*/
[Version (since = "2.0.2")]
[CCode (cname = "SDL_HINT_VIDEO_WIN_D3DCOMPILER")]
public const string VIDEO_WIN_D3DCOMPILER;
/**
* A variable that is the address of another {@link SDL.Video.Window} (as a hex string formatted with "%p"
*
* If this hint is set before SDL_CreateWindowFrom () and the SDL_Window* it is set to has
* WINDOW_OPENGL set (and running on WGL only, currently), then two things will occur on the newly
* created SDL_Window:
*
* 1. Its pixel format will be set to the same pixel format as this SDL_Window. This is
* needed for example when sharing an OpenGL context across multiple windows.
*
* 2. The flag WINDOW_OPENGL will be set on the new window so it can be used for
* OpenGL rendering.
*
* This variable can be set to the following values:
*
* The address (as a string "%p") of the SDL_Window that new windows created with SDL_CreateWindowFrom () should
* share a pixel format with.
*/
[Version (since = "2.0.2")]
[CCode (cname = "SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT")]
public const string VIDEO_WINDOW_SHARE_PIXEL_FORMAT;
/**
* A URL to a WinRT app's privacy policy
*
* All network-enabled WinRT apps must make a privacy policy available to its
* users. On Windows 8, 8.1, and RT, Microsoft mandates that this policy be
* be available in the Windows Settings charm, as accessed from within the app.
* SDL provides code to add a URL-based link there, which can point to the app's
* privacy policy.
*
* To setup a URL to an app's privacy policy, set SDL_HINT_WINRT_PRIVACY_POLICY_URL
* before calling any SDL_Init functions. The contents of the hint should
* be a valid URL. For example, [["http://www.example.com"]].
*
* The default value is "", which will prevent SDL from adding a privacy policy
* link to the Settings charm. This hint should only be set during app init.
*
* The label text of an app's "Privacy Policy" link may be customized via another
* hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL.
*
* Please note that on Windows Phone, Microsoft does not provide standard UI
* for displaying a privacy policy link, and as such, SDL_HINT_WINRT_PRIVACY_POLICY_URL
* will not get used on that platform. Network-enabled phone apps should display
* their privacy policy through some other, in-app means.
*/
[Version (since = "2.0.3")]
[CCode (cname = "SDL_HINT_WINRT_PRIVACY_POLICY_URL")]
public const string WINRT_PRIVACY_POLICY_URL;
/**
* Label text for a WinRT app's privacy policy link
*
* Network-enabled WinRT apps must include a privacy policy. On Windows 8, 8.1, and RT,
* Microsoft mandates that this policy be available via the Windows Settings charm.
* SDL provides code to add a link there, with it's label text being set via the
* optional hint, WINRT_PRIVACY_POLICY_LABEL.
*
* Please note that a privacy policy's contents are not set via this hint. A separate
* hint, WINRT_PRIVACY_POLICY_URL, is used to link to the actual text of the
* policy.
*
* The contents of this hint should be encoded as a UTF8 string.
*
* The default value is "Privacy Policy". This hint should only be set during app
* initialization, preferably before any calls to SDL_Init.
*
* For additional information on linking to a privacy policy, see the documentation for
* {@link SDL.Hint.WINRT_PRIVACY_POLICY_URL}.
*/
[Version (since = "2.0.3")]
[CCode (cname = "SDL_HINT_WINRT_PRIVACY_POLICY_LABEL")]
public const string WINRT_PRIVACY_POLICY_LABEL;
/**
* If set to 1, back button press events on Windows Phone 8+ will be marked as handled.
*
* TODO, WinRT: document SDL_HINT_WINRT_HANDLE_BACK_BUTTON need and use
* For now, more details on why this is needed can be found at the
* beginning of the following web page:
* [[http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj247550%20(v%20=%20vs.105).aspx]]
*/
[Version (since = "2.0.3")]
[CCode (cname = "SDL_HINT_WINRT_HANDLE_BACK_BUTTON")]
public const string WINRT_HANDLE_BACK_BUTTON;
/**
* A variable that dictates policy for fullscreen Spaces on Mac OS X.
*
* This hint only applies to Mac OS X.
*
* The variable can be set to the following values:
*
* * "0" - Disable Spaces support (FULLSCREEN_DESKTOP won't use them and
* SDL_WINDOW_RESIZABLE windows won't offer the "fullscreen"
* button on their titlebars).
* * "1" - Enable Spaces support (FULLSCREEN_DESKTOP will use them and
* SDL_WINDOW_RESIZABLE windows will offer the "fullscreen"
* button on their titlebars.
*
* The default value is "1". Spaces are disabled regardless of this hint if
* the OS isn't at least Mac OS X Lion (10.7). This hint must be set before
* any windows are created.
*/
[Version (since = "2.0.2")]
[CCode (cname = "SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES")]
public const string VIDEO_MAC_FULLSCREEN_SPACES;
//SDL 2.0.4 Hints
/**
* A hint that specifies a variable to control whether mouse and touch events are to be treated together or separately.
*
* The value of this hint is used at runtime, so it can be changed at any time.
*
* The variable can be set to the following values:
*
* * "0" - mouse events will be handled as touch events and touch will
* raise fake mouse events
* * "1" - mouse events will be handled separately from pure touch events
*
* By default mouse events will be handled as touch events and touch will raise fake mouse events.
*/
[Version (since = "2.0.4")]
[CCode (cname = "SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH")]
public const string ANDROID_SEPARATE_MOUSE_AND_TOUCH;
/**
* A hint that specifies the Android APK expansion patch file version.
*
* This hint must be set together with the hint {@link Hint.ANDROID_APK_EXPANSION_MAIN_FILE_VERSION}.
*
* If both hints were set then {@link RWops.from_file} will look into expansion files after a given relative path was not found in the internal storage and assets.
*
* This hint should be set with the Android APK expansion patch file version (should be a string number like "1", "2" etc.)
*
* By default this hint is not set and the APK expansion files are not searched.
*/
[Version (since = "2.0.4")]
[CCode (cname = "SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION")]
public const string ANDROID_APK_EXPANSION_PATCH_FILE_VERSION;
/**
* A hint that specifies the Android APK expansion main file version.
*
* This hint must be set together with the hint {@link Hint.ANDROID_APK_EXPANSION_PATCH_FILE_VERSION}.
*
* If both hints were set then {@link RWops.from_file} will look into expansion files after a given relative path was not found in the internal storage and assets.
*
* This hint should be set with the Android APK expansion patch file version (should be a string number like "1", "2" etc.)
*
* By default this hint is not set and the APK expansion files are not searched.
*/
[Version (since = "2.0.4")]
[CCode (cname = "SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION")]
public const string ANDROID_APK_EXPANSION_MAIN_FILE_VERSION;
/**
* A hint that specifies not to catch the SIGINT or SIGTERM signals.
*
* The variable can be set to the following values:
*
* * "0" - SDL will install a SIGINT and SIGTERM handler, and when it
* catches a signal, convert it into an SDL_QUIT event
* * "1" - SDL will not install a signal handler at all
*
* By default SDL installs a SIGINT and SIGTERM handler, and when it catches a signal, converts it into an SDL_QUIT event.
*/
[Version (since = "2.0.4")]
[CCode (cname = "SDL_HINT_NO_SIGNAL_HANDLERS")]
public const string NO_SIGNAL_HANDLERS;
/**
* A hint that specifies whether certain IMEs should handle text editing internally instead of sending SDL_TEXTEDITING events.
*
* The variable can be set to the following values:
*
* * "0" - SDL_TEXTEDITING events are sent, and it is the application's
* responsibility to render the text from these events and
* differentiate it somehow from committed text. (default)
* * "1" - If supported by the IME then SDL_TEXTEDITING events are
* not sent, and text that is being composed will be rendered
* in its own UI.
*
* By default SDL_TEXTEDITING events are sent, and it is the application's responsibility to render the text from these events and differentiate it somehow from committed text.
*/
[Version (since = "2.0.4")]
[CCode (cname = "SDL_HINT_IME_INTERNAL_EDITING")]
public const string IME_INTERNAL_EDITING;
/**
* A hint that specifies a value to override the binding element for keyboard inputs for Emscripten builds.
*
* The variable can be set to the following values:
*
* * "#window" - the JavaScript window object (this is the default)
* * "#document" - the JavaScript document object
* * "#screen" - the JavaScript window.screen object
* * "#canvas" - the default WebGL canvas element
*
* Any other string without a leading # sign applies to the element on the page with that ID.
*
* By default SDL will use the JavaScript window object.
*/
[Version (since = "2.0.4")]
[CCode (cname = "SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT")]
public const string EMSCRIPTEN_KEYBOARD_ELEMENT;
/**
* A hint that specifies a variable specifying SDL's threads stack size in bytes or "0" for the backend's default size.
*
* Use this hint in case you need to set SDL's threads stack size to other than the default. This is specially
* useful if you build SDL against a non glibc libc library (such as musl) which provides a relatively small default
* thread stack size (a few kilobytes versus the default 8 MB glibc uses).
*
* Support for this hint is currently available only in the pthread backend.
*
* The variable can be set to the following values:
*
* * "0" - SDL will use the backend's default threads stack size
* * "X" - SDL will use the provided the X positive you provided as the threads stack size
*
* By default the backend's default threads stack size is used.
*/
[Version (since = "2.0.4")]
[CCode (cname = "SDL_HINT_THREAD_STACK_SIZE")]
public const string THREAD_STACK_SIZE;
/**
* A hint that specifies whether the window frame and title bar are interactive when the cursor is hidden.
*
* The variable can be set to the following values:
*
* * "0" - The window frame is not interactive when the cursor is hidden (no move, resize, etc)
* * "1" - The window frame is interactive when the cursor is hidden
*
* By default SDL will allow interaction with the window frame when the cursor is hidden.
*/
[Version (since = "2.0.4")]
[CCode (cname = "SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN")]
public const string WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN;
/**
* A hint that specifies whether the windows message loop is processed by SDL.
*
* The variable can be set to the following values:
*
* * "0" - The window message loop is not run
* * "1" - The window message loop is processed in {@link SDL.Event.pump}
*
* By default SDL will process the windows message loop.
*/
[Version (since = "2.0.4")]
[CCode (cname = "SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP")]
public const string WINDOWS_ENABLE_MESSAGELOOP;
/**
* A hint that specifies that SDL should not to generate an {@link SDL.WindowEvent} of type {@link SDL.WindowEventType.CLOSE} for Alt+F4 on Microsoft Windows.
*
* The variable can be set to the following values:
*
* * "0" - generate an {@link SDL.WindowEvent} of type {@link SDL.WindowEventType.CLOSE} for Alt+F4 (default)
* * "1" - Do not generate event and only do normal key handling for Alt+F4
*
* By default SDL will process the windows message loop.
*/
[Version (since = "2.0.4")]
[CCode (cname = "SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4")]
public const string WINDOWS_NO_CLOSE_ON_ALT_F4;
/**
* A hint that specifies that SDL should use the old axis and button mapping for XInput devices.
*
* This hint is for backwards compatibility only and will be removed in SDL 2.1
*
* The default value is "0". This hint must be set before {@link SDL.init}.
*
* The variable can be set to the following values:
*
* * "0" - SDL will use the old axis and button mapping for XInput devices
* * "1" - SDL won't use old axis and button mapping for XInput devices
*
* By default SDL does not use the old axis and button mapping for XInput devices.
*/
[Version (since = "2.0.4", deprecated_since = "2.1")]
[CCode (cname = "SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING")]
public const string XINPUT_USE_OLD_JOYSTICK_MAPPING;
/**
* A hint that specifies if the SDL app should not be forced to become a foreground process on Mac OS X.
*
* The variable can be set to the following values:
*
* * "0" - SDL will force the app to become a foreground process (default)
* * "1" - SDL won't not force the SDL app to become a foreground process
*
* By default the SDL app will be forced to become a foreground process on Mac OS X.
*/
[Version (since = "2.0.4")]
[CCode (cname = "SDL_HINT_MAC_BACKGROUND_APP")]
public const string MAC_BACKGROUND_APP;
/**
* A hint that specifies whether the X11 _NET_WM_PING protocol should be supported.
*
* The hint is checked in the {@link Video.Window} constructor
*
* The variable can be set to the following values:
*
* * "0" - disable _NET_WM_PING
* * "1" - enable _NET_WM_PING
*
* By default SDL will use _NET_WM_PING, but for applications that know they will not always be able to
* respond to ping requests in a timely manner they can turn it off to avoid the window manager thinking
* the app is hung.
*/
[Version (since = "2.0.4")]
[CCode (cname = "SDL_HINT_VIDEO_X11_NET_WM_PING")]
public const string VIDEO_X11_NET_WM_PING;
/**
* A callback used to watch hints.
*
* @param name What was passed as name to {@link Hint.add_callback}.
* @param old_value The old value.
* @param new_value The new value.
*/
[CCode (cname ="SDL_HintCallback", has_target = true)]
public delegate void HintFunc (string name, string old_value, string? new_value);
/**
* An enumeration of hint priorities
*/
[CCode (cname = "SDL_HintPriority", cprefix = "SDL_HINT_", has_type_id = false)]
public enum Priority {
/**
* Low priority, used for default values.
*/
DEFAULT,
/**
* Medium priority.
*/
NORMAL,
/**
* High priority.
*/
OVERRIDE;
}
/**
* Use this function to add a function to watch a particular hint.
*
* @param name The hint to watch.
* @param callback The delegate of {@link Hint.HintFunc} type to call when the hint value changes.
*
* @since 2.0.0
*/
[Version (since = "2.0.0")]
[CCode (cname ="SDL_AddHintCallback", cheader_filename = "SDL2/SDL_hints.h")]
public static void add_callback (string name, HintFunc callback);
/**
* Use this function to remove a function watching a particular hint.
*
* @param name The hint being watched.
* @param callback The delegate of {@link Hint.HintFunc} type being called when the hint value changes.
*/
[Version (since = "2.0.0")]
[CCode (cname ="SDL_DelHintCallback", cheader_filename = "SDL2/SDL_hints.h")]
public static void del_callback (string name, HintFunc callback);
/**
* Use this function to set a hint with normal priority.
*
* Hints will not be set if there is an existing override hint or environment
* variable that takes precedence. You can use {@link set_hint_with_priority}
* to set the hint with override priority instead.
*
* @param name The hint to set. Use one of the string constans from the {@link Hint} class.
* @param hint_value The value of the hint variable.
*
* @return true if the hint was set. false otherwise.
*/
[CCode (cname ="SDL_SetHint", cheader_filename = "SDL2/SDL_hints.h")]
public static bool set_hint (string name, string hint_value);
/**
* Use this function to get the value of a hint.
*
* @param name The hint to query. Use the constans from the {@link Hint} class.
*
* @return Returns the string value of a hint or null if the hint isn't set.
*/
[CCode (cname ="SDL_GetHint", cheader_filename = "SDL2/SDL_hints.h")]
public static unowned string get_hint (string name);
/**
* Use this funcion on boolean hints to see if they are enabled.
*/
public static bool hint_enabled (string name) {
return get_hint (name) == "0" ? true : false;
}
/**
* Use this function to clear all hints.