-
-
Notifications
You must be signed in to change notification settings - Fork 219
/
hints.go
479 lines (418 loc) · 34.9 KB
/
hints.go
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
package sdl
/*
#include "sdl_wrapper.h"
#include "hints.h"
#if !(SDL_VERSION_ATLEAST(2,28,0))
#define SDL_HINT_ENABLE_SCREEN_KEYBOARD ""
#endif
#if !(SDL_VERSION_ATLEAST(2,26,0))
#if defined(WARN_OUTDATED)
#pragma message("SDL_ResetHints is not supported before SDL 2.26.0")
#endif
#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 ""
#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED ""
#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS ""
#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE ""
#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED ""
#define SDL_HINT_JOYSTICK_HIDAPI_PS3 ""
#define SDL_HINT_JOYSTICK_HIDAPI_WII ""
#define SDL_HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED ""
#define SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS ""
#define SDL_HINT_HIDAPI_IGNORE_DEVICES ""
#define SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE ""
#define SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP ""
static inline void SDLCALL SDL_ResetHints(void)
{
// do nothing
}
#endif
#if !(SDL_VERSION_ATLEAST(2,0,20))
#define SDL_HINT_RENDER_LINE_METHOD ""
#endif
#if !(SDL_VERSION_ATLEAST(2,0,18))
#define SDL_HINT_APP_NAME ""
#endif
#if !(SDL_VERSION_ATLEAST(2,0,16))
#define SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE ""
#define SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT ""
#define SDL_HINT_AUDIO_INCLUDE_MONITORS ""
#define SDL_HINT_AUDIO_DEVICE_STREAM_ROLE ""
#define SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS ""
#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED ""
#define SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED ""
#endif
#if !(SDL_VERSION_ATLEAST(2,0,14))
#define SDL_HINT_JOYSTICK_HIDAPI_PS5 ""
#define SDL_HINT_MOUSE_RELATIVE_SCALING ""
#define SDL_HINT_PREFERRED_LOCALES ""
#define SDL_HINT_JOYSTICK_RAWINPUT ""
#define SDL_HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT ""
#define SDL_HINT_AUDIO_DEVICE_APP_NAME ""
#define SDL_HINT_AUDIO_DEVICE_STREAM_NAME ""
#define SDL_HINT_LINUX_JOYSTICK_DEADZONES ""
#define SDL_HINT_THREAD_PRIORITY_POLICY ""
#define SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL ""
#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO ""
#define SDL_HINT_EMSCRIPTEN_ASYNCIFY ""
#endif
#if !(SDL_VERSION_ATLEAST(2,0,12))
#define SDL_HINT_DISPLAY_USABLE_BOUNDS ""
#define SDL_HINT_GAMECONTROLLERTYPE ""
#define SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS ""
#define SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE ""
#define SDL_HINT_VIDEO_X11_WINDOW_VISUALID ""
#define SDL_HINT_VIDEO_X11_FORCE_EGL ""
#endif
#if !(SDL_VERSION_ATLEAST(2,0,9))
#define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME ""
#define SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS ""
#define SDL_HINT_JOYSTICK_HIDAPI_STEAM ""
#define SDL_HINT_JOYSTICK_HIDAPI_XBOX ""
#define SDL_HINT_JOYSTICK_HIDAPI_PS4 ""
#define SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE ""
#endif
#if !(SDL_VERSION_ATLEAST(2,0,8))
#define SDL_HINT_IOS_HIDE_HOME_INDICATOR ""
#define SDL_HINT_RETURN_KEY_HIDES_IME ""
#define SDL_HINT_TV_REMOTE_AS_JOYSTICK ""
#define SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR ""
#define SDL_HINT_VIDEO_DOUBLE_BUFFER ""
#endif
#if !(SDL_VERSION_ATLEAST(2,0,6))
#define SDL_HINT_AUDIO_RESAMPLING_MODE ""
#define SDL_HINT_RENDER_LOGICAL_SIZE_MODE ""
#define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE ""
#define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE ""
#define SDL_HINT_TOUCH_MOUSE_EVENTS ""
#define SDL_HINT_WINDOWS_INTRESOURCE_ICON ""
#define SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL ""
#endif
#if !(SDL_VERSION_ATLEAST(2,0,4))
#define SDL_HINT_NO_SIGNAL_HANDLERS ""
#define SDL_HINT_THREAD_STACK_SIZE ""
#define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN ""
#define SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP ""
#define SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 ""
#define SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING ""
#define SDL_HINT_MAC_BACKGROUND_APP ""
#define SDL_HINT_IME_INTERNAL_EDITING ""
#define SDL_HINT_VIDEO_X11_NET_WM_PING ""
#define SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH ""
#define SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION ""
#define SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION ""
#endif
#if !(SDL_VERSION_ATLEAST(2,0,3))
#define SDL_HINT_WINRT_PRIVACY_POLICY_URL ""
#define SDL_HINT_WINRT_PRIVACY_POLICY_LABEL ""
#define SDL_HINT_WINRT_HANDLE_BACK_BUTTON ""
#define SDL_HINT_RENDER_DIRECT3D11_DEBUG ""
#endif
#if !(SDL_VERSION_ATLEAST(2,0,2))
#define SDL_HINT_ACCELEROMETER_AS_JOYSTICK ""
#define SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK ""
#define SDL_HINT_VIDEO_ALLOW_SCREENSAVER ""
#define SDL_HINT_MOUSE_RELATIVE_MODE_WARP ""
#define SDL_HINT_VIDEO_WIN_D3DCOMPILER ""
#define SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT ""
#define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES ""
#endif
#if !(SDL_VERSION_ATLEAST(2,0,1))
#define SDL_HINT_RENDER_DIRECT3D_THREADSAFE ""
#define SDL_HINT_VIDEO_HIGHDPI_DISABLED ""
#endif
#if !(SDL_VERSION_ATLEAST(2,0,10))
#if defined(WARN_OUTDATED)
#pragma message("SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH has been removed in SDL 2.0.10")
#endif
#define SDL_HINT_RENDER_BATCHING ""
#define SDL_HINT_EVENT_LOGGING ""
#define SDL_HINT_GAMECONTROLLERCONFIG_FILE ""
#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE ""
#define SDL_HINT_MOUSE_TOUCH_EVENTS ""
#else
#define SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH "" // For compatibility
#endif
#if SDL_VERSION_ATLEAST(2,0,16)
#if defined(WARN_OUTDATED)
#pragma message("SDL_HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT has been replaced by SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT in SDL 2.0.16")
#endif
#define SDL_HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT (SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT)
#endif
#if !SDL_VERSION_ATLEAST(2,0,18)
#define SDL_HINT_IME_SHOW_UI ""
#define SDL_HINT_JOYSTICK_DEVICE ""
#define SDL_HINT_LINUX_JOYSTICK_CLASSIC ""
#define SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME ""
#define SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY ""
#endif
#if !SDL_VERSION_ATLEAST(2,0,22)
#define SDL_HINT_IME_SUPPORT_EXTENDED_TEXT ""
#define SDL_HINT_MOUSE_RELATIVE_MODE_CENTER ""
#define SDL_HINT_MOUSE_AUTO_CAPTURE ""
#define SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL ""
#define SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN ""
#define SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE ""
#define SDL_HINT_JOYSTICK_ROG_CHAKRAM ""
#define SDL_HINT_X11_WINDOW_TYPE ""
#define SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR ""
#define SDL_HINT_VIDEODRIVER ""
#endif
#if !SDL_VERSION_ATLEAST(2,24,0)
#if defined(WARN_OUTDATED)
#pragma message("SDL_ResetHint is not supported before SDL 2.24.0")
#endif
static inline SDL_bool SDL_ResetHint(const char *name)
{
return SDL_FALSE;
}
#define SDL_HINT_MOUSE_RELATIVE_WARP_MOTION ""
#define SDL_HINT_TRACKPAD_IS_TOUCH_ONLY ""
#define SDL_HINT_JOYSTICK_HIDAPI_COMBINE_JOY_CONS ""
#define SDL_HINT_JOYSTICK_HIDAPI_JOYCON_HOME_LED ""
#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED ""
#define SDL_HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC ""
#define SDL_HINT_JOYSTICK_HIDAPI_SHIELD ""
#define SDL_HINT_WINDOWS_DPI_AWARENESS ""
#define SDL_HINT_WINDOWS_DPI_SCALING ""
#define SDL_HINT_DIRECTINPUT_ENABLED ""
#define SDL_HINT_VIDEO_WAYLAND_MODE_EMULATION ""
#define SDL_HINT_KMSDRM_DEVICE_INDEX ""
#define SDL_HINT_LINUX_DIGITAL_HATS ""
#define SDL_HINT_LINUX_HAT_DEADZONES ""
#define SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH ""
#endif
*/
import "C"
import "unsafe"
// Configuration hints
// (https://wiki.libsdl.org/CategoryHints)
const (
HINT_FRAMEBUFFER_ACCELERATION = C.SDL_HINT_FRAMEBUFFER_ACCELERATION // specifies how 3D acceleration is used with Window.GetSurface()
HINT_RENDER_DRIVER = C.SDL_HINT_RENDER_DRIVER // specifies which render driver to use
HINT_RENDER_OPENGL_SHADERS = C.SDL_HINT_RENDER_OPENGL_SHADERS // specifies whether the OpenGL render driver uses shaders
HINT_RENDER_DIRECT3D_THREADSAFE = C.SDL_HINT_RENDER_DIRECT3D_THREADSAFE // specifies whether the Direct3D device is initialized for thread-safe operations
HINT_RENDER_DIRECT3D11_DEBUG = C.SDL_HINT_RENDER_DIRECT3D11_DEBUG // specifies a variable controlling whether to enable Direct3D 11+'s Debug Layer
HINT_RENDER_SCALE_QUALITY = C.SDL_HINT_RENDER_SCALE_QUALITY // specifies scaling quality
HINT_RENDER_VSYNC = C.SDL_HINT_RENDER_VSYNC // specifies whether sync to vertical refresh is enabled or disabled in CreateRenderer() to avoid tearing
HINT_VIDEO_ALLOW_SCREENSAVER = C.SDL_HINT_VIDEO_ALLOW_SCREENSAVER // specifies whether the screensaver is enabled
HINT_VIDEO_X11_NET_WM_PING = C.SDL_HINT_VIDEO_X11_NET_WM_PING // specifies whether the X11 _NET_WM_PING protocol should be supported
HINT_VIDEO_X11_XVIDMODE = C.SDL_HINT_VIDEO_X11_XVIDMODE // specifies whether the X11 VidMode extension should be used
HINT_VIDEO_X11_XINERAMA = C.SDL_HINT_VIDEO_X11_XINERAMA // specifies whether the X11 Xinerama extension should be used
HINT_VIDEO_X11_XRANDR = C.SDL_HINT_VIDEO_X11_XRANDR // specifies whether the X11 XRandR extension should be used
HINT_GRAB_KEYBOARD = C.SDL_HINT_GRAB_KEYBOARD // specifies whether grabbing input grabs the keyboard
HINT_MOUSE_DOUBLE_CLICK_TIME = C.SDL_HINT_MOUSE_DOUBLE_CLICK_TIME // specifies the double click time, in milliseconds
HINT_MOUSE_DOUBLE_CLICK_RADIUS = C.SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS // specifies the double click radius, in pixels.
HINT_MOUSE_RELATIVE_MODE_WARP = C.SDL_HINT_MOUSE_RELATIVE_MODE_WARP // specifies whether relative mouse mode is implemented using mouse warping
HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS = C.SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS // specifies if a Window is minimized if it loses key focus when in fullscreen mode
HINT_IDLE_TIMER_DISABLED = C.SDL_HINT_IDLE_TIMER_DISABLED // specifies a variable controlling whether the idle timer is disabled on iOS
HINT_IME_INTERNAL_EDITING = C.SDL_HINT_IME_INTERNAL_EDITING // specifies whether certain IMEs should handle text editing internally instead of sending TextEditingEvents
HINT_ORIENTATIONS = C.SDL_HINT_ORIENTATIONS // specifies a variable controlling which orientations are allowed on iOS
HINT_ACCELEROMETER_AS_JOYSTICK = C.SDL_HINT_ACCELEROMETER_AS_JOYSTICK // specifies whether the Android / iOS built-in accelerometer should be listed as a joystick device, rather than listing actual joysticks only
HINT_XINPUT_ENABLED = C.SDL_HINT_XINPUT_ENABLED // specifies if Xinput gamepad devices are detected
HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING = C.SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING // specifies that SDL should use the old axis and button mapping for XInput devices
HINT_GAMECONTROLLERCONFIG = C.SDL_HINT_GAMECONTROLLERCONFIG // specifies extra gamecontroller db entries
HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS = C.SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS // specifies if joystick (and gamecontroller) events are enabled even when the application is in the background
HINT_ALLOW_TOPMOST = C.SDL_HINT_ALLOW_TOPMOST // specifies if top most bit on an SDL Window can be set
HINT_THREAD_STACK_SIZE = C.SDL_HINT_THREAD_STACK_SIZE // specifies a variable specifying SDL's threads stack size in bytes or "0" for the backend's default size
HINT_TIMER_RESOLUTION = C.SDL_HINT_TIMER_RESOLUTION // specifies the timer resolution in milliseconds
HINT_VIDEO_HIGHDPI_DISABLED = C.SDL_HINT_VIDEO_HIGHDPI_DISABLED // specifies if high-DPI windows ("Retina" on Mac and iOS) are not allowed
HINT_MAC_BACKGROUND_APP = C.SDL_HINT_MAC_BACKGROUND_APP // specifies if the SDL app should not be forced to become a foreground process on Mac OS X
HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK = C.SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK // specifies whether ctrl+click should generate a right-click event on Mac
HINT_VIDEO_WIN_D3DCOMPILER = C.SDL_HINT_VIDEO_WIN_D3DCOMPILER // specifies which shader compiler to preload when using the Chrome ANGLE binaries
HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT = C.SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT // specifies the address of another Window* (as a hex string formatted with "%p")
HINT_WINRT_PRIVACY_POLICY_URL = C.SDL_HINT_WINRT_PRIVACY_POLICY_URL // specifies a URL to a WinRT app's privacy policy
HINT_WINRT_PRIVACY_POLICY_LABEL = C.SDL_HINT_WINRT_PRIVACY_POLICY_LABEL // specifies a label text for a WinRT app's privacy policy link
HINT_WINRT_HANDLE_BACK_BUTTON = C.SDL_HINT_WINRT_HANDLE_BACK_BUTTON // specifies a variable to allow back-button-press events on Windows Phone to be marked as handled
HINT_VIDEO_MAC_FULLSCREEN_SPACES = C.SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES // specifies policy for fullscreen Spaces on Mac OS X
HINT_NO_SIGNAL_HANDLERS = C.SDL_HINT_NO_SIGNAL_HANDLERS // specifies not to catch the SIGINT or SIGTERM signals
HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN = C.SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN // specifies whether the window frame and title bar are interactive when the cursor is hidden
HINT_WINDOWS_ENABLE_MESSAGELOOP = C.SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP // specifies whether the windows message loop is processed by SDL
HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 = C.SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 // specifies that SDL should not to generate WINDOWEVENT_CLOSE events for Alt+F4 on Microsoft Windows
HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH = C.SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH // specifies a variable to control whether mouse and touch events are to be treated together or separately
HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION = C.SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION // specifies the Android APK expansion main file version
HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION = C.SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION // specifies the Android APK expansion patch file version
HINT_AUDIO_RESAMPLING_MODE = C.SDL_HINT_AUDIO_RESAMPLING_MODE // specifies a variable controlling speed/quality tradeoff of audio resampling
HINT_RENDER_LOGICAL_SIZE_MODE = C.SDL_HINT_RENDER_LOGICAL_SIZE_MODE // specifies a variable controlling the scaling policy for SDL_RenderSetLogicalSize
HINT_MOUSE_NORMAL_SPEED_SCALE = C.SDL_HINT_MOUSE_NORMAL_SPEED_SCALE // specifies a variable setting the speed scale for mouse motion, in floating point, when the mouse is not in relative mode
HINT_MOUSE_RELATIVE_SPEED_SCALE = C.SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE // specifies a variable setting the scale for mouse motion, in floating point, when the mouse is in relative mode
HINT_MOUSE_TOUCH_EVENTS = C.SDL_HINT_MOUSE_TOUCH_EVENTS // specifies a variable to control whether mouse events should generate synthetic touch events
HINT_TOUCH_MOUSE_EVENTS = C.SDL_HINT_TOUCH_MOUSE_EVENTS // specifies a variable controlling whether touch events should generate synthetic mouse events
HINT_WINDOWS_INTRESOURCE_ICON = C.SDL_HINT_WINDOWS_INTRESOURCE_ICON // specifies a variable to specify custom icon resource id from RC file on Windows platform
HINT_WINDOWS_INTRESOURCE_ICON_SMALL = C.SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL // specifies a variable to specify custom icon resource id from RC file on Windows platform
HINT_IOS_HIDE_HOME_INDICATOR = C.SDL_HINT_IOS_HIDE_HOME_INDICATOR // specifies a variable controlling whether the home indicator bar on iPhone X should be hidden.
HINT_RETURN_KEY_HIDES_IME = C.SDL_HINT_RETURN_KEY_HIDES_IME // specifies a variable to control whether the return key on the soft keyboard should hide the soft keyboard on Android and iOS.
HINT_TV_REMOTE_AS_JOYSTICK = C.SDL_HINT_TV_REMOTE_AS_JOYSTICK // specifies a variable controlling whether the Android / tvOS remotes should be listed as joystick devices, instead of sending keyboard events.
HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR = C.SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR // specifies a variable controlling whether the X11 _NET_WM_BYPASS_COMPOSITOR hint should be used.
HINT_VIDEO_DOUBLE_BUFFER = C.SDL_HINT_VIDEO_DOUBLE_BUFFER // specifies a variable that tells the video driver that we only want a double buffer.
HINT_RENDER_BATCHING = C.SDL_HINT_RENDER_BATCHING // specifies a variable controlling whether the 2D render API is compatible or efficient.
HINT_EVENT_LOGGING = C.SDL_HINT_EVENT_LOGGING // specifies a variable controlling whether SDL logs all events pushed onto its internal queue.
HINT_GAMECONTROLLERCONFIG_FILE = C.SDL_HINT_GAMECONTROLLERCONFIG_FILE // specifies a variable that lets you provide a file with extra gamecontroller db entries.
HINT_ANDROID_BLOCK_ON_PAUSE = C.SDL_HINT_ANDROID_BLOCK_ON_PAUSE // specifies a variable to control whether the event loop will block itself when the app is paused.
HINT_DISPLAY_USABLE_BOUNDS = C.SDL_HINT_DISPLAY_USABLE_BOUNDS // Override for SDL_GetDisplayUsableBounds().
HINT_GAMECONTROLLERTYPE = C.SDL_HINT_GAMECONTROLLERTYPE // Overrides the automatic controller type detection.
HINT_GAMECONTROLLER_USE_BUTTON_LABELS = C.SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS // If set, game controller face buttons report their values according to their labels instead of their positional layout.
HINT_JOYSTICK_HIDAPI_GAMECUBE = C.SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE // A variable controlling whether the HIDAPI driver for Nintendo GameCube controllers should be used.
HINT_VIDEO_X11_WINDOW_VISUALID = C.SDL_HINT_VIDEO_X11_WINDOW_VISUALID // A variable forcing the visual ID chosen for new X11 windows.
HINT_VIDEO_X11_FORCE_EGL = C.SDL_HINT_VIDEO_X11_FORCE_EGL // A variable controlling whether X11 should use GLX or EGL by default.
HINT_MOUSE_RELATIVE_SCALING = C.SDL_HINT_MOUSE_RELATIVE_SCALING // A variable controlling whether relative mouse motion is affected by renderer scaling.
HINT_PREFERRED_LOCALES = C.SDL_HINT_PREFERRED_LOCALES // Override for SDL_GetPreferredLocales().
HINT_JOYSTICK_RAWINPUT = C.SDL_HINT_JOYSTICK_RAWINPUT // A variable controlling whether the RAWINPUT joystick drivers should be used for better handling XInput-capable devices.
HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT = C.SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT // A variable controlling whether the HIDAPI driver for XBox controllers on Windows should pull correlated data from XInput.
HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT = C.SDL_HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT // A variable controlling whether the HIDAPI driver for XBox controllers on Windows should pull correlated data from XInput.
HINT_AUDIO_DEVICE_APP_NAME = C.SDL_HINT_AUDIO_DEVICE_APP_NAME // Specify an application name for an audio device.
HINT_AUDIO_DEVICE_STREAM_NAME = C.SDL_HINT_AUDIO_DEVICE_STREAM_NAME // Specify an application name for an audio device.
HINT_LINUX_JOYSTICK_DEADZONES = C.SDL_HINT_LINUX_JOYSTICK_DEADZONES // A variable controlling whether joysticks on Linux adhere to their HID-defined deadzones or return unfiltered values.
HINT_THREAD_PRIORITY_POLICY = C.SDL_HINT_THREAD_PRIORITY_POLICY // A string specifying additional information to use with SDL_SetThreadPriority.
HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL = C.SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL // Specifies whether SDL_THREAD_PRIORITY_TIME_CRITICAL should be treated as realtime.
HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO = C.SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO // A variable to control whether SDL will pause audio in background (Requires SDL_ANDROID_BLOCK_ON_PAUSE as "Non blocking").
HINT_EMSCRIPTEN_ASYNCIFY = C.SDL_HINT_EMSCRIPTEN_ASYNCIFY // Disable giving back control to the browser automatically when running with asyncify.
HINT_AUDIO_INCLUDE_MONITORS = C.SDL_HINT_AUDIO_INCLUDE_MONITORS // Control whether PulseAudio recording should include monitor devices
HINT_AUDIO_DEVICE_STREAM_ROLE = C.SDL_HINT_AUDIO_DEVICE_STREAM_ROLE // Describe the role of your application for audio control panels
HINT_APP_NAME = C.SDL_HINT_APP_NAME // Lets you specify the application name sent to the OS when required
HINT_VIDEO_EGL_ALLOW_TRANSPARENCY = C.SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY // A variable controlling whether the EGL window is allowed to be composited as transparent, rather than opaque
HINT_IME_SHOW_UI = C.SDL_HINT_IME_SHOW_UI // A variable to control whether certain IMEs should show native UI components (such as the Candidate List) instead of suppressing them
HINT_IME_SUPPORT_EXTENDED_TEXT = C.SDL_HINT_IME_SUPPORT_EXTENDED_TEXT // A variable to control if extended IME text support is enabled.
HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME = C.SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME // This hint lets you specify the "activity name" sent to the OS when SDL_DisableScreenSaver() is used (or the screensaver is automatically disabled)
HINT_LINUX_JOYSTICK_CLASSIC = C.SDL_HINT_LINUX_JOYSTICK_CLASSIC // A variable controlling whether to use the classic /dev/input/js* joystick interface or the newer /dev/input/event* joystick interface on Linux
HINT_JOYSTICK_DEVICE = C.SDL_HINT_JOYSTICK_DEVICE // This variable is currently only used by the Linux joystick driver
HINT_JOYSTICK_HIDAPI_STEAM = C.SDL_HINT_JOYSTICK_HIDAPI_STEAM // A variable controlling whether the HIDAPI driver for Steam Controllers should be used
HINT_RENDER_LINE_METHOD = C.SDL_HINT_RENDER_LINE_METHOD // A variable controlling how the 2D render API renders lines
HINT_MOUSE_RELATIVE_MODE_CENTER = C.SDL_HINT_MOUSE_RELATIVE_MODE_CENTER // A variable controlling whether relative mouse mode constrains the mouse to the center of the window
HINT_MOUSE_AUTO_CAPTURE = C.SDL_HINT_MOUSE_AUTO_CAPTURE // A variable controlling whether the mouse is captured while mouse buttons are pressed
HINT_VIDEO_FOREIGN_WINDOW_OPENGL = C.SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL // When calling SDL_CreateWindowFrom(), make the window compatible with OpenGL
HINT_VIDEO_FOREIGN_WINDOW_VULKAN = C.SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN // When calling SDL_CreateWindowFrom(), make the window compatible with Vulkan
HINT_QUIT_ON_LAST_WINDOW_CLOSE = C.SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE // A variable that decides whether to send SDL_QUIT when closing the final window
HINT_JOYSTICK_ROG_CHAKRAM = C.SDL_HINT_JOYSTICK_ROG_CHAKRAM // A variable controlling whether the ROG Chakram mice should show up as joysticks
HINT_X11_WINDOW_TYPE = C.SDL_HINT_X11_WINDOW_TYPE // A variable that forces X11 windows to create as a custom type
HINT_VIDEO_WAYLAND_PREFER_LIBDECOR = C.SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR // A variable controlling whether the libdecor Wayland backend is preferred over native decrations
HINT_VIDEODRIVER = C.SDL_HINT_VIDEODRIVER // A variable that decides what video backend to use
HINT_JOYSTICK_HIDAPI_PS4 = C.SDL_HINT_JOYSTICK_HIDAPI_PS4 // A variable controlling whether the HIDAPI driver for PS4 controllers should be used
HINT_JOYSTICK_HIDAPI_PS4_RUMBLE = C.SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE // A variable controlling whether extended input reports should be used for PS4 controllers when using the HIDAPI driver
HINT_JOYSTICK_HIDAPI_PS5 = C.SDL_HINT_JOYSTICK_HIDAPI_PS5 // A variable controlling whether the HIDAPI driver for PS5 controllers should be used
HINT_JOYSTICK_HIDAPI_PS5_RUMBLE = C.SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE // A variable controlling whether extended input reports should be used for PS5 controllers when using the HIDAPI driver
HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED = C.SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED // A variable controlling whether the player LEDs should be lit to indicate which player is associated with a PS5 controller
// 2.24.0
HINT_MOUSE_RELATIVE_WARP_MOTION = C.SDL_HINT_MOUSE_RELATIVE_WARP_MOTION // A variable controlling whether a motion event should be generated for mouse warping in relative mode
HINT_TRACKPAD_IS_TOUCH_ONLY = C.SDL_HINT_TRACKPAD_IS_TOUCH_ONLY // A variable that treats trackpads as touch devices
HINT_JOYSTICK_HIDAPI_JOY_CONS = C.SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS // A variable controlling whether the HIDAPI driver for Nintendo Switch Joy-Cons should be used
HINT_JOYSTICK_HIDAPI_COMBINE_JOY_CONS = C.SDL_HINT_JOYSTICK_HIDAPI_COMBINE_JOY_CONS // A variable controlling whether Nintendo Switch Joy-Con controllers will be combined into a single Pro-like controller when using the HIDAPI driver
HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED = C.SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED // A variable controlling whether the Home button LED should be turned on when a Nintendo Switch Pro controller is opened
HINT_JOYSTICK_HIDAPI_JOYCON_HOME_LED = C.SDL_HINT_JOYSTICK_HIDAPI_JOYCON_HOME_LED // A variable controlling whether the Home button LED should be turned on when a Nintendo Switch Joy-Con controller is opened
HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED = C.SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED // A variable controlling whether the player LEDs should be lit to indicate which player is associated with a Nintendo Switch controller
HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC = C.SDL_HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC // A variable controlling whether the HIDAPI driver for Nintendo Online classic controllers should be used
HINT_JOYSTICK_HIDAPI_SHIELD = C.SDL_HINT_JOYSTICK_HIDAPI_SHIELD // A variable controlling whether the HIDAPI driver for NVIDIA SHIELD controllers should be used
HINT_WINDOWS_DPI_AWARENESS = C.SDL_HINT_WINDOWS_DPI_AWARENESS // Controls whether SDL will declare the process to be DPI aware
HINT_WINDOWS_DPI_SCALING = C.SDL_HINT_WINDOWS_DPI_SCALING // Uses DPI-scaled points as the SDL coordinate system on Windows
HINT_DIRECTINPUT_ENABLED = C.SDL_HINT_DIRECTINPUT_ENABLED // A variable that lets you disable the detection and use of DirectInput gamepad devices
HINT_VIDEO_WAYLAND_MODE_EMULATION = C.SDL_HINT_VIDEO_WAYLAND_MODE_EMULATION // A variable controlling whether video mode emulation is enabled under Wayland
HINT_KMSDRM_DEVICE_INDEX = C.SDL_HINT_KMSDRM_DEVICE_INDEX // A variable that decides what KMSDRM device to use
HINT_LINUX_DIGITAL_HATS = C.SDL_HINT_LINUX_DIGITAL_HATS // A variable controlling whether joysticks on Linux will always treat 'hat' axis inputs (ABS_HAT0X - ABS_HAT3Y) as 8-way digital hats without checking whether they may be analog
HINT_LINUX_HAT_DEADZONES = C.SDL_HINT_LINUX_HAT_DEADZONES // A variable controlling whether digital hats on Linux will apply deadzones to their underlying input axes or use unfiltered values
HINT_MAC_OPENGL_ASYNC_DISPATCH = C.SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH // A variable controlling whether dispatching OpenGL context updates should block the dispatching thread until the main thread finishes processing
// 2.26.0
HINT_JOYSTICK_HIDAPI_WII = C.SDL_HINT_JOYSTICK_HIDAPI_WII // A variable controlling whether the HIDAPI driver for Nintendo Wii and Wii U controllers should be used
HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED = C.SDL_HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED // A variable controlling whether the player LEDs should be lit to indicate which player is associated with a Wii controller
HINT_JOYSTICK_HIDAPI_XBOX = C.SDL_HINT_JOYSTICK_HIDAPI_XBOX // A variable controlling whether the HIDAPI driver for XBox controllers should be used
HINT_JOYSTICK_HIDAPI_XBOX_360 = C.SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 // A variable controlling whether the HIDAPI driver for XBox 360 controllers should be used
HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED = C.SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED // A variable controlling whether the player LEDs should be lit to indicate which player is associated with an Xbox 360 controller
HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS = C.SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS // A variable controlling whether the HIDAPI driver for XBox 360 wireless controllers should be used
HINT_JOYSTICK_HIDAPI_XBOX_ONE = C.SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE // A variable controlling whether the HIDAPI driver for XBox One controllers should be used
HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED = C.SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED // A variable controlling whether the Home button LED should be turned on when an Xbox One controller is opened
HINT_JOYSTICK_HIDAPI_PS3 = C.SDL_HINT_JOYSTICK_HIDAPI_PS3 // A variable controlling whether the HIDAPI driver for PS3 controllers should be used
HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS = C.SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS // A variable controlling whether Nintendo Switch Joy-Con controllers will be in vertical mode when using the HIDAPI driver
HINT_HIDAPI_IGNORE_DEVICES = C.SDL_HINT_HIDAPI_IGNORE_DEVICES // A variable containing a list of devices to ignore in SDL_hid_enumerate()
HINT_MOUSE_RELATIVE_SYSTEM_SCALE = C.SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE // A variable controlling whether the system mouse acceleration curve is used for relative mouse motion
HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP = C.SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP // Enable or disable mouse pointer warp emulation, needed by some older games
// 2.28.0
HINT_ENABLE_SCREEN_KEYBOARD = C.SDL_HINT_ENABLE_SCREEN_KEYBOARD // A variable that controls whether the on-screen keyboard should be shown when text input is active
)
// An enumeration of hint priorities.
// HintPriority is a hint priority used in SetHintWithPriority().
// (https://wiki.libsdl.org/SDL_HintPriority)
type HintPriority C.SDL_HintPriority
const (
HINT_DEFAULT HintPriority = C.SDL_HINT_DEFAULT // low priority, used for default values
HINT_NORMAL HintPriority = C.SDL_HINT_NORMAL // medium priority
HINT_OVERRIDE HintPriority = C.SDL_HINT_OVERRIDE // high priority
)
// HintCallback is the function to call when the hint value changes.
type HintCallback func(data interface{}, name, oldValue, newValue string)
// HintCallbackAndData contains a callback function and userdata.
type HintCallbackAndData struct {
callback HintCallback // the function to call when the hint value changes
data interface{} // data to pass to the callback function
}
var hintCallbacks = make(map[string]HintCallbackAndData)
func (hp HintPriority) c() C.SDL_HintPriority {
return C.SDL_HintPriority(hp)
}
// SetHintWithPriority sets a hint with a specific priority.
// (https://wiki.libsdl.org/SDL_SetHintWithPriority)
func SetHintWithPriority(name, value string, hp HintPriority) bool {
_name := C.CString(name)
_value := C.CString(value)
defer C.free(unsafe.Pointer(_name))
defer C.free(unsafe.Pointer(_value))
return C.SDL_SetHintWithPriority(_name, _value, hp.c()) > 0
}
// SetHint sets a hint with normal priority.
// (https://wiki.libsdl.org/SDL_SetHint)
func SetHint(name, value string) bool {
_name := C.CString(name)
_value := C.CString(value)
defer C.free(unsafe.Pointer(_name))
defer C.free(unsafe.Pointer(_value))
return C.SDL_SetHint(_name, _value) > 0
}
// ResetHint resets a hint to the default value.
// (https://wiki.libsdl.org/SDL_ResetHint)
func ResetHint(name string) bool {
_name := C.CString(name)
defer C.free(unsafe.Pointer(_name))
return C.SDL_ResetHint(_name) == C.SDL_TRUE
}
// ResetHints resets all hints to the default values.
// (https://wiki.libsdl.org/SDL_ResetHints)
func ResetHints() {
C.SDL_ResetHints()
}
// GetHint returns the value of a hint.
// (https://wiki.libsdl.org/SDL_GetHint)
func GetHint(name string) string {
_name := C.CString(name)
defer C.free(unsafe.Pointer(_name))
return C.GoString(C.SDL_GetHint(_name))
}
// ClearHints clears all hints.
// (https://wiki.libsdl.org/SDL_ClearHints)
func ClearHints() {
C.SDL_ClearHints()
}
// AddHintCallback adds a function to watch a particular hint.
// (https://wiki.libsdl.org/SDL_AddHintCallback)
func AddHintCallback(name string, fn HintCallback, data interface{}) {
_name := C.CString(name)
defer C.free(unsafe.Pointer(_name))
hintCallbacks[name] = HintCallbackAndData{
callback: fn,
data: data,
}
C.addHintCallback(_name)
}
// DelHintCallback removes a function watching a particular hint.
// (https://wiki.libsdl.org/SDL_DelHintCallback)
func DelHintCallback(name string) {
_name := C.CString(name)
defer C.free(unsafe.Pointer(_name))
delete(hintCallbacks, name)
C.delHintCallback(_name)
}
//export goHintCallback
func goHintCallback(_name, _oldValue, _newValue *C.char) {
name := C.GoString(_name)
oldValue := C.GoString(_oldValue)
newValue := C.GoString(_newValue)
if cb, ok := hintCallbacks[name]; ok {
cb.callback(cb.data, name, oldValue, newValue)
}
}