SDL 3.0
SDL_hints.h
Go to the documentation of this file.
1/*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20*/
21
22/**
23 * \file SDL_hints.h
24 *
25 * Official documentation for SDL configuration variables
26 *
27 * This file contains functions to set and get configuration hints,
28 * as well as listing each of them alphabetically.
29 *
30 * The convention for naming hints is SDL_HINT_X, where "SDL_X" is
31 * the environment variable that can be used to override the default.
32 *
33 * In general these hints are just that - they may or may not be
34 * supported or applicable on any given platform, but they provide
35 * a way for an application or user to give the library a hint as
36 * to how they would like the library to work.
37 */
38
39#ifndef SDL_hints_h_
40#define SDL_hints_h_
41
42#include <SDL3/SDL_stdinc.h>
43
44#include <SDL3/SDL_begin_code.h>
45/* Set up for C function definitions, even when using C++ */
46#ifdef __cplusplus
47extern "C" {
48#endif
49
50/**
51 * \brief A variable controlling whether the Android / iOS built-in
52 * accelerometer should be listed as a joystick device.
53 *
54 * This variable can be set to the following values:
55 * "0" - The accelerometer is not listed as a joystick
56 * "1" - The accelerometer is available as a 3 axis joystick (the default).
57 */
58#define SDL_HINT_ACCELEROMETER_AS_JOYSTICK "SDL_ACCELEROMETER_AS_JOYSTICK"
59
60/**
61 * \brief Specify the behavior of Alt+Tab while the keyboard is grabbed.
62 *
63 * By default, SDL emulates Alt+Tab functionality while the keyboard is grabbed
64 * and your window is full-screen. This prevents the user from getting stuck in
65 * your application if you've enabled keyboard grab.
66 *
67 * The variable can be set to the following values:
68 * "0" - SDL will not handle Alt+Tab. Your application is responsible
69 for handling Alt+Tab while the keyboard is grabbed.
70 * "1" - SDL will minimize your window when Alt+Tab is pressed (default)
71*/
72#define SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED "SDL_ALLOW_ALT_TAB_WHILE_GRABBED"
73
74/**
75 * \brief If set to "0" then never set the top most bit on a SDL Window, even if the video mode expects it.
76 * This is a debugging aid for developers and not expected to be used by end users. The default is "1"
77 *
78 * This variable can be set to the following values:
79 * "0" - don't allow topmost
80 * "1" - allow topmost
81 */
82#define SDL_HINT_ALLOW_TOPMOST "SDL_ALLOW_TOPMOST"
83
84/**
85 * \brief Android APK expansion main file version. Should be a string number like "1", "2" etc.
86 *
87 * Must be set together with SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION.
88 *
89 * If both hints were set then SDL_RWFromFile() will look into expansion files
90 * after a given relative path was not found in the internal storage and assets.
91 *
92 * By default this hint is not set and the APK expansion files are not searched.
93 */
94#define SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION "SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION"
95
96/**
97 * \brief Android APK expansion patch file version. Should be a string number like "1", "2" etc.
98 *
99 * Must be set together with SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION.
100 *
101 * If both hints were set then SDL_RWFromFile() will look into expansion files
102 * after a given relative path was not found in the internal storage and assets.
103 *
104 * By default this hint is not set and the APK expansion files are not searched.
105 */
106#define SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION "SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION"
107
108/**
109 * \brief A variable to control whether the event loop will block itself when the app is paused.
110 *
111 * The variable can be set to the following values:
112 * "0" - Non blocking.
113 * "1" - Blocking. (default)
114 *
115 * The value should be set before SDL is initialized.
116 */
117#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE "SDL_ANDROID_BLOCK_ON_PAUSE"
118
119/**
120 * \brief A variable to control whether SDL will pause audio in background
121 * (Requires SDL_ANDROID_BLOCK_ON_PAUSE as "Non blocking")
122 *
123 * The variable can be set to the following values:
124 * "0" - Non paused.
125 * "1" - Paused. (default)
126 *
127 * The value should be set before SDL is initialized.
128 */
129#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO "SDL_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO"
130
131/**
132 * \brief A variable to control whether we trap the Android back button to handle it manually.
133 * This is necessary for the right mouse button to work on some Android devices, or
134 * to be able to trap the back button for use in your code reliably. If set to true,
135 * the back button will show up as an SDL_EVENT_KEY_DOWN / SDL_EVENT_KEY_UP pair with a keycode of
136 * SDL_SCANCODE_AC_BACK.
137 *
138 * The variable can be set to the following values:
139 * "0" - Back button will be handled as usual for system. (default)
140 * "1" - Back button will be trapped, allowing you to handle the key press
141 * manually. (This will also let right mouse click work on systems
142 * where the right mouse button functions as back.)
143 *
144 * The value of this hint is used at runtime, so it can be changed at any time.
145 */
146#define SDL_HINT_ANDROID_TRAP_BACK_BUTTON "SDL_ANDROID_TRAP_BACK_BUTTON"
147
148/**
149 * \brief Specify an application name.
150 *
151 * This hint lets you specify the application name sent to the OS when
152 * required. For example, this will often appear in volume control applets for
153 * audio streams, and in lists of applications which are inhibiting the
154 * screensaver. You should use a string that describes your program ("My Game
155 * 2: The Revenge")
156 *
157 * Setting this to "" or leaving it unset will have SDL use a reasonable
158 * default: probably the application's name or "SDL Application" if SDL
159 * doesn't have any better information.
160 *
161 * Note that, for audio streams, this can be overridden with
162 * SDL_HINT_AUDIO_DEVICE_APP_NAME.
163 *
164 * On targets where this is not supported, this hint does nothing.
165 */
166#define SDL_HINT_APP_NAME "SDL_APP_NAME"
167
168/**
169 * \brief A variable controlling whether controllers used with the Apple TV
170 * generate UI events.
171 *
172 * When UI events are generated by controller input, the app will be
173 * backgrounded when the Apple TV remote's menu button is pressed, and when the
174 * pause or B buttons on gamepads are pressed.
175 *
176 * More information about properly making use of controllers for the Apple TV
177 * can be found here:
178 * https://developer.apple.com/tvos/human-interface-guidelines/remote-and-controllers/
179 *
180 * This variable can be set to the following values:
181 * "0" - Controller input does not generate UI events (the default).
182 * "1" - Controller input generates UI events.
183 */
184#define SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS "SDL_APPLE_TV_CONTROLLER_UI_EVENTS"
185
186/**
187 * \brief A variable controlling whether the Apple TV remote's joystick axes
188 * will automatically match the rotation of the remote.
189 *
190 * This variable can be set to the following values:
191 * "0" - Remote orientation does not affect joystick axes (the default).
192 * "1" - Joystick axes are based on the orientation of the remote.
193 */
194#define SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION "SDL_APPLE_TV_REMOTE_ALLOW_ROTATION"
195
196/**
197 * \brief A variable controlling the audio category on iOS and macOS
198 *
199 * This variable can be set to the following values:
200 *
201 * "ambient" - Use the AVAudioSessionCategoryAmbient audio category, will be muted by the phone mute switch (default)
202 * "playback" - Use the AVAudioSessionCategoryPlayback category
203 *
204 * For more information, see Apple's documentation:
205 * https://developer.apple.com/library/content/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/AudioSessionCategoriesandModes/AudioSessionCategoriesandModes.html
206 */
207#define SDL_HINT_AUDIO_CATEGORY "SDL_AUDIO_CATEGORY"
208
209/**
210 * \brief Specify an application name for an audio device.
211 *
212 * Some audio backends (such as PulseAudio) allow you to describe your audio
213 * stream. Among other things, this description might show up in a system
214 * control panel that lets the user adjust the volume on specific audio
215 * streams instead of using one giant master volume slider.
216 *
217 * This hints lets you transmit that information to the OS. The contents of
218 * this hint are used while opening an audio device. You should use a string
219 * that describes your program ("My Game 2: The Revenge")
220 *
221 * Setting this to "" or leaving it unset will have SDL use a reasonable
222 * default: this will be the name set with SDL_HINT_APP_NAME, if that hint is
223 * set. Otherwise, it'll probably the application's name or "SDL Application"
224 * if SDL doesn't have any better information.
225 *
226 * On targets where this is not supported, this hint does nothing.
227 */
228#define SDL_HINT_AUDIO_DEVICE_APP_NAME "SDL_AUDIO_DEVICE_APP_NAME"
229
230/**
231 * \brief Specify an application name for an audio device.
232 *
233 * Some audio backends (such as PulseAudio) allow you to describe your audio
234 * stream. Among other things, this description might show up in a system
235 * control panel that lets the user adjust the volume on specific audio
236 * streams instead of using one giant master volume slider.
237 *
238 * This hints lets you transmit that information to the OS. The contents of
239 * this hint are used while opening an audio device. You should use a string
240 * that describes your what your program is playing ("audio stream" is
241 * probably sufficient in many cases, but this could be useful for something
242 * like "team chat" if you have a headset playing VoIP audio separately).
243 *
244 * Setting this to "" or leaving it unset will have SDL use a reasonable
245 * default: "audio stream" or something similar.
246 *
247 * On targets where this is not supported, this hint does nothing.
248 */
249#define SDL_HINT_AUDIO_DEVICE_STREAM_NAME "SDL_AUDIO_DEVICE_STREAM_NAME"
250
251/**
252 * \brief Specify an application role for an audio device.
253 *
254 * Some audio backends (such as Pipewire) allow you to describe the role of
255 * your audio stream. Among other things, this description might show up in
256 * a system control panel or software for displaying and manipulating media
257 * playback/capture graphs.
258 *
259 * This hints lets you transmit that information to the OS. The contents of
260 * this hint are used while opening an audio device. You should use a string
261 * that describes your what your program is playing (Game, Music, Movie,
262 * etc...).
263 *
264 * Setting this to "" or leaving it unset will have SDL use a reasonable
265 * default: "Game" or something similar.
266 *
267 * On targets where this is not supported, this hint does nothing.
268 */
269#define SDL_HINT_AUDIO_DEVICE_STREAM_ROLE "SDL_AUDIO_DEVICE_STREAM_ROLE"
270
271/**
272 * \brief A variable controlling speed/quality tradeoff of audio resampling.
273 *
274 * If available, SDL can use libsamplerate ( http://www.mega-nerd.com/SRC/ )
275 * to handle audio resampling. There are different resampling modes available
276 * that produce different levels of quality, using more CPU.
277 *
278 * If this hint isn't specified to a valid setting, or libsamplerate isn't
279 * available, SDL will use the default, internal resampling algorithm.
280 *
281 * As of SDL 2.26, SDL_ConvertAudio() respects this hint when libsamplerate is available.
282 *
283 * This hint is currently only checked at audio subsystem initialization.
284 *
285 * This variable can be set to the following values:
286 *
287 * "0" or "default" - Use SDL's internal resampling (Default when not set - low quality, fast)
288 * "1" or "fast" - Use fast, slightly higher quality resampling, if available
289 * "2" or "medium" - Use medium quality resampling, if available
290 * "3" or "best" - Use high quality resampling, if available
291 */
292#define SDL_HINT_AUDIO_RESAMPLING_MODE "SDL_AUDIO_RESAMPLING_MODE"
293
294/**
295 * \brief A variable controlling whether SDL updates joystick state when getting input events
296 *
297 * This variable can be set to the following values:
298 *
299 * "0" - You'll call SDL_UpdateJoysticks() manually
300 * "1" - SDL will automatically call SDL_UpdateJoysticks() (default)
301 *
302 * This hint can be toggled on and off at runtime.
303 */
304#define SDL_HINT_AUTO_UPDATE_JOYSTICKS "SDL_AUTO_UPDATE_JOYSTICKS"
305
306/**
307 * \brief A variable controlling whether SDL updates sensor state when getting input events
308 *
309 * This variable can be set to the following values:
310 *
311 * "0" - You'll call SDL_UpdateSensors() manually
312 * "1" - SDL will automatically call SDL_UpdateSensors() (default)
313 *
314 * This hint can be toggled on and off at runtime.
315 */
316#define SDL_HINT_AUTO_UPDATE_SENSORS "SDL_AUTO_UPDATE_SENSORS"
317
318/**
319 * \brief Prevent SDL from using version 4 of the bitmap header when saving BMPs.
320 *
321 * The bitmap header version 4 is required for proper alpha channel support and
322 * SDL will use it when required. Should this not be desired, this hint can
323 * force the use of the 40 byte header version which is supported everywhere.
324 *
325 * The variable can be set to the following values:
326 * "0" - Surfaces with a colorkey or an alpha channel are saved to a
327 * 32-bit BMP file with an alpha mask. SDL will use the bitmap
328 * header version 4 and set the alpha mask accordingly.
329 * "1" - Surfaces with a colorkey or an alpha channel are saved to a
330 * 32-bit BMP file without an alpha mask. The alpha channel data
331 * will be in the file, but applications are going to ignore it.
332 *
333 * The default value is "0".
334 */
335#define SDL_HINT_BMP_SAVE_LEGACY_FORMAT "SDL_BMP_SAVE_LEGACY_FORMAT"
336
337/**
338 * \brief Override for SDL_GetDisplayUsableBounds()
339 *
340 * If set, this hint will override the expected results for
341 * SDL_GetDisplayUsableBounds() for display index 0. Generally you don't want
342 * to do this, but this allows an embedded system to request that some of the
343 * screen be reserved for other uses when paired with a well-behaved
344 * application.
345 *
346 * The contents of this hint must be 4 comma-separated integers, the first
347 * is the bounds x, then y, width and height, in that order.
348 */
349#define SDL_HINT_DISPLAY_USABLE_BOUNDS "SDL_DISPLAY_USABLE_BOUNDS"
350
351/**
352 * \brief Disable giving back control to the browser automatically
353 * when running with asyncify
354 *
355 * With -s ASYNCIFY, SDL calls emscripten_sleep during operations
356 * such as refreshing the screen or polling events.
357 *
358 * This hint only applies to the emscripten platform
359 *
360 * The variable can be set to the following values:
361 * "0" - Disable emscripten_sleep calls (if you give back browser control manually or use asyncify for other purposes)
362 * "1" - Enable emscripten_sleep calls (the default)
363 */
364#define SDL_HINT_EMSCRIPTEN_ASYNCIFY "SDL_EMSCRIPTEN_ASYNCIFY"
365
366/**
367 * \brief Specify the CSS selector used for the "default" window/canvas
368 *
369 * This hint only applies to the emscripten platform
370 *
371 * The default value is "#canvas"
372 */
373#define SDL_HINT_EMSCRIPTEN_CANVAS_SELECTOR "SDL_EMSCRIPTEN_CANVAS_SELECTOR"
374
375/**
376 * \brief override the binding element for keyboard inputs for Emscripten builds
377 *
378 * This hint only applies to the emscripten platform
379 *
380 * The variable can be one of
381 * "#window" - The javascript window object (this is the default)
382 * "#document" - The javascript document object
383 * "#screen" - the javascript window.screen object
384 * "#canvas" - the WebGL canvas element
385 * any other string without a leading # sign applies to the element on the page with that ID.
386 */
387#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT"
388
389/**
390 * \brief A variable that controls whether Steam Controllers should be exposed using the SDL joystick and game controller APIs
391 *
392 * The variable can be set to the following values:
393 * "0" - Do not scan for Steam Controllers
394 * "1" - Scan for Steam Controllers (the default)
395 *
396 * The default value is "1". This hint must be set before initializing the joystick subsystem.
397 */
398#define SDL_HINT_ENABLE_STEAM_CONTROLLERS "SDL_ENABLE_STEAM_CONTROLLERS"
399
400/**
401 * \brief A variable controlling verbosity of the logging of SDL events pushed onto the internal queue.
402 *
403 * This variable can be set to the following values, from least to most verbose:
404 *
405 * "0" - Don't log any events (default)
406 * "1" - Log most events (other than the really spammy ones).
407 * "2" - Include mouse and finger motion events.
408 * "3" - Include SDL_SysWMEvent events.
409 *
410 * This is generally meant to be used to debug SDL itself, but can be useful
411 * for application developers that need better visibility into what is going
412 * on in the event queue. Logged events are sent through SDL_Log(), which
413 * means by default they appear on stdout on most platforms or maybe
414 * OutputDebugString() on Windows, and can be funneled by the app with
415 * SDL_LogSetOutputFunction(), etc.
416 *
417 * This hint can be toggled on and off at runtime, if you only need to log
418 * events for a small subset of program execution.
419 */
420#define SDL_HINT_EVENT_LOGGING "SDL_EVENT_LOGGING"
421
422/**
423 * \brief A variable controlling whether raising the window should be done more forcefully
424 *
425 * This variable can be set to the following values:
426 * "0" - No forcing (the default)
427 * "1" - Extra level of forcing
428 *
429 * At present, this is only an issue under MS Windows, which makes it nearly impossible to
430 * programmatically move a window to the foreground, for "security" reasons. See
431 * http://stackoverflow.com/a/34414846 for a discussion.
432 */
433#define SDL_HINT_FORCE_RAISEWINDOW "SDL_HINT_FORCE_RAISEWINDOW"
434
435/**
436 * \brief A variable controlling how 3D acceleration is used to accelerate the SDL screen surface.
437 *
438 * SDL can try to accelerate the SDL screen surface by using streaming
439 * textures with a 3D rendering engine. This variable controls whether and
440 * how this is done.
441 *
442 * This variable can be set to the following values:
443 * "0" - Disable 3D acceleration
444 * "1" - Enable 3D acceleration, using the default renderer.
445 * "X" - Enable 3D acceleration, using X where X is one of the valid rendering drivers. (e.g. "direct3d", "opengl", etc.)
446 *
447 * By default SDL tries to make a best guess for each platform whether
448 * to use acceleration or not.
449 */
450#define SDL_HINT_FRAMEBUFFER_ACCELERATION "SDL_FRAMEBUFFER_ACCELERATION"
451
452/**
453 * \brief A variable that lets you manually hint extra gamecontroller db entries.
454 *
455 * The variable should be newline delimited rows of gamecontroller config data, see SDL_gamepad.h
456 *
457 * This hint must be set before calling SDL_Init(SDL_INIT_GAMEPAD)
458 * You can update mappings after the system is initialized with SDL_GetGamepadMappingForGUID() and SDL_AddGamepadMapping()
459 */
460#define SDL_HINT_GAMECONTROLLERCONFIG "SDL_GAMECONTROLLERCONFIG"
461
462/**
463 * \brief A variable that lets you provide a file with extra gamecontroller db entries.
464 *
465 * The file should contain lines of gamecontroller config data, see SDL_gamepad.h
466 *
467 * This hint must be set before calling SDL_Init(SDL_INIT_GAMEPAD)
468 * You can update mappings after the system is initialized with SDL_GetGamepadMappingForGUID() and SDL_AddGamepadMapping()
469 */
470#define SDL_HINT_GAMECONTROLLERCONFIG_FILE "SDL_GAMECONTROLLERCONFIG_FILE"
471
472/**
473 * \brief A variable that overrides the automatic controller type detection
474 *
475 * The variable should be comma separated entries, in the form: VID/PID=type
476 *
477 * The VID and PID should be hexadecimal with exactly 4 digits, e.g. 0x00fd
478 *
479 * The type should be one of:
480 * Xbox360
481 * XboxOne
482 * PS3
483 * PS4
484 * PS5
485 * SwitchPro
486 *
487 * This hint affects what driver is used, and must be set before calling SDL_Init(SDL_INIT_GAMEPAD)
488 */
489#define SDL_HINT_GAMECONTROLLERTYPE "SDL_GAMECONTROLLERTYPE"
490
491/**
492 * \brief A variable containing a list of devices to skip when scanning for game controllers.
493 *
494 * The format of the string is a comma separated list of USB VID/PID pairs
495 * in hexadecimal form, e.g.
496 *
497 * 0xAAAA/0xBBBB,0xCCCC/0xDDDD
498 *
499 * The variable can also take the form of @file, in which case the named
500 * file will be loaded and interpreted as the value of the variable.
501 */
502#define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES "SDL_GAMECONTROLLER_IGNORE_DEVICES"
503
504/**
505 * \brief If set, all devices will be skipped when scanning for game controllers except for the ones listed in this variable.
506 *
507 * The format of the string is a comma separated list of USB VID/PID pairs
508 * in hexadecimal form, e.g.
509 *
510 * 0xAAAA/0xBBBB,0xCCCC/0xDDDD
511 *
512 * The variable can also take the form of @file, in which case the named
513 * file will be loaded and interpreted as the value of the variable.
514 */
515#define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT "SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT"
516
517/**
518 * \brief If set, game controller face buttons report their values according to their labels instead of their positional layout.
519 *
520 * For example, on Nintendo Switch controllers, normally you'd get:
521 *
522 * (Y)
523 * (X) (B)
524 * (A)
525 *
526 * but if this hint is set, you'll get:
527 *
528 * (X)
529 * (Y) (A)
530 * (B)
531 *
532 * The variable can be set to the following values:
533 * "0" - Report the face buttons by position, as though they were on an Xbox controller.
534 * "1" - Report the face buttons by label instead of position
535 *
536 * The default value is "1". This hint may be set at any time.
537 */
538#define SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS "SDL_GAMECONTROLLER_USE_BUTTON_LABELS"
539
540/**
541 * \brief A variable controlling whether grabbing input grabs the keyboard
542 *
543 * This variable can be set to the following values:
544 * "0" - Grab will affect only the mouse
545 * "1" - Grab will affect mouse and keyboard
546 *
547 * By default SDL will not grab the keyboard so system shortcuts still work.
548 */
549#define SDL_HINT_GRAB_KEYBOARD "SDL_GRAB_KEYBOARD"
550
551/**
552 * \brief A variable containing a list of devices to ignore in SDL_hid_enumerate()
553 *
554 * For example, to ignore the Shanwan DS3 controller and any Valve controller, you might
555 * have the string "0x2563/0x0523,0x28de/0x0000"
556 */
557#define SDL_HINT_HIDAPI_IGNORE_DEVICES "SDL_HIDAPI_IGNORE_DEVICES"
558
559/**
560 * \brief A variable to control whether certain IMEs should handle text editing internally instead of sending SDL_EVENT_TEXT_EDITING events.
561 *
562 * The variable can be set to the following values:
563 * "0" - SDL_EVENT_TEXT_EDITING events are sent, and it is the application's
564 * responsibility to render the text from these events and
565 * differentiate it somehow from committed text. (default)
566 * "1" - If supported by the IME then SDL_EVENT_TEXT_EDITING events are not sent,
567 * and text that is being composed will be rendered in its own UI.
568 */
569#define SDL_HINT_IME_INTERNAL_EDITING "SDL_IME_INTERNAL_EDITING"
570
571/**
572 * \brief A variable to control whether certain IMEs should show native UI components (such as the Candidate List) instead of suppressing them.
573 *
574 * The variable can be set to the following values:
575 * "0" - Native UI components are not display. (default)
576 * "1" - Native UI components are displayed.
577 */
578#define SDL_HINT_IME_SHOW_UI "SDL_IME_SHOW_UI"
579
580/**
581 * \brief A variable to control if extended IME text support is enabled.
582 * If enabled then SDL_TextEditingExtEvent will be issued if the text would be truncated otherwise.
583 * Additionally SDL_TextInputEvent will be dispatched multiple times so that it is not truncated.
584 *
585 * The variable can be set to the following values:
586 * "0" - Legacy behavior. Text can be truncated, no heap allocations. (default)
587 * "1" - Modern behavior.
588 */
589#define SDL_HINT_IME_SUPPORT_EXTENDED_TEXT "SDL_IME_SUPPORT_EXTENDED_TEXT"
590
591/**
592 * \brief A variable controlling whether the home indicator bar on iPhone X
593 * should be hidden.
594 *
595 * This variable can be set to the following values:
596 * "0" - The indicator bar is not hidden (default for windowed applications)
597 * "1" - The indicator bar is hidden and is shown when the screen is touched (useful for movie playback applications)
598 * "2" - The indicator bar is dim and the first swipe makes it visible and the second swipe performs the "home" action (default for fullscreen applications)
599 */
600#define SDL_HINT_IOS_HIDE_HOME_INDICATOR "SDL_IOS_HIDE_HOME_INDICATOR"
601
602/**
603 * \brief A variable that lets you enable joystick (and gamecontroller) events even when your app is in the background.
604 *
605 * The variable can be set to the following values:
606 * "0" - Disable joystick & gamecontroller input events when the
607 * application is in the background.
608 * "1" - Enable joystick & gamecontroller input events when the
609 * application is in the background.
610 *
611 * The default value is "0". This hint may be set at any time.
612 */
613#define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS"
614
615/**
616 * \brief A variable controlling whether the HIDAPI joystick drivers should be used.
617 *
618 * This variable can be set to the following values:
619 * "0" - HIDAPI drivers are not used
620 * "1" - HIDAPI drivers are used (the default)
621 *
622 * This variable is the default for all drivers, but can be overridden by the hints for specific drivers below.
623 */
624#define SDL_HINT_JOYSTICK_HIDAPI "SDL_JOYSTICK_HIDAPI"
625
626/**
627 * \brief A variable controlling whether the HIDAPI driver for Nintendo GameCube controllers should be used.
628 *
629 * This variable can be set to the following values:
630 * "0" - HIDAPI driver is not used
631 * "1" - HIDAPI driver is used
632 *
633 * The default is the value of SDL_HINT_JOYSTICK_HIDAPI
634 */
635#define SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE "SDL_JOYSTICK_HIDAPI_GAMECUBE"
636
637/**
638 * \brief A variable controlling whether "low_frequency_rumble" and "high_frequency_rumble" is used to implement
639 * the GameCube controller's 3 rumble modes, Stop(0), Rumble(1), and StopHard(2)
640 * this is useful for applications that need full compatibility for things like ADSR envelopes.
641 * Stop is implemented by setting "low_frequency_rumble" to "0" and "high_frequency_rumble" ">0"
642 * Rumble is both at any arbitrary value,
643 * StopHard is implemented by setting both "low_frequency_rumble" and "high_frequency_rumble" to "0"
644 *
645 * This variable can be set to the following values:
646 * "0" - Normal rumble behavior is behavior is used (default)
647 * "1" - Proper GameCube controller rumble behavior is used
648 *
649 */
650#define SDL_HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE "SDL_JOYSTICK_GAMECUBE_RUMBLE_BRAKE"
651
652/**
653 * \brief A variable controlling whether the HIDAPI driver for Nintendo Switch Joy-Cons should be used.
654 *
655 * This variable can be set to the following values:
656 * "0" - HIDAPI driver is not used
657 * "1" - HIDAPI driver is used
658 *
659 * The default is the value of SDL_HINT_JOYSTICK_HIDAPI
660 */
661#define SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS "SDL_JOYSTICK_HIDAPI_JOY_CONS"
662
663/**
664 * \brief A variable controlling whether Nintendo Switch Joy-Con controllers will be combined into a single Pro-like controller when using the HIDAPI driver
665 *
666 * This variable can be set to the following values:
667 * "0" - Left and right Joy-Con controllers will not be combined and each will be a mini-gamepad
668 * "1" - Left and right Joy-Con controllers will be combined into a single controller (the default)
669 */
670#define SDL_HINT_JOYSTICK_HIDAPI_COMBINE_JOY_CONS "SDL_JOYSTICK_HIDAPI_COMBINE_JOY_CONS"
671
672/**
673 * \brief A variable controlling whether Nintendo Switch Joy-Con controllers will be in vertical mode when using the HIDAPI driver
674 *
675 * This variable can be set to the following values:
676 * "0" - Left and right Joy-Con controllers will not be in vertical mode (the default)
677 * "1" - Left and right Joy-Con controllers will be in vertical mode
678 *
679 * This hint must be set before calling SDL_Init(SDL_INIT_GAMEPAD)
680 */
681#define SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS "SDL_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS"
682
683/**
684 * \brief A variable controlling whether the HIDAPI driver for Amazon Luna controllers connected via Bluetooth should be used.
685 *
686 * This variable can be set to the following values:
687 * "0" - HIDAPI driver is not used
688 * "1" - HIDAPI driver is used
689 *
690 * The default is the value of SDL_HINT_JOYSTICK_HIDAPI
691 */
692#define SDL_HINT_JOYSTICK_HIDAPI_LUNA "SDL_JOYSTICK_HIDAPI_LUNA"
693
694/**
695 * \brief A variable controlling whether the HIDAPI driver for Nintendo Online classic controllers should be used.
696 *
697 * This variable can be set to the following values:
698 * "0" - HIDAPI driver is not used
699 * "1" - HIDAPI driver is used
700 *
701 * The default is the value of SDL_HINT_JOYSTICK_HIDAPI
702 */
703#define SDL_HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC "SDL_JOYSTICK_HIDAPI_NINTENDO_CLASSIC"
704
705/**
706 * \brief A variable controlling whether the HIDAPI driver for NVIDIA SHIELD controllers should be used.
707 *
708 * This variable can be set to the following values:
709 * "0" - HIDAPI driver is not used
710 * "1" - HIDAPI driver is used
711 *
712 * The default is the value of SDL_HINT_JOYSTICK_HIDAPI
713 */
714#define SDL_HINT_JOYSTICK_HIDAPI_SHIELD "SDL_JOYSTICK_HIDAPI_SHIELD"
715
716/**
717 * \brief A variable controlling whether the HIDAPI driver for PS3 controllers should be used.
718 *
719 * This variable can be set to the following values:
720 * "0" - HIDAPI driver is not used
721 * "1" - HIDAPI driver is used
722 *
723 * The default is the value of SDL_HINT_JOYSTICK_HIDAPI on macOS, and "0" on other platforms.
724 *
725 * It is not possible to use this driver on Windows, due to limitations in the default drivers
726 * installed. See https://github.com/ViGEm/DsHidMini for an alternative driver on Windows.
727 */
728#define SDL_HINT_JOYSTICK_HIDAPI_PS3 "SDL_JOYSTICK_HIDAPI_PS3"
729
730/**
731 * \brief A variable controlling whether the HIDAPI driver for PS4 controllers should be used.
732 *
733 * This variable can be set to the following values:
734 * "0" - HIDAPI driver is not used
735 * "1" - HIDAPI driver is used
736 *
737 * The default is the value of SDL_HINT_JOYSTICK_HIDAPI
738 */
739#define SDL_HINT_JOYSTICK_HIDAPI_PS4 "SDL_JOYSTICK_HIDAPI_PS4"
740
741/**
742 * \brief A variable controlling whether extended input reports should be used for PS4 controllers when using the HIDAPI driver.
743 *
744 * This variable can be set to the following values:
745 * "0" - extended reports are not enabled (the default)
746 * "1" - extended reports
747 *
748 * Extended input reports allow rumble on Bluetooth PS4 controllers, but
749 * break DirectInput handling for applications that don't use SDL.
750 *
751 * Once extended reports are enabled, they can not be disabled without
752 * power cycling the controller.
753 *
754 * For compatibility with applications written for versions of SDL prior
755 * to the introduction of PS5 controller support, this value will also
756 * control the state of extended reports on PS5 controllers when the
757 * SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE hint is not explicitly set.
758 */
759#define SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE "SDL_JOYSTICK_HIDAPI_PS4_RUMBLE"
760
761/**
762 * \brief A variable controlling whether the HIDAPI driver for PS5 controllers should be used.
763 *
764 * This variable can be set to the following values:
765 * "0" - HIDAPI driver is not used
766 * "1" - HIDAPI driver is used
767 *
768 * The default is the value of SDL_HINT_JOYSTICK_HIDAPI
769 */
770#define SDL_HINT_JOYSTICK_HIDAPI_PS5 "SDL_JOYSTICK_HIDAPI_PS5"
771
772/**
773 * \brief A variable controlling whether the player LEDs should be lit to indicate which player is associated with a PS5 controller.
774 *
775 * This variable can be set to the following values:
776 * "0" - player LEDs are not enabled
777 * "1" - player LEDs are enabled (the default)
778 */
779#define SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED "SDL_JOYSTICK_HIDAPI_PS5_PLAYER_LED"
780
781/**
782 * \brief A variable controlling whether extended input reports should be used for PS5 controllers when using the HIDAPI driver.
783 *
784 * This variable can be set to the following values:
785 * "0" - extended reports are not enabled (the default)
786 * "1" - extended reports
787 *
788 * Extended input reports allow rumble on Bluetooth PS5 controllers, but
789 * break DirectInput handling for applications that don't use SDL.
790 *
791 * Once extended reports are enabled, they can not be disabled without
792 * power cycling the controller.
793 *
794 * For compatibility with applications written for versions of SDL prior
795 * to the introduction of PS5 controller support, this value defaults to
796 * the value of SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE.
797 */
798#define SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE "SDL_JOYSTICK_HIDAPI_PS5_RUMBLE"
799
800/**
801 * \brief A variable controlling whether the HIDAPI driver for Google Stadia controllers should be used.
802 *
803 * This variable can be set to the following values:
804 * "0" - HIDAPI driver is not used
805 * "1" - HIDAPI driver is used
806 *
807 * The default is the value of SDL_HINT_JOYSTICK_HIDAPI
808 */
809#define SDL_HINT_JOYSTICK_HIDAPI_STADIA "SDL_JOYSTICK_HIDAPI_STADIA"
810
811/**
812 * \brief A variable controlling whether the HIDAPI driver for Bluetooth Steam Controllers should be used.
813 *
814 * This variable can be set to the following values:
815 * "0" - HIDAPI driver is not used
816 * "1" - HIDAPI driver is used for Steam Controllers, which requires Bluetooth access
817 * and may prompt the user for permission on iOS and Android.
818 *
819 * The default is "0"
820 */
821#define SDL_HINT_JOYSTICK_HIDAPI_STEAM "SDL_JOYSTICK_HIDAPI_STEAM"
822
823/**
824 * \brief A variable controlling whether the HIDAPI driver for Nintendo Switch controllers should be used.
825 *
826 * This variable can be set to the following values:
827 * "0" - HIDAPI driver is not used
828 * "1" - HIDAPI driver is used
829 *
830 * The default is the value of SDL_HINT_JOYSTICK_HIDAPI
831 */
832#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH "SDL_JOYSTICK_HIDAPI_SWITCH"
833
834/**
835 * \brief A variable controlling whether the Home button LED should be turned on when a Nintendo Switch Pro controller is opened
836 *
837 * This variable can be set to the following values:
838 * "0" - home button LED is turned off
839 * "1" - home button LED is turned on
840 *
841 * By default the Home button LED state is not changed. This hint can also be set to a floating point value between 0.0 and 1.0 which controls the brightness of the Home button LED.
842 */
843#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED "SDL_JOYSTICK_HIDAPI_SWITCH_HOME_LED"
844
845/**
846 * \brief A variable controlling whether the Home button LED should be turned on when a Nintendo Switch Joy-Con controller is opened
847 *
848 * This variable can be set to the following values:
849 * "0" - home button LED is turned off
850 * "1" - home button LED is turned on
851 *
852 * By default the Home button LED state is not changed. This hint can also be set to a floating point value between 0.0 and 1.0 which controls the brightness of the Home button LED.
853 */
854#define SDL_HINT_JOYSTICK_HIDAPI_JOYCON_HOME_LED "SDL_JOYSTICK_HIDAPI_JOYCON_HOME_LED"
855
856/**
857 * \brief A variable controlling whether the player LEDs should be lit to indicate which player is associated with a Nintendo Switch controller.
858 *
859 * This variable can be set to the following values:
860 * "0" - player LEDs are not enabled
861 * "1" - player LEDs are enabled (the default)
862 */
863#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED "SDL_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED"
864
865/**
866 * \brief A variable controlling whether the HIDAPI driver for Nintendo Wii and Wii U controllers should be used.
867 *
868 * This variable can be set to the following values:
869 * "0" - HIDAPI driver is not used
870 * "1" - HIDAPI driver is used
871 *
872 * This driver doesn't work with the dolphinbar, so the default is SDL_FALSE for now.
873 */
874#define SDL_HINT_JOYSTICK_HIDAPI_WII "SDL_JOYSTICK_HIDAPI_WII"
875
876/**
877 * \brief A variable controlling whether the player LEDs should be lit to indicate which player is associated with a Wii controller.
878 *
879 * This variable can be set to the following values:
880 * "0" - player LEDs are not enabled
881 * "1" - player LEDs are enabled (the default)
882 */
883#define SDL_HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED "SDL_JOYSTICK_HIDAPI_WII_PLAYER_LED"
884
885/**
886 * \brief A variable controlling whether the HIDAPI driver for XBox controllers should be used.
887 *
888 * This variable can be set to the following values:
889 * "0" - HIDAPI driver is not used
890 * "1" - HIDAPI driver is used
891 *
892 * The default is "0" on Windows, otherwise the value of SDL_HINT_JOYSTICK_HIDAPI
893 */
894#define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX"
895
896/**
897 * \brief A variable controlling whether the HIDAPI driver for XBox 360 controllers should be used.
898 *
899 * This variable can be set to the following values:
900 * "0" - HIDAPI driver is not used
901 * "1" - HIDAPI driver is used
902 *
903 * The default is the value of SDL_HINT_JOYSTICK_HIDAPI_XBOX
904 */
905#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 "SDL_JOYSTICK_HIDAPI_XBOX_360"
906
907/**
908 * \brief A variable controlling whether the player LEDs should be lit to indicate which player is associated with an Xbox 360 controller.
909 *
910 * This variable can be set to the following values:
911 * "0" - player LEDs are not enabled
912 * "1" - player LEDs are enabled (the default)
913 */
914#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED "SDL_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED"
915
916/**
917 * \brief A variable controlling whether the HIDAPI driver for XBox 360 wireless controllers should be used.
918 *
919 * This variable can be set to the following values:
920 * "0" - HIDAPI driver is not used
921 * "1" - HIDAPI driver is used
922 *
923 * The default is the value of SDL_HINT_JOYSTICK_HIDAPI_XBOX_360
924 */
925#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS "SDL_JOYSTICK_HIDAPI_XBOX_360_WIRELESS"
926
927/**
928 * \brief A variable controlling whether the HIDAPI driver for XBox One controllers should be used.
929 *
930 * This variable can be set to the following values:
931 * "0" - HIDAPI driver is not used
932 * "1" - HIDAPI driver is used
933 *
934 * The default is the value of SDL_HINT_JOYSTICK_HIDAPI_XBOX
935 */
936#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE "SDL_JOYSTICK_HIDAPI_XBOX_ONE"
937
938/**
939 * \brief A variable controlling whether the Home button LED should be turned on when an Xbox One controller is opened
940 *
941 * This variable can be set to the following values:
942 * "0" - home button LED is turned off
943 * "1" - home button LED is turned on
944 *
945 * By default the Home button LED state is not changed. This hint can also be set to a floating point value between 0.0 and 1.0 which controls the brightness of the Home button LED. The default brightness is 0.4.
946 */
947#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED "SDL_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED"
948
949/**
950 * \brief A variable controlling whether the RAWINPUT joystick drivers should be used for better handling XInput-capable devices.
951 *
952 * This variable can be set to the following values:
953 * "0" - RAWINPUT drivers are not used
954 * "1" - RAWINPUT drivers are used (the default)
955 */
956#define SDL_HINT_JOYSTICK_RAWINPUT "SDL_JOYSTICK_RAWINPUT"
957
958/**
959 * \brief A variable controlling whether the RAWINPUT driver should pull correlated data from XInput.
960 *
961 * This variable can be set to the following values:
962 * "0" - RAWINPUT driver will only use data from raw input APIs
963 * "1" - RAWINPUT driver will also pull data from XInput, providing
964 * better trigger axes, guide button presses, and rumble support
965 * for Xbox controllers
966 *
967 * The default is "1". This hint applies to any joysticks opened after setting the hint.
968 */
969#define SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT "SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT"
970
971/**
972 * \brief A variable controlling whether the ROG Chakram mice should show up as joysticks
973 *
974 * This variable can be set to the following values:
975 * "0" - ROG Chakram mice do not show up as joysticks (the default)
976 * "1" - ROG Chakram mice show up as joysticks
977 */
978#define SDL_HINT_JOYSTICK_ROG_CHAKRAM "SDL_JOYSTICK_ROG_CHAKRAM"
979
980/**
981 * \brief A variable controlling whether a separate thread should be used
982 * for handling joystick detection and raw input messages on Windows
983 *
984 * This variable can be set to the following values:
985 * "0" - A separate thread is not used (the default)
986 * "1" - A separate thread is used for handling raw input messages
987 *
988 */
989#define SDL_HINT_JOYSTICK_THREAD "SDL_JOYSTICK_THREAD"
990
991/**
992 * \brief Determines whether SDL enforces that DRM master is required in order
993 * to initialize the KMSDRM video backend.
994 *
995 * The DRM subsystem has a concept of a "DRM master" which is a DRM client that
996 * has the ability to set planes, set cursor, etc. When SDL is DRM master, it
997 * can draw to the screen using the SDL rendering APIs. Without DRM master, SDL
998 * is still able to process input and query attributes of attached displays,
999 * but it cannot change display state or draw to the screen directly.
1000 *
1001 * In some cases, it can be useful to have the KMSDRM backend even if it cannot
1002 * be used for rendering. An app may want to use SDL for input processing while
1003 * using another rendering API (such as an MMAL overlay on Raspberry Pi) or
1004 * using its own code to render to DRM overlays that SDL doesn't support.
1005 *
1006 * This hint must be set before initializing the video subsystem.
1007 *
1008 * This variable can be set to the following values:
1009 * "0" - SDL will allow usage of the KMSDRM backend without DRM master
1010 * "1" - SDL Will require DRM master to use the KMSDRM backend (default)
1011 */
1012#define SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER "SDL_KMSDRM_REQUIRE_DRM_MASTER"
1013
1014/**
1015 * \brief A comma separated list of devices to open as joysticks
1016 *
1017 * This variable is currently only used by the Linux joystick driver.
1018 */
1019#define SDL_HINT_JOYSTICK_DEVICE "SDL_JOYSTICK_DEVICE"
1020
1021/**
1022 * \brief 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.
1023 *
1024 * This variable can be set to the following values:
1025 * "0" - Only map hat axis inputs to digital hat outputs if the input axes appear to actually be digital (the default)
1026 * "1" - Always handle the input axes numbered ABS_HAT0X to ABS_HAT3Y as digital hats
1027 */
1028#define SDL_HINT_LINUX_DIGITAL_HATS "SDL_LINUX_DIGITAL_HATS"
1029
1030/**
1031 * \brief A variable controlling whether digital hats on Linux will apply deadzones to their underlying input axes or use unfiltered values.
1032 *
1033 * This variable can be set to the following values:
1034 * "0" - Return digital hat values based on unfiltered input axis values
1035 * "1" - Return digital hat values with deadzones on the input axes taken into account (the default)
1036 */
1037#define SDL_HINT_LINUX_HAT_DEADZONES "SDL_LINUX_HAT_DEADZONES"
1038
1039/**
1040 * \brief A variable controlling whether to use the classic /dev/input/js* joystick interface or the newer /dev/input/event* joystick interface on Linux
1041 *
1042 * This variable can be set to the following values:
1043 * "0" - Use /dev/input/event*
1044 * "1" - Use /dev/input/js*
1045 *
1046 * By default the /dev/input/event* interfaces are used
1047 */
1048#define SDL_HINT_LINUX_JOYSTICK_CLASSIC "SDL_LINUX_JOYSTICK_CLASSIC"
1049
1050/**
1051 * \brief A variable controlling whether joysticks on Linux adhere to their HID-defined deadzones or return unfiltered values.
1052 *
1053 * This variable can be set to the following values:
1054 * "0" - Return unfiltered joystick axis values (the default)
1055 * "1" - Return axis values with deadzones taken into account
1056 */
1057#define SDL_HINT_LINUX_JOYSTICK_DEADZONES "SDL_LINUX_JOYSTICK_DEADZONES"
1058
1059/**
1060* \brief When set don't force the SDL app to become a foreground process
1061*
1062* This hint only applies to macOS.
1063*
1064*/
1065#define SDL_HINT_MAC_BACKGROUND_APP "SDL_MAC_BACKGROUND_APP"
1066
1067/**
1068 * \brief A variable that determines whether ctrl+click should generate a right-click event on Mac
1069 *
1070 * If present, holding ctrl while left clicking will generate a right click
1071 * event when on Mac.
1072 */
1073#define SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK "SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK"
1074
1075/**
1076 * \brief A variable controlling whether dispatching OpenGL context updates should block the dispatching thread until the main thread finishes processing
1077 *
1078 * This variable can be set to the following values:
1079 * "0" - Dispatching OpenGL context updates will block the dispatching thread until the main thread finishes processing (default).
1080 * "1" - Dispatching OpenGL context updates will allow the dispatching thread to continue execution.
1081 *
1082 * Generally you want the default, but if you have OpenGL code in a background thread on a Mac, and the main thread
1083 * hangs because it's waiting for that background thread, but that background thread is also hanging because it's
1084 * waiting for the main thread to do an update, this might fix your issue.
1085 *
1086 * This hint only applies to macOS.
1087 *
1088 * This hint is available since SDL 2.24.0.
1089 *
1090 */
1091#define SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH "SDL_MAC_OPENGL_ASYNC_DISPATCH"
1092
1093/**
1094 * \brief A variable setting the double click radius, in pixels.
1095 */
1096#define SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS "SDL_MOUSE_DOUBLE_CLICK_RADIUS"
1097
1098/**
1099 * \brief A variable setting the double click time, in milliseconds.
1100 */
1101#define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME "SDL_MOUSE_DOUBLE_CLICK_TIME"
1102
1103/**
1104 * \brief Allow mouse click events when clicking to focus an SDL window
1105 *
1106 * This variable can be set to the following values:
1107 * "0" - Ignore mouse clicks that activate a window
1108 * "1" - Generate events for mouse clicks that activate a window
1109 *
1110 * By default SDL will ignore mouse clicks that activate a window
1111 */
1112#define SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH "SDL_MOUSE_FOCUS_CLICKTHROUGH"
1113
1114/**
1115 * \brief A variable setting the speed scale for mouse motion, in floating point, when the mouse is not in relative mode
1116 */
1117#define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE "SDL_MOUSE_NORMAL_SPEED_SCALE"
1118
1119/**
1120 * \brief A variable controlling whether relative mouse mode constrains the mouse to the center of the window
1121 *
1122 * This variable can be set to the following values:
1123 * "0" - Relative mouse mode constrains the mouse to the window
1124 * "1" - Relative mouse mode constrains the mouse to the center of the window
1125 *
1126 * Constraining to the center of the window works better for FPS games and when the
1127 * application is running over RDP. Constraining to the whole window works better
1128 * for 2D games and increases the chance that the mouse will be in the correct
1129 * position when using high DPI mice.
1130 *
1131 * By default SDL will constrain the mouse to the center of the window
1132 */
1133#define SDL_HINT_MOUSE_RELATIVE_MODE_CENTER "SDL_MOUSE_RELATIVE_MODE_CENTER"
1134
1135/**
1136 * \brief A variable controlling whether relative mouse mode is implemented using mouse warping
1137 *
1138 * This variable can be set to the following values:
1139 * "0" - Relative mouse mode uses raw input
1140 * "1" - Relative mouse mode uses mouse warping
1141 *
1142 * By default SDL will use raw input for relative mouse mode
1143 */
1144#define SDL_HINT_MOUSE_RELATIVE_MODE_WARP "SDL_MOUSE_RELATIVE_MODE_WARP"
1145
1146/**
1147 * \brief A variable setting the scale for mouse motion, in floating point, when the mouse is in relative mode
1148 */
1149#define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE "SDL_MOUSE_RELATIVE_SPEED_SCALE"
1150
1151/**
1152 * \brief A variable controlling whether the system mouse acceleration curve is used for relative mouse motion.
1153 *
1154 * This variable can be set to the following values:
1155 * "0" - Relative mouse motion will be unscaled (the default)
1156 * "1" - Relative mouse motion will be scaled using the system mouse acceleration curve.
1157 *
1158 * If SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE is set, that will override the system speed scale.
1159 */
1160#define SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE "SDL_MOUSE_RELATIVE_SYSTEM_SCALE"
1161
1162/**
1163 * \brief A variable controlling whether a motion event should be generated for mouse warping in relative mode.
1164 *
1165 * This variable can be set to the following values:
1166 * "0" - Warping the mouse will not generate a motion event in relative mode
1167 * "1" - Warping the mouse will generate a motion event in relative mode
1168 *
1169 * By default warping the mouse will not generate motion events in relative mode. This avoids the application having to filter out large relative motion due to warping.
1170 */
1171#define SDL_HINT_MOUSE_RELATIVE_WARP_MOTION "SDL_MOUSE_RELATIVE_WARP_MOTION"
1172
1173/**
1174 * \brief A variable controlling whether mouse events should generate synthetic touch events
1175 *
1176 * This variable can be set to the following values:
1177 * "0" - Mouse events will not generate touch events (default for desktop platforms)
1178 * "1" - Mouse events will generate touch events (default for mobile platforms, such as Android and iOS)
1179 */
1180#define SDL_HINT_MOUSE_TOUCH_EVENTS "SDL_MOUSE_TOUCH_EVENTS"
1181
1182/**
1183 * \brief A variable controlling whether the mouse is captured while mouse buttons are pressed
1184 *
1185 * This variable can be set to the following values:
1186 * "0" - The mouse is not captured while mouse buttons are pressed
1187 * "1" - The mouse is captured while mouse buttons are pressed
1188 *
1189 * By default the mouse is captured while mouse buttons are pressed so if the mouse is dragged
1190 * outside the window, the application continues to receive mouse events until the button is
1191 * released.
1192 */
1193#define SDL_HINT_MOUSE_AUTO_CAPTURE "SDL_MOUSE_AUTO_CAPTURE"
1194
1195/**
1196 * \brief Tell SDL not to catch the SIGINT or SIGTERM signals.
1197 *
1198 * This hint only applies to Unix-like platforms, and should set before
1199 * any calls to SDL_Init()
1200 *
1201 * The variable can be set to the following values:
1202 * "0" - SDL will install a SIGINT and SIGTERM handler, and when it
1203 * catches a signal, convert it into an SDL_EVENT_QUIT event.
1204 * "1" - SDL will not install a signal handler at all.
1205 */
1206#define SDL_HINT_NO_SIGNAL_HANDLERS "SDL_NO_SIGNAL_HANDLERS"
1207
1208/**
1209 * \brief A variable controlling what driver to use for OpenGL ES contexts.
1210 *
1211 * On some platforms, currently Windows and X11, OpenGL drivers may support
1212 * creating contexts with an OpenGL ES profile. By default SDL uses these
1213 * profiles, when available, otherwise it attempts to load an OpenGL ES
1214 * library, e.g. that provided by the ANGLE project. This variable controls
1215 * whether SDL follows this default behaviour or will always load an
1216 * OpenGL ES library.
1217 *
1218 * Circumstances where this is useful include
1219 * - Testing an app with a particular OpenGL ES implementation, e.g ANGLE,
1220 * or emulator, e.g. those from ARM, Imagination or Qualcomm.
1221 * - Resolving OpenGL ES function addresses at link time by linking with
1222 * the OpenGL ES library instead of querying them at run time with
1223 * SDL_GL_GetProcAddress().
1224 *
1225 * Caution: for an application to work with the default behaviour across
1226 * different OpenGL drivers it must query the OpenGL ES function
1227 * addresses at run time using SDL_GL_GetProcAddress().
1228 *
1229 * This variable is ignored on most platforms because OpenGL ES is native
1230 * or not supported.
1231 *
1232 * This variable can be set to the following values:
1233 * "0" - Use ES profile of OpenGL, if available. (Default when not set.)
1234 * "1" - Load OpenGL ES library using the default library names.
1235 *
1236 */
1237#define SDL_HINT_OPENGL_ES_DRIVER "SDL_OPENGL_ES_DRIVER"
1238
1239/**
1240 * \brief A variable controlling which orientations are allowed on iOS/Android.
1241 *
1242 * In some circumstances it is necessary to be able to explicitly control
1243 * which UI orientations are allowed.
1244 *
1245 * This variable is a space delimited list of the following values:
1246 * "LandscapeLeft", "LandscapeRight", "Portrait" "PortraitUpsideDown"
1247 */
1248#define SDL_HINT_ORIENTATIONS "SDL_IOS_ORIENTATIONS"
1249
1250/**
1251 * \brief A variable controlling the use of a sentinel event when polling the event queue
1252 *
1253 * This variable can be set to the following values:
1254 * "0" - Disable poll sentinels
1255 * "1" - Enable poll sentinels
1256 *
1257 * When polling for events, SDL_PumpEvents is used to gather new events from devices.
1258 * If a device keeps producing new events between calls to SDL_PumpEvents, a poll loop will
1259 * become stuck until the new events stop.
1260 * This is most noticeable when moving a high frequency mouse.
1261 *
1262 * By default, poll sentinels are enabled.
1263 */
1264#define SDL_HINT_POLL_SENTINEL "SDL_POLL_SENTINEL"
1265
1266/**
1267 * \brief Override for SDL_GetPreferredLocales()
1268 *
1269 * If set, this will be favored over anything the OS might report for the
1270 * user's preferred locales. Changing this hint at runtime will not generate
1271 * a SDL_EVENT_LOCALE_CHANGED event (but if you can change the hint, you can push
1272 * your own event, if you want).
1273 *
1274 * The format of this hint is a comma-separated list of language and locale,
1275 * combined with an underscore, as is a common format: "en_GB". Locale is
1276 * optional: "en". So you might have a list like this: "en_GB,jp,es_PT"
1277 */
1278#define SDL_HINT_PREFERRED_LOCALES "SDL_PREFERRED_LOCALES"
1279
1280/**
1281 * \brief A variable describing the content orientation on QtWayland-based platforms.
1282 *
1283 * On QtWayland platforms, windows are rotated client-side to allow for custom
1284 * transitions. In order to correctly position overlays (e.g. volume bar) and
1285 * gestures (e.g. events view, close/minimize gestures), the system needs to
1286 * know in which orientation the application is currently drawing its contents.
1287 *
1288 * This does not cause the window to be rotated or resized, the application
1289 * needs to take care of drawing the content in the right orientation (the
1290 * framebuffer is always in portrait mode).
1291 *
1292 * This variable can be one of the following values:
1293 * "primary" (default), "portrait", "landscape", "inverted-portrait", "inverted-landscape"
1294 */
1295#define SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION "SDL_QTWAYLAND_CONTENT_ORIENTATION"
1296
1297/**
1298 * \brief Flags to set on QtWayland windows to integrate with the native window manager.
1299 *
1300 * On QtWayland platforms, this hint controls the flags to set on the windows.
1301 * For example, on Sailfish OS "OverridesSystemGestures" disables swipe gestures.
1302 *
1303 * This variable is a space-separated list of the following values (empty = no flags):
1304 * "OverridesSystemGestures", "StaysOnTop", "BypassWindowManager"
1305 */
1306#define SDL_HINT_QTWAYLAND_WINDOW_FLAGS "SDL_QTWAYLAND_WINDOW_FLAGS"
1307
1308/**
1309 * \brief A variable controlling whether the 2D render API is compatible or efficient.
1310 *
1311 * This variable can be set to the following values:
1312 *
1313 * "0" - Don't use batching to make rendering more efficient.
1314 * "1" - Use batching, but might cause problems if app makes its own direct OpenGL calls.
1315 *
1316 * Up to SDL 2.0.9, the render API would draw immediately when requested. Now
1317 * it batches up draw requests and sends them all to the GPU only when forced
1318 * to (during SDL_RenderPresent, when changing render targets, by updating a
1319 * texture that the batch needs, etc). This is significantly more efficient,
1320 * but it can cause problems for apps that expect to render on top of the
1321 * render API's output. As such, SDL will disable batching if a specific
1322 * render backend is requested (since this might indicate that the app is
1323 * planning to use the underlying graphics API directly). This hint can
1324 * be used to explicitly request batching in this instance. It is a contract
1325 * that you will either never use the underlying graphics API directly, or
1326 * if you do, you will call SDL_RenderFlush() before you do so any current
1327 * batch goes to the GPU before your work begins. Not following this contract
1328 * will result in undefined behavior.
1329 */
1330#define SDL_HINT_RENDER_BATCHING "SDL_RENDER_BATCHING"
1331
1332/**
1333 * \brief A variable controlling how the 2D render API renders lines
1334 *
1335 * This variable can be set to the following values:
1336 * "0" - Use the default line drawing method (Bresenham's line algorithm as of SDL 2.0.20)
1337 * "1" - Use the driver point API using Bresenham's line algorithm (correct, draws many points)
1338 * "2" - Use the driver line API (occasionally misses line endpoints based on hardware driver quirks, was the default before 2.0.20)
1339 * "3" - Use the driver geometry API (correct, draws thicker diagonal lines)
1340 *
1341 * This variable should be set when the renderer is created.
1342 */
1343#define SDL_HINT_RENDER_LINE_METHOD "SDL_RENDER_LINE_METHOD"
1344
1345/**
1346 * \brief A variable controlling whether to enable Direct3D 11+'s Debug Layer.
1347 *
1348 * This variable does not have any effect on the Direct3D 9 based renderer.
1349 *
1350 * This variable can be set to the following values:
1351 * "0" - Disable Debug Layer use
1352 * "1" - Enable Debug Layer use
1353 *
1354 * By default, SDL does not use Direct3D Debug Layer.
1355 */
1356#define SDL_HINT_RENDER_DIRECT3D11_DEBUG "SDL_RENDER_DIRECT3D11_DEBUG"
1357
1358/**
1359 * \brief A variable controlling whether the Direct3D device is initialized for thread-safe operations.
1360 *
1361 * This variable can be set to the following values:
1362 * "0" - Thread-safety is not enabled (faster)
1363 * "1" - Thread-safety is enabled
1364 *
1365 * By default the Direct3D device is created with thread-safety disabled.
1366 */
1367#define SDL_HINT_RENDER_DIRECT3D_THREADSAFE "SDL_RENDER_DIRECT3D_THREADSAFE"
1368
1369/**
1370 * \brief A variable specifying which render driver to use.
1371 *
1372 * If the application doesn't pick a specific renderer to use, this variable
1373 * specifies the name of the preferred renderer. If the preferred renderer
1374 * can't be initialized, the normal default renderer is used.
1375 *
1376 * This variable is case insensitive and can be set to the following values:
1377 * "direct3d"
1378 * "direct3d11"
1379 * "direct3d12"
1380 * "opengl"
1381 * "opengles2"
1382 * "opengles"
1383 * "metal"
1384 * "software"
1385 *
1386 * The default varies by platform, but it's the first one in the list that
1387 * is available on the current platform.
1388 */
1389#define SDL_HINT_RENDER_DRIVER "SDL_RENDER_DRIVER"
1390
1391/**
1392 * \brief A variable controlling whether the OpenGL render driver uses shaders if they are available.
1393 *
1394 * This variable can be set to the following values:
1395 * "0" - Disable shaders
1396 * "1" - Enable shaders
1397 *
1398 * By default shaders are used if OpenGL supports them.
1399 */
1400#define SDL_HINT_RENDER_OPENGL_SHADERS "SDL_RENDER_OPENGL_SHADERS"
1401
1402/**
1403 * \brief A variable controlling the scaling quality
1404 *
1405 * This variable can be set to the following values:
1406 * "0" or "nearest" - Nearest pixel sampling
1407 * "1" or "linear" - Linear filtering (supported by OpenGL and Direct3D)
1408 * "2" or "best" - Currently this is the same as "linear"
1409 *
1410 * By default nearest pixel sampling is used
1411 */
1412#define SDL_HINT_RENDER_SCALE_QUALITY "SDL_RENDER_SCALE_QUALITY"
1413
1414/**
1415 * \brief A variable controlling whether updates to the SDL screen surface should be synchronized with the vertical refresh, to avoid tearing.
1416 *
1417 * This variable can be set to the following values:
1418 * "0" - Disable vsync
1419 * "1" - Enable vsync
1420 *
1421 * By default SDL does not sync screen surface updates with vertical refresh.
1422 */
1423#define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC"
1424
1425/**
1426 * \brief A variable controlling if VSYNC is automatically disable if doesn't reach the enough FPS
1427 *
1428 * This variable can be set to the following values:
1429 * "0" - It will be using VSYNC as defined in the main flag. Default
1430 * "1" - If VSYNC was previously enabled, then it will disable VSYNC if doesn't reach enough speed
1431 *
1432 * By default SDL does not enable the automatic VSYNC
1433 */
1434#define SDL_HINT_PS2_DYNAMIC_VSYNC "SDL_PS2_DYNAMIC_VSYNC"
1435
1436/**
1437 * \brief A variable to control whether the return key on the soft keyboard
1438 * should hide the soft keyboard on Android and iOS.
1439 *
1440 * The variable can be set to the following values:
1441 * "0" - The return key will be handled as a key event. This is the behaviour of SDL <= 2.0.3. (default)
1442 * "1" - The return key will hide the keyboard.
1443 *
1444 * The value of this hint is used at runtime, so it can be changed at any time.
1445 */
1446#define SDL_HINT_RETURN_KEY_HIDES_IME "SDL_RETURN_KEY_HIDES_IME"
1447
1448/**
1449 * \brief Tell SDL which Dispmanx layer to use on a Raspberry PI
1450 *
1451 * Also known as Z-order. The variable can take a negative or positive value.
1452 * The default is 10000.
1453 */
1454#define SDL_HINT_RPI_VIDEO_LAYER "SDL_RPI_VIDEO_LAYER"
1455
1456/**
1457 * \brief Specify an "activity name" for screensaver inhibition.
1458 *
1459 * Some platforms, notably Linux desktops, list the applications which are
1460 * inhibiting the screensaver or other power-saving features.
1461 *
1462 * This hint lets you specify the "activity name" sent to the OS when
1463 * SDL_DisableScreenSaver() is used (or the screensaver is automatically
1464 * disabled). The contents of this hint are used when the screensaver is
1465 * disabled. You should use a string that describes what your program is doing
1466 * (and, therefore, why the screensaver is disabled). For example, "Playing a
1467 * game" or "Watching a video".
1468 *
1469 * Setting this to "" or leaving it unset will have SDL use a reasonable
1470 * default: "Playing a game" or something similar.
1471 *
1472 * On targets where this is not supported, this hint does nothing.
1473 */
1474#define SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME "SDL_SCREENSAVER_INHIBIT_ACTIVITY_NAME"
1475
1476/**
1477 * \brief Specifies whether SDL_THREAD_PRIORITY_TIME_CRITICAL should be treated as realtime.
1478 *
1479 * On some platforms, like Linux, a realtime priority thread may be subject to restrictions
1480 * that require special handling by the application. This hint exists to let SDL know that
1481 * the app is prepared to handle said restrictions.
1482 *
1483 * On Linux, SDL will apply the following configuration to any thread that becomes realtime:
1484 * * The SCHED_RESET_ON_FORK bit will be set on the scheduling policy,
1485 * * An RLIMIT_RTTIME budget will be configured to the rtkit specified limit.
1486 * * Exceeding this limit will result in the kernel sending SIGKILL to the app,
1487 * * Refer to the man pages for more information.
1488 *
1489 * This variable can be set to the following values:
1490 * "0" - default platform specific behaviour
1491 * "1" - Force SDL_THREAD_PRIORITY_TIME_CRITICAL to a realtime scheduling policy
1492 */
1493#define SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL "SDL_THREAD_FORCE_REALTIME_TIME_CRITICAL"
1494
1495/**
1496* \brief A string specifying additional information to use with SDL_SetThreadPriority.
1497*
1498* By default SDL_SetThreadPriority will make appropriate system changes in order to
1499* apply a thread priority. For example on systems using pthreads the scheduler policy
1500* is changed automatically to a policy that works well with a given priority.
1501* Code which has specific requirements can override SDL's default behavior with this hint.
1502*
1503* pthread hint values are "current", "other", "fifo" and "rr".
1504* Currently no other platform hint values are defined but may be in the future.
1505*
1506* \note On Linux, the kernel may send SIGKILL to realtime tasks which exceed the distro
1507* configured execution budget for rtkit. This budget can be queried through RLIMIT_RTTIME
1508* after calling SDL_SetThreadPriority().
1509*/
1510#define SDL_HINT_THREAD_PRIORITY_POLICY "SDL_THREAD_PRIORITY_POLICY"
1511
1512/**
1513* \brief A string specifying SDL's threads stack size in bytes or "0" for the backend's default size
1514*
1515* Use this hint in case you need to set SDL's threads stack size to other than the default.
1516* This is specially useful if you build SDL against a non glibc libc library (such as musl) which
1517* provides a relatively small default thread stack size (a few kilobytes versus the default 8MB glibc uses).
1518* Support for this hint is currently available only in the pthread, Windows, and PSP backend.
1519*
1520* Instead of this hint, in 2.0.9 and later, you can use
1521* SDL_CreateThreadWithStackSize(). This hint only works with the classic
1522* SDL_CreateThread().
1523*/
1524#define SDL_HINT_THREAD_STACK_SIZE "SDL_THREAD_STACK_SIZE"
1525
1526/**
1527 * \brief A variable that controls the timer resolution, in milliseconds.
1528 *
1529 * The higher resolution the timer, the more frequently the CPU services
1530 * timer interrupts, and the more precise delays are, but this takes up
1531 * power and CPU time. This hint is only used on Windows.
1532 *
1533 * See this blog post for more information:
1534 * http://randomascii.wordpress.com/2013/07/08/windows-timer-resolution-megawatts-wasted/
1535 *
1536 * If this variable is set to "0", the system timer resolution is not set.
1537 *
1538 * The default value is "1". This hint may be set at any time.
1539 */
1540#define SDL_HINT_TIMER_RESOLUTION "SDL_TIMER_RESOLUTION"
1541
1542/**
1543 * \brief A variable controlling whether touch events should generate synthetic mouse events
1544 *
1545 * This variable can be set to the following values:
1546 * "0" - Touch events will not generate mouse events
1547 * "1" - Touch events will generate mouse events
1548 *
1549 * By default SDL will generate mouse events for touch events
1550 */
1551#define SDL_HINT_TOUCH_MOUSE_EVENTS "SDL_TOUCH_MOUSE_EVENTS"
1552
1553/**
1554 * \brief A variable controlling which touchpad should generate synthetic mouse events
1555 *
1556 * This variable can be set to the following values:
1557 * "0" - Only front touchpad should generate mouse events. Default
1558 * "1" - Only back touchpad should generate mouse events.
1559 * "2" - Both touchpads should generate mouse events.
1560 *
1561 * By default SDL will generate mouse events for all touch devices
1562 */
1563#define SDL_HINT_VITA_TOUCH_MOUSE_DEVICE "SDL_HINT_VITA_TOUCH_MOUSE_DEVICE"
1564
1565/**
1566 * \brief A variable controlling whether the Android / tvOS remotes
1567 * should be listed as joystick devices, instead of sending keyboard events.
1568 *
1569 * This variable can be set to the following values:
1570 * "0" - Remotes send enter/escape/arrow key events
1571 * "1" - Remotes are available as 2 axis, 2 button joysticks (the default).
1572 */
1573#define SDL_HINT_TV_REMOTE_AS_JOYSTICK "SDL_TV_REMOTE_AS_JOYSTICK"
1574
1575/**
1576 * \brief A variable controlling whether the screensaver is enabled.
1577 *
1578 * This variable can be set to the following values:
1579 * "0" - Disable screensaver
1580 * "1" - Enable screensaver
1581 *
1582 * By default SDL will disable the screensaver.
1583 */
1584#define SDL_HINT_VIDEO_ALLOW_SCREENSAVER "SDL_VIDEO_ALLOW_SCREENSAVER"
1585
1586/**
1587 * \brief Tell the video driver that we only want a double buffer.
1588 *
1589 * By default, most lowlevel 2D APIs will use a triple buffer scheme that
1590 * wastes no CPU time on waiting for vsync after issuing a flip, but
1591 * introduces a frame of latency. On the other hand, using a double buffer
1592 * scheme instead is recommended for cases where low latency is an important
1593 * factor because we save a whole frame of latency.
1594 * We do so by waiting for vsync immediately after issuing a flip, usually just
1595 * after eglSwapBuffers call in the backend's *_SwapWindow function.
1596 *
1597 * Since it's driver-specific, it's only supported where possible and
1598 * implemented. Currently supported the following drivers:
1599 *
1600 * - KMSDRM (kmsdrm)
1601 * - Raspberry Pi (raspberrypi)
1602 */
1603#define SDL_HINT_VIDEO_DOUBLE_BUFFER "SDL_VIDEO_DOUBLE_BUFFER"
1604
1605/**
1606 * \brief A variable controlling whether the EGL window is allowed to be
1607 * composited as transparent, rather than opaque.
1608 *
1609 * Most window systems will always render windows opaque, even if the surface
1610 * format has an alpha channel. This is not always true, however, so by default
1611 * SDL will try to enforce opaque composition. To override this behavior, you
1612 * can set this hint to "1".
1613 */
1614#define SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY "SDL_VIDEO_EGL_ALLOW_TRANSPARENCY"
1615
1616/**
1617 * \brief If eglGetPlatformDisplay fails, fall back to calling eglGetDisplay.
1618 *
1619 * This variable can be set to one of the following values:
1620 * "0" - Do not fall back to eglGetDisplay
1621 * "1" - Fall back to eglGetDisplay if eglGetPlatformDisplay fails.
1622 *
1623 * By default, SDL will fall back to eglGetDisplay if eglGetPlatformDisplay
1624 * fails.
1625 */
1626#define SDL_HINT_VIDEO_EGL_ALLOW_GETDISPLAY_FALLBACK "SDL_VIDEO_EGL_GETDISPLAY_FALLBACK"
1627
1628/**
1629 * \brief A variable controlling whether the graphics context is externally managed.
1630 *
1631 * This variable can be set to the following values:
1632 * "0" - SDL will manage graphics contexts that are attached to windows.
1633 * "1" - Disable graphics context management on windows.
1634 *
1635 * By default SDL will manage OpenGL contexts in certain situations. For example, on Android the
1636 * context will be automatically saved and restored when pausing the application. Additionally, some
1637 * platforms will assume usage of OpenGL if Vulkan isn't used. Setting this to "1" will prevent this
1638 * behavior, which is desireable when the application manages the graphics context, such as
1639 * an externally managed OpenGL context or attaching a Vulkan surface to the window.
1640 */
1641#define SDL_HINT_VIDEO_EXTERNAL_CONTEXT "SDL_VIDEO_EXTERNAL_CONTEXT"
1642
1643/**
1644 * \brief A variable that dictates policy for fullscreen Spaces on macOS.
1645 *
1646 * This hint only applies to macOS.
1647 *
1648 * The variable can be set to the following values:
1649 * "0" - Disable Spaces support (FULLSCREEN_DESKTOP won't use them and
1650 * SDL_WINDOW_RESIZABLE windows won't offer the "fullscreen"
1651 * button on their titlebars).
1652 * "1" - Enable Spaces support (FULLSCREEN_DESKTOP will use them and
1653 * SDL_WINDOW_RESIZABLE windows will offer the "fullscreen"
1654 * button on their titlebars).
1655 *
1656 * The default value is "1". This hint must be set before any windows are created.
1657 */
1658#define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES "SDL_VIDEO_MAC_FULLSCREEN_SPACES"
1659
1660/**
1661 * \brief Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to false.
1662 * \warning Before SDL 2.0.14, this defaulted to true! In 2.0.14, we're
1663 * seeing if "true" causes more problems than it solves in modern times.
1664 *
1665 */
1666#define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS"
1667
1668/**
1669 * \brief A variable controlling whether the libdecor Wayland backend is allowed to be used.
1670 *
1671 * This variable can be set to the following values:
1672 * "0" - libdecor use is disabled.
1673 * "1" - libdecor use is enabled (default).
1674 *
1675 * libdecor is used over xdg-shell when xdg-decoration protocol is unavailable.
1676 */
1677#define SDL_HINT_VIDEO_WAYLAND_ALLOW_LIBDECOR "SDL_VIDEO_WAYLAND_ALLOW_LIBDECOR"
1678
1679/**
1680 * \brief A variable controlling whether the libdecor Wayland backend is preferred over native decrations.
1681 *
1682 * When this hint is set, libdecor will be used to provide window decorations, even if xdg-decoration is
1683 * available. (Note that, by default, libdecor will use xdg-decoration itself if available).
1684 *
1685 * This variable can be set to the following values:
1686 * "0" - libdecor is enabled only if server-side decorations are unavailable.
1687 * "1" - libdecor is always enabled if available.
1688 *
1689 * libdecor is used over xdg-shell when xdg-decoration protocol is unavailable.
1690 */
1691#define SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR "SDL_VIDEO_WAYLAND_PREFER_LIBDECOR"
1692
1693/**
1694 * \brief A variable controlling whether video mode emulation is enabled under Wayland.
1695 *
1696 * When this hint is set, a standard set of emulated CVT video modes will be exposed for use by the application.
1697 * If it is disabled, the only modes exposed will be the logical desktop size and, in the case of a scaled
1698 * desktop, the native display resolution.
1699 *
1700 * This variable can be set to the following values:
1701 * "0" - Video mode emulation is disabled.
1702 * "1" - Video mode emulation is enabled.
1703 *
1704 * By default video mode emulation is enabled.
1705 */
1706#define SDL_HINT_VIDEO_WAYLAND_MODE_EMULATION "SDL_VIDEO_WAYLAND_MODE_EMULATION"
1707
1708/**
1709 * \brief Enable or disable mouse pointer warp emulation, needed by some older games.
1710 *
1711 * When this hint is set, any SDL will emulate mouse warps using relative mouse mode.
1712 * This is required for some older games (such as Source engine games), which warp the
1713 * mouse to the centre of the screen rather than using relative mouse motion. Note that
1714 * relative mouse mode may have different mouse acceleration behaviour than pointer warps.
1715 *
1716 * This variable can be set to the following values:
1717 * "0" - All mouse warps fail, as mouse warping is not available under wayland.
1718 * "1" - Some mouse warps will be emulated by forcing relative mouse mode.
1719 *
1720 * If not set, this is automatically enabled unless an application uses relative mouse
1721 * mode directly.
1722 */
1723#define SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP "SDL_VIDEO_WAYLAND_EMULATE_MOUSE_WARP"
1724
1725/**
1726* \brief A variable that is the address of another SDL_Window* (as a hex string formatted with "%p").
1727*
1728* If this hint is set before SDL_CreateWindowFrom() and the SDL_Window* it is set to has
1729* SDL_WINDOW_OPENGL set (and running on WGL only, currently), then two things will occur on the newly
1730* created SDL_Window:
1731*
1732* 1. Its pixel format will be set to the same pixel format as this SDL_Window. This is
1733* needed for example when sharing an OpenGL context across multiple windows.
1734*
1735* 2. The flag SDL_WINDOW_OPENGL will be set on the new window so it can be used for
1736* OpenGL rendering.
1737*
1738* This variable can be set to the following values:
1739* The address (as a string "%p") of the SDL_Window* that new windows created with SDL_CreateWindowFrom() should
1740* share a pixel format with.
1741*/
1742#define SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT "SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT"
1743
1744/**
1745 * \brief When calling SDL_CreateWindowFrom(), make the window compatible with OpenGL.
1746 *
1747 * This variable can be set to the following values:
1748 * "0" - Don't add any graphics flags to the SDL_WindowFlags
1749 * "1" - Add SDL_WINDOW_OPENGL to the SDL_WindowFlags
1750 *
1751 * By default SDL will not make the foreign window compatible with OpenGL.
1752 */
1753#define SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL "SDL_VIDEO_FOREIGN_WINDOW_OPENGL"
1754
1755/**
1756 * \brief When calling SDL_CreateWindowFrom(), make the window compatible with Vulkan.
1757 *
1758 * This variable can be set to the following values:
1759 * "0" - Don't add any graphics flags to the SDL_WindowFlags
1760 * "1" - Add SDL_WINDOW_VULKAN to the SDL_WindowFlags
1761 *
1762 * By default SDL will not make the foreign window compatible with Vulkan.
1763 */
1764#define SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN "SDL_VIDEO_FOREIGN_WINDOW_VULKAN"
1765
1766/**
1767* \brief A variable specifying which shader compiler to preload when using the Chrome ANGLE binaries
1768*
1769* SDL has EGL and OpenGL ES2 support on Windows via the ANGLE project. It
1770* can use two different sets of binaries, those compiled by the user from source
1771* or those provided by the Chrome browser. In the later case, these binaries require
1772* that SDL loads a DLL providing the shader compiler.
1773*
1774* This variable can be set to the following values:
1775* "d3dcompiler_46.dll" - default, best for Vista or later.
1776* "d3dcompiler_43.dll" - for XP support.
1777* "none" - do not load any library, useful if you compiled ANGLE from source and included the compiler in your binaries.
1778*
1779*/
1780#define SDL_HINT_VIDEO_WIN_D3DCOMPILER "SDL_VIDEO_WIN_D3DCOMPILER"
1781
1782/**
1783 * \brief A variable controlling whether the OpenGL context should be created
1784 * with EGL by default
1785 *
1786 * This variable can be set to the following values:
1787 * "0" - Use platform-specific GL context creation API (GLX, WGL, CGL, etc)
1788 * "1" - Use EGL
1789 *
1790 * By default SDL will use the platform-specific GL context API when both are present.
1791 */
1792#define SDL_HINT_VIDEO_FORCE_EGL "SDL_VIDEO_FORCE_EGL"
1793
1794/**
1795 * \brief A variable controlling whether the X11 _NET_WM_BYPASS_COMPOSITOR hint should be used.
1796 *
1797 * This variable can be set to the following values:
1798 * "0" - Disable _NET_WM_BYPASS_COMPOSITOR
1799 * "1" - Enable _NET_WM_BYPASS_COMPOSITOR
1800 *
1801 * By default SDL will use _NET_WM_BYPASS_COMPOSITOR
1802 *
1803 */
1804#define SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR "SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR"
1805
1806/**
1807 * \brief A variable controlling whether the X11 _NET_WM_PING protocol should be supported.
1808 *
1809 * This variable can be set to the following values:
1810 * "0" - Disable _NET_WM_PING
1811 * "1" - Enable _NET_WM_PING
1812 *
1813 * By default SDL will use _NET_WM_PING, but for applications that know they
1814 * will not always be able to respond to ping requests in a timely manner they can
1815 * turn it off to avoid the window manager thinking the app is hung.
1816 * The hint is checked in CreateWindow.
1817 */
1818#define SDL_HINT_VIDEO_X11_NET_WM_PING "SDL_VIDEO_X11_NET_WM_PING"
1819
1820/**
1821 * \brief A variable forcing the visual ID chosen for new X11 windows
1822 *
1823 */
1824#define SDL_HINT_VIDEO_X11_WINDOW_VISUALID "SDL_VIDEO_X11_WINDOW_VISUALID"
1825
1826/**
1827 * \brief A variable controlling whether the X11 XRandR extension should be used.
1828 *
1829 * This variable can be set to the following values:
1830 * "0" - Disable XRandR
1831 * "1" - Enable XRandR
1832 *
1833 * By default SDL will use XRandR.
1834 */
1835#define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR"
1836
1837/**
1838 * \brief Controls how the fact chunk affects the loading of a WAVE file.
1839 *
1840 * The fact chunk stores information about the number of samples of a WAVE
1841 * file. The Standards Update from Microsoft notes that this value can be used
1842 * to 'determine the length of the data in seconds'. This is especially useful
1843 * for compressed formats (for which this is a mandatory chunk) if they produce
1844 * multiple sample frames per block and truncating the block is not allowed.
1845 * The fact chunk can exactly specify how many sample frames there should be
1846 * in this case.
1847 *
1848 * Unfortunately, most application seem to ignore the fact chunk and so SDL
1849 * ignores it by default as well.
1850 *
1851 * This variable can be set to the following values:
1852 *
1853 * "truncate" - Use the number of samples to truncate the wave data if
1854 * the fact chunk is present and valid
1855 * "strict" - Like "truncate", but raise an error if the fact chunk
1856 * is invalid, not present for non-PCM formats, or if the
1857 * data chunk doesn't have that many samples
1858 * "ignorezero" - Like "truncate", but ignore fact chunk if the number of
1859 * samples is zero
1860 * "ignore" - Ignore fact chunk entirely (default)
1861 */
1862#define SDL_HINT_WAVE_FACT_CHUNK "SDL_WAVE_FACT_CHUNK"
1863
1864/**
1865 * \brief Controls how the size of the RIFF chunk affects the loading of a WAVE file.
1866 *
1867 * The size of the RIFF chunk (which includes all the sub-chunks of the WAVE
1868 * file) is not always reliable. In case the size is wrong, it's possible to
1869 * just ignore it and step through the chunks until a fixed limit is reached.
1870 *
1871 * Note that files that have trailing data unrelated to the WAVE file or
1872 * corrupt files may slow down the loading process without a reliable boundary.
1873 * By default, SDL stops after 10000 chunks to prevent wasting time. Use the
1874 * environment variable SDL_WAVE_CHUNK_LIMIT to adjust this value.
1875 *
1876 * This variable can be set to the following values:
1877 *
1878 * "force" - Always use the RIFF chunk size as a boundary for the chunk search
1879 * "ignorezero" - Like "force", but a zero size searches up to 4 GiB (default)
1880 * "ignore" - Ignore the RIFF chunk size and always search up to 4 GiB
1881 * "maximum" - Search for chunks until the end of file (not recommended)
1882 */
1883#define SDL_HINT_WAVE_RIFF_CHUNK_SIZE "SDL_WAVE_RIFF_CHUNK_SIZE"
1884
1885/**
1886 * \brief Controls how a truncated WAVE file is handled.
1887 *
1888 * A WAVE file is considered truncated if any of the chunks are incomplete or
1889 * the data chunk size is not a multiple of the block size. By default, SDL
1890 * decodes until the first incomplete block, as most applications seem to do.
1891 *
1892 * This variable can be set to the following values:
1893 *
1894 * "verystrict" - Raise an error if the file is truncated
1895 * "strict" - Like "verystrict", but the size of the RIFF chunk is ignored
1896 * "dropframe" - Decode until the first incomplete sample frame
1897 * "dropblock" - Decode until the first incomplete block (default)
1898 */
1899#define SDL_HINT_WAVE_TRUNCATION "SDL_WAVE_TRUNCATION"
1900
1901/**
1902 * \brief Tell SDL not to name threads on Windows with the 0x406D1388 Exception.
1903 * The 0x406D1388 Exception is a trick used to inform Visual Studio of a
1904 * thread's name, but it tends to cause problems with other debuggers,
1905 * and the .NET runtime. Note that SDL 2.0.6 and later will still use
1906 * the (safer) SetThreadDescription API, introduced in the Windows 10
1907 * Creators Update, if available.
1908 *
1909 * The variable can be set to the following values:
1910 * "0" - SDL will raise the 0x406D1388 Exception to name threads.
1911 * This is the default behavior of SDL <= 2.0.4.
1912 * "1" - SDL will not raise this exception, and threads will be unnamed. (default)
1913 * This is necessary with .NET languages or debuggers that aren't Visual Studio.
1914 */
1915#define SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING "SDL_WINDOWS_DISABLE_THREAD_NAMING"
1916
1917/**
1918 * \brief Controls whether menus can be opened with their keyboard shortcut (Alt+mnemonic).
1919 *
1920 * If the mnemonics are enabled, then menus can be opened by pressing the Alt
1921 * key and the corresponding mnemonic (for example, Alt+F opens the File menu).
1922 * However, in case an invalid mnemonic is pressed, Windows makes an audible
1923 * beep to convey that nothing happened. This is true even if the window has
1924 * no menu at all!
1925 *
1926 * Because most SDL applications don't have menus, and some want to use the Alt
1927 * key for other purposes, SDL disables mnemonics (and the beeping) by default.
1928 *
1929 * Note: This also affects keyboard events: with mnemonics enabled, when a
1930 * menu is opened from the keyboard, you will not receive a KEYUP event for
1931 * the mnemonic key, and *might* not receive one for Alt.
1932 *
1933 * This variable can be set to the following values:
1934 * "0" - Alt+mnemonic does nothing, no beeping. (default)
1935 * "1" - Alt+mnemonic opens menus, invalid mnemonics produce a beep.
1936 */
1937#define SDL_HINT_WINDOWS_ENABLE_MENU_MNEMONICS "SDL_WINDOWS_ENABLE_MENU_MNEMONICS"
1938
1939/**
1940 * \brief A variable controlling whether the windows message loop is processed by SDL
1941 *
1942 * This variable can be set to the following values:
1943 * "0" - The window message loop is not run
1944 * "1" - The window message loop is processed in SDL_PumpEvents()
1945 *
1946 * By default SDL will process the windows message loop
1947 */
1948#define SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP "SDL_WINDOWS_ENABLE_MESSAGELOOP"
1949
1950/**
1951 * \brief Force SDL to use Critical Sections for mutexes on Windows.
1952 * On Windows 7 and newer, Slim Reader/Writer Locks are available.
1953 * They offer better performance, allocate no kernel ressources and
1954 * use less memory. SDL will fall back to Critical Sections on older
1955 * OS versions or if forced to by this hint.
1956 *
1957 * This variable can be set to the following values:
1958 * "0" - Use SRW Locks when available. If not, fall back to Critical Sections. (default)
1959 * "1" - Force the use of Critical Sections in all cases.
1960 *
1961 */
1962#define SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS "SDL_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS"
1963
1964/**
1965 * \brief Force SDL to use Kernel Semaphores on Windows.
1966 * Kernel Semaphores are inter-process and require a context
1967 * switch on every interaction. On Windows 8 and newer, the
1968 * WaitOnAddress API is available. Using that and atomics to
1969 * implement semaphores increases performance.
1970 * SDL will fall back to Kernel Objects on older OS versions
1971 * or if forced to by this hint.
1972 *
1973 * This variable can be set to the following values:
1974 * "0" - Use Atomics and WaitOnAddress API when available. If not, fall back to Kernel Objects. (default)
1975 * "1" - Force the use of Kernel Objects in all cases.
1976 *
1977 */
1978#define SDL_HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL "SDL_WINDOWS_FORCE_SEMAPHORE_KERNEL"
1979
1980/**
1981 * \brief A variable to specify custom icon resource id from RC file on Windows platform
1982 */
1983#define SDL_HINT_WINDOWS_INTRESOURCE_ICON "SDL_WINDOWS_INTRESOURCE_ICON"
1984#define SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL "SDL_WINDOWS_INTRESOURCE_ICON_SMALL"
1985
1986/**
1987 * \brief Tell SDL not to generate window-close events for Alt+F4 on Windows.
1988 *
1989 * The variable can be set to the following values:
1990 * "0" - SDL will generate a window-close event when it sees Alt+F4.
1991 * "1" - SDL will only do normal key handling for Alt+F4.
1992 */
1993#define SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 "SDL_WINDOWS_NO_CLOSE_ON_ALT_F4"
1994
1995/**
1996 * \brief Use the D3D9Ex API introduced in Windows Vista, instead of normal D3D9.
1997 * Direct3D 9Ex contains changes to state management that can eliminate device
1998 * loss errors during scenarios like Alt+Tab or UAC prompts. D3D9Ex may require
1999 * some changes to your application to cope with the new behavior, so this
2000 * is disabled by default.
2001 *
2002 * This hint must be set before initializing the video subsystem.
2003 *
2004 * For more information on Direct3D 9Ex, see:
2005 * - https://docs.microsoft.com/en-us/windows/win32/direct3darticles/graphics-apis-in-windows-vista#direct3d-9ex
2006 * - https://docs.microsoft.com/en-us/windows/win32/direct3darticles/direct3d-9ex-improvements
2007 *
2008 * This variable can be set to the following values:
2009 * "0" - Use the original Direct3D 9 API (default)
2010 * "1" - Use the Direct3D 9Ex API on Vista and later (and fall back if D3D9Ex is unavailable)
2011 *
2012 */
2013#define SDL_HINT_WINDOWS_USE_D3D9EX "SDL_WINDOWS_USE_D3D9EX"
2014
2015/**
2016 * \brief A variable controlling whether the window frame and title bar are interactive when the cursor is hidden
2017 *
2018 * This variable can be set to the following values:
2019 * "0" - The window frame is not interactive when the cursor is hidden (no move, resize, etc)
2020 * "1" - The window frame is interactive when the cursor is hidden
2021 *
2022 * By default SDL will allow interaction with the window frame when the cursor is hidden
2023 */
2024#define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN"
2025
2026/**
2027* \brief A variable controlling whether the window is activated when the SDL_ShowWindow function is called
2028*
2029* This variable can be set to the following values:
2030* "0" - The window is activated when the SDL_ShowWindow function is called
2031* "1" - The window is not activated when the SDL_ShowWindow function is called
2032*
2033* By default SDL will activate the window when the SDL_ShowWindow function is called
2034*/
2035#define SDL_HINT_WINDOW_NO_ACTIVATION_WHEN_SHOWN "SDL_WINDOW_NO_ACTIVATION_WHEN_SHOWN"
2036
2037/** \brief Allows back-button-press events on Windows Phone to be marked as handled
2038 *
2039 * Windows Phone devices typically feature a Back button. When pressed,
2040 * the OS will emit back-button-press events, which apps are expected to
2041 * handle in an appropriate manner. If apps do not explicitly mark these
2042 * events as 'Handled', then the OS will invoke its default behavior for
2043 * unhandled back-button-press events, which on Windows Phone 8 and 8.1 is to
2044 * terminate the app (and attempt to switch to the previous app, or to the
2045 * device's home screen).
2046 *
2047 * Setting the SDL_HINT_WINRT_HANDLE_BACK_BUTTON hint to "1" will cause SDL
2048 * to mark back-button-press events as Handled, if and when one is sent to
2049 * the app.
2050 *
2051 * Internally, Windows Phone sends back button events as parameters to
2052 * special back-button-press callback functions. Apps that need to respond
2053 * to back-button-press events are expected to register one or more
2054 * callback functions for such, shortly after being launched (during the
2055 * app's initialization phase). After the back button is pressed, the OS
2056 * will invoke these callbacks. If the app's callback(s) do not explicitly
2057 * mark the event as handled by the time they return, or if the app never
2058 * registers one of these callback, the OS will consider the event
2059 * un-handled, and it will apply its default back button behavior (terminate
2060 * the app).
2061 *
2062 * SDL registers its own back-button-press callback with the Windows Phone
2063 * OS. This callback will emit a pair of SDL key-press events (SDL_EVENT_KEY_DOWN
2064 * and SDL_EVENT_KEY_UP), each with a scancode of SDL_SCANCODE_AC_BACK, after which
2065 * it will check the contents of the hint, SDL_HINT_WINRT_HANDLE_BACK_BUTTON.
2066 * If the hint's value is set to "1", the back button event's Handled
2067 * property will get set to 'true'. If the hint's value is set to something
2068 * else, or if it is unset, SDL will leave the event's Handled property
2069 * alone. (By default, the OS sets this property to 'false', to note.)
2070 *
2071 * SDL apps can either set SDL_HINT_WINRT_HANDLE_BACK_BUTTON well before a
2072 * back button is pressed, or can set it in direct-response to a back button
2073 * being pressed.
2074 *
2075 * In order to get notified when a back button is pressed, SDL apps should
2076 * register a callback function with SDL_AddEventWatch(), and have it listen
2077 * for SDL_EVENT_KEY_DOWN events that have a scancode of SDL_SCANCODE_AC_BACK.
2078 * (Alternatively, SDL_EVENT_KEY_UP events can be listened-for. Listening for
2079 * either event type is suitable.) Any value of SDL_HINT_WINRT_HANDLE_BACK_BUTTON
2080 * set by such a callback, will be applied to the OS' current
2081 * back-button-press event.
2082 *
2083 * More details on back button behavior in Windows Phone apps can be found
2084 * at the following page, on Microsoft's developer site:
2085 * http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj247550(v=vs.105).aspx
2086 */
2087#define SDL_HINT_WINRT_HANDLE_BACK_BUTTON "SDL_WINRT_HANDLE_BACK_BUTTON"
2088
2089/** \brief Label text for a WinRT app's privacy policy link
2090 *
2091 * Network-enabled WinRT apps must include a privacy policy. On Windows 8, 8.1, and RT,
2092 * Microsoft mandates that this policy be available via the Windows Settings charm.
2093 * SDL provides code to add a link there, with its label text being set via the
2094 * optional hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL.
2095 *
2096 * Please note that a privacy policy's contents are not set via this hint. A separate
2097 * hint, SDL_HINT_WINRT_PRIVACY_POLICY_URL, is used to link to the actual text of the
2098 * policy.
2099 *
2100 * The contents of this hint should be encoded as a UTF8 string.
2101 *
2102 * The default value is "Privacy Policy". This hint should only be set during app
2103 * initialization, preferably before any calls to SDL_Init().
2104 *
2105 * For additional information on linking to a privacy policy, see the documentation for
2106 * SDL_HINT_WINRT_PRIVACY_POLICY_URL.
2107 */
2108#define SDL_HINT_WINRT_PRIVACY_POLICY_LABEL "SDL_WINRT_PRIVACY_POLICY_LABEL"
2109
2110/**
2111 * \brief A URL to a WinRT app's privacy policy
2112 *
2113 * All network-enabled WinRT apps must make a privacy policy available to its
2114 * users. On Windows 8, 8.1, and RT, Microsoft mandates that this policy be
2115 * be available in the Windows Settings charm, as accessed from within the app.
2116 * SDL provides code to add a URL-based link there, which can point to the app's
2117 * privacy policy.
2118 *
2119 * To setup a URL to an app's privacy policy, set SDL_HINT_WINRT_PRIVACY_POLICY_URL
2120 * before calling any SDL_Init() functions. The contents of the hint should
2121 * be a valid URL. For example, "http://www.example.com".
2122 *
2123 * The default value is "", which will prevent SDL from adding a privacy policy
2124 * link to the Settings charm. This hint should only be set during app init.
2125 *
2126 * The label text of an app's "Privacy Policy" link may be customized via another
2127 * hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL.
2128 *
2129 * Please note that on Windows Phone, Microsoft does not provide standard UI
2130 * for displaying a privacy policy link, and as such, SDL_HINT_WINRT_PRIVACY_POLICY_URL
2131 * will not get used on that platform. Network-enabled phone apps should display
2132 * their privacy policy through some other, in-app means.
2133 */
2134#define SDL_HINT_WINRT_PRIVACY_POLICY_URL "SDL_WINRT_PRIVACY_POLICY_URL"
2135
2136/**
2137 * \brief Mark X11 windows as override-redirect.
2138 *
2139 * If set, this _might_ increase framerate at the expense of the desktop
2140 * not working as expected. Override-redirect windows aren't noticed by the
2141 * window manager at all.
2142 *
2143 * You should probably only use this for fullscreen windows, and you probably
2144 * shouldn't even use it for that. But it's here if you want to try!
2145 */
2146#define SDL_HINT_X11_FORCE_OVERRIDE_REDIRECT "SDL_X11_FORCE_OVERRIDE_REDIRECT"
2147
2148/**
2149 * \brief A variable that lets you disable the detection and use of Xinput gamepad devices
2150 *
2151 * The variable can be set to the following values:
2152 * "0" - Disable XInput detection (only uses direct input)
2153 * "1" - Enable XInput detection (the default)
2154 */
2155#define SDL_HINT_XINPUT_ENABLED "SDL_XINPUT_ENABLED"
2156
2157 /**
2158 * \brief A variable that lets you disable the detection and use of DirectInput gamepad devices
2159 *
2160 * The variable can be set to the following values:
2161 * "0" - Disable DirectInput detection (only uses XInput)
2162 * "1" - Enable DirectInput detection (the default)
2163 */
2164#define SDL_HINT_DIRECTINPUT_ENABLED "SDL_DIRECTINPUT_ENABLED"
2165
2166/**
2167 * \brief A variable that causes SDL to use the old axis and button mapping for XInput devices.
2168 *
2169 * This hint is for backwards compatibility only and will be removed in SDL 2.1
2170 *
2171 * The default value is "0". This hint must be set before SDL_Init()
2172 */
2173#define SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING "SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING"
2174
2175/**
2176 * \brief A variable that causes SDL to not ignore audio "monitors"
2177 *
2178 * This is currently only used for PulseAudio and ignored elsewhere.
2179 *
2180 * By default, SDL ignores audio devices that aren't associated with physical
2181 * hardware. Changing this hint to "1" will expose anything SDL sees that
2182 * appears to be an audio source or sink. This will add "devices" to the list
2183 * that the user probably doesn't want or need, but it can be useful in
2184 * scenarios where you want to hook up SDL to some sort of virtual device,
2185 * etc.
2186 *
2187 * The default value is "0". This hint must be set before SDL_Init().
2188 *
2189 * This hint is available since SDL 2.0.16. Before then, virtual devices are
2190 * always ignored.
2191 */
2192#define SDL_HINT_AUDIO_INCLUDE_MONITORS "SDL_AUDIO_INCLUDE_MONITORS"
2193
2194/**
2195 * \brief A variable that forces X11 windows to create as a custom type.
2196 *
2197 * This is currently only used for X11 and ignored elsewhere.
2198 *
2199 * During SDL_CreateWindow, SDL uses the _NET_WM_WINDOW_TYPE X11 property
2200 * to report to the window manager the type of window it wants to create.
2201 * This might be set to various things if SDL_WINDOW_TOOLTIP or
2202 * SDL_WINDOW_POPUP_MENU, etc, were specified. For "normal" windows that
2203 * haven't set a specific type, this hint can be used to specify a custom
2204 * type. For example, a dock window might set this to
2205 * "_NET_WM_WINDOW_TYPE_DOCK".
2206 *
2207 * If not set or set to "", this hint is ignored. This hint must be set
2208 * before the SDL_CreateWindow() call that it is intended to affect.
2209 *
2210 * This hint is available since SDL 2.0.22.
2211 */
2212#define SDL_HINT_X11_WINDOW_TYPE "SDL_X11_WINDOW_TYPE"
2213
2214/**
2215 * \brief A variable that decides whether to send SDL_EVENT_QUIT when closing the final window.
2216 *
2217 * By default, SDL sends an SDL_EVENT_QUIT event when there is only one window
2218 * and it receives an SDL_EVENT_WINDOW_CLOSE_REQUESTED event, under the assumption most
2219 * apps would also take the loss of this window as a signal to terminate the
2220 * program.
2221 *
2222 * However, it's not unreasonable in some cases to have the program continue
2223 * to live on, perhaps to create new windows later.
2224 *
2225 * Changing this hint to "0" will cause SDL to not send an SDL_EVENT_QUIT event
2226 * when the final window is requesting to close. Note that in this case,
2227 * there are still other legitimate reasons one might get an SDL_EVENT_QUIT
2228 * event: choosing "Quit" from the macOS menu bar, sending a SIGINT (ctrl-c)
2229 * on Unix, etc.
2230 *
2231 * The default value is "1". This hint can be changed at any time.
2232 *
2233 * This hint is available since SDL 2.0.22. Before then, you always get
2234 * an SDL_EVENT_QUIT event when closing the final window.
2235 */
2236#define SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE "SDL_QUIT_ON_LAST_WINDOW_CLOSE"
2237
2238
2239/**
2240 * \brief A variable that decides what video backend to use.
2241 *
2242 * By default, SDL will try all available video backends in a reasonable
2243 * order until it finds one that can work, but this hint allows the app
2244 * or user to force a specific target, such as "x11" if, say, you are
2245 * on Wayland but want to try talking to the X server instead.
2246 *
2247 * This functionality has existed since SDL 2.0.0 (indeed, before that)
2248 * but before 2.0.22 this was an environment variable only. In 2.0.22,
2249 * it was upgraded to a full SDL hint, so you can set the environment
2250 * variable as usual or programatically set the hint with SDL_SetHint,
2251 * which won't propagate to child processes.
2252 *
2253 * The default value is unset, in which case SDL will try to figure out
2254 * the best video backend on your behalf. This hint needs to be set
2255 * before SDL_Init() is called to be useful.
2256 *
2257 * This hint is available since SDL 2.0.22. Before then, you could set
2258 * the environment variable to get the same effect.
2259 */
2260#define SDL_HINT_VIDEO_DRIVER "SDL_VIDEO_DRIVER"
2261
2262/**
2263 * \brief A variable that decides what audio backend to use.
2264 *
2265 * By default, SDL will try all available audio backends in a reasonable
2266 * order until it finds one that can work, but this hint allows the app
2267 * or user to force a specific target, such as "alsa" if, say, you are
2268 * on PulseAudio but want to try talking to the lower level instead.
2269 *
2270 * This functionality has existed since SDL 2.0.0 (indeed, before that)
2271 * but before 2.0.22 this was an environment variable only. In 2.0.22,
2272 * it was upgraded to a full SDL hint, so you can set the environment
2273 * variable as usual or programatically set the hint with SDL_SetHint,
2274 * which won't propagate to child processes.
2275 *
2276 * The default value is unset, in which case SDL will try to figure out
2277 * the best audio backend on your behalf. This hint needs to be set
2278 * before SDL_Init() is called to be useful.
2279 *
2280 * This hint is available since SDL 2.0.22. Before then, you could set
2281 * the environment variable to get the same effect.
2282 */
2283#define SDL_HINT_AUDIO_DRIVER "SDL_AUDIO_DRIVER"
2284
2285/**
2286 * \brief A variable that decides what KMSDRM device to use.
2287 *
2288 * Internally, SDL might open something like "/dev/dri/cardNN" to
2289 * access KMSDRM functionality, where "NN" is a device index number.
2290 *
2291 * SDL makes a guess at the best index to use (usually zero), but the
2292 * app or user can set this hint to a number between 0 and 99 to
2293 * force selection.
2294 *
2295 * This hint is available since SDL 2.24.0.
2296 */
2297#define SDL_HINT_KMSDRM_DEVICE_INDEX "SDL_KMSDRM_DEVICE_INDEX"
2298
2299
2300/**
2301 * \brief A variable that treats trackpads as touch devices.
2302 *
2303 * On macOS (and possibly other platforms in the future), SDL will report
2304 * touches on a trackpad as mouse input, which is generally what users
2305 * expect from this device; however, these are often actually full
2306 * multitouch-capable touch devices, so it might be preferable to some apps
2307 * to treat them as such.
2308 *
2309 * Setting this hint to true will make the trackpad input report as a
2310 * multitouch device instead of a mouse. The default is false.
2311 *
2312 * Note that most platforms don't support this hint. As of 2.24.0, it
2313 * only supports MacBooks' trackpads on macOS. Others may follow later.
2314 *
2315 * This hint is checked during SDL_Init and can not be changed after.
2316 *
2317 * This hint is available since SDL 2.24.0.
2318 */
2319#define SDL_HINT_TRACKPAD_IS_TOUCH_ONLY "SDL_TRACKPAD_IS_TOUCH_ONLY"
2320
2321
2322/**
2323 * \brief An enumeration of hint priorities
2324 */
2325typedef enum
2326{
2331
2332
2333/**
2334 * Set a hint with a specific priority.
2335 *
2336 * The priority controls the behavior when setting a hint that already has a
2337 * value. Hints will replace existing hints of their priority and lower.
2338 * Environment variables are considered to have override priority.
2339 *
2340 * \param name the hint to set
2341 * \param value the value of the hint variable
2342 * \param priority the SDL_HintPriority level for the hint
2343 * \returns SDL_TRUE if the hint was set, SDL_FALSE otherwise.
2344 *
2345 * \since This function is available since SDL 3.0.0.
2346 *
2347 * \sa SDL_GetHint
2348 * \sa SDL_SetHint
2349 */
2350extern DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name,
2351 const char *value,
2352 SDL_HintPriority priority);
2353
2354/**
2355 * Set a hint with normal priority.
2356 *
2357 * Hints will not be set if there is an existing override hint or environment
2358 * variable that takes precedence. You can use SDL_SetHintWithPriority() to
2359 * set the hint with override priority instead.
2360 *
2361 * \param name the hint to set
2362 * \param value the value of the hint variable
2363 * \returns SDL_TRUE if the hint was set, SDL_FALSE otherwise.
2364 *
2365 * \since This function is available since SDL 3.0.0.
2366 *
2367 * \sa SDL_GetHint
2368 * \sa SDL_SetHintWithPriority
2369 */
2370extern DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name,
2371 const char *value);
2372
2373/**
2374 * Reset a hint to the default value.
2375 *
2376 * This will reset a hint to the value of the environment variable, or NULL if
2377 * the environment isn't set. Callbacks will be called normally with this
2378 * change.
2379 *
2380 * \param name the hint to set
2381 * \returns SDL_TRUE if the hint was set, SDL_FALSE otherwise.
2382 *
2383 * \since This function is available since SDL 3.0.0.
2384 *
2385 * \sa SDL_GetHint
2386 * \sa SDL_SetHint
2387 */
2388extern DECLSPEC SDL_bool SDLCALL SDL_ResetHint(const char *name);
2389
2390/**
2391 * Reset all hints to the default values.
2392 *
2393 * This will reset all hints to the value of the associated environment
2394 * variable, or NULL if the environment isn't set. Callbacks will be called
2395 * normally with this change.
2396 *
2397 * \since This function is available since SDL 3.0.0.
2398 *
2399 * \sa SDL_GetHint
2400 * \sa SDL_SetHint
2401 * \sa SDL_ResetHint
2402 */
2403extern DECLSPEC void SDLCALL SDL_ResetHints(void);
2404
2405/**
2406 * Get the value of a hint.
2407 *
2408 * \param name the hint to query
2409 * \returns the string value of a hint or NULL if the hint isn't set.
2410 *
2411 * \since This function is available since SDL 3.0.0.
2412 *
2413 * \sa SDL_SetHint
2414 * \sa SDL_SetHintWithPriority
2415 */
2416extern DECLSPEC const char * SDLCALL SDL_GetHint(const char *name);
2417
2418/**
2419 * Get the boolean value of a hint variable.
2420 *
2421 * \param name the name of the hint to get the boolean value from
2422 * \param default_value the value to return if the hint does not exist
2423 * \returns the boolean value of a hint or the provided default value if the
2424 * hint does not exist.
2425 *
2426 * \since This function is available since SDL 3.0.0.
2427 *
2428 * \sa SDL_GetHint
2429 * \sa SDL_SetHint
2430 */
2431extern DECLSPEC SDL_bool SDLCALL SDL_GetHintBoolean(const char *name, SDL_bool default_value);
2432
2433/**
2434 * Type definition of the hint callback function.
2435 *
2436 * \param userdata what was passed as `userdata` to SDL_AddHintCallback()
2437 * \param name what was passed as `name` to SDL_AddHintCallback()
2438 * \param oldValue the previous hint value
2439 * \param newValue the new value hint is to be set to
2440 */
2441typedef void (SDLCALL *SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue);
2442
2443/**
2444 * Add a function to watch a particular hint.
2445 *
2446 * \param name the hint to watch
2447 * \param callback An SDL_HintCallback function that will be called when the
2448 * hint value changes
2449 * \param userdata a pointer to pass to the callback function
2450 * \returns 0 on success or a negative error code on failure; call
2451 * SDL_GetError() for more information.
2452 *
2453 * \since This function is available since SDL 3.0.0.
2454 *
2455 * \sa SDL_DelHintCallback
2456 */
2457extern DECLSPEC int SDLCALL SDL_AddHintCallback(const char *name,
2458 SDL_HintCallback callback,
2459 void *userdata);
2460
2461/**
2462 * Remove a function watching a particular hint.
2463 *
2464 * \param name the hint being watched
2465 * \param callback An SDL_HintCallback function that will be called when the
2466 * hint value changes
2467 * \param userdata a pointer being passed to the callback function
2468 *
2469 * \since This function is available since SDL 3.0.0.
2470 *
2471 * \sa SDL_AddHintCallback
2472 */
2473extern DECLSPEC void SDLCALL SDL_DelHintCallback(const char *name,
2474 SDL_HintCallback callback,
2475 void *userdata);
2476
2477/**
2478 * Clear all hints.
2479 *
2480 * This function is automatically called during SDL_Quit(), and deletes all
2481 * callbacks without calling them and frees all memory associated with hints.
2482 * If you're calling this from application code you probably want to call
2483 * SDL_ResetHints() instead.
2484 *
2485 * This function will be removed from the API the next time we rev the ABI.
2486 *
2487 * \since This function is available since SDL 3.0.0.
2488 *
2489 * \sa SDL_ResetHints
2490 */
2491extern DECLSPEC void SDLCALL SDL_ClearHints(void);
2492
2493
2494/* Ends C function definitions when using C++ */
2495#ifdef __cplusplus
2496}
2497#endif
2498#include <SDL3/SDL_close_code.h>
2499
2500#endif /* SDL_hints_h_ */
SDL_bool SDL_GetHintBoolean(const char *name, SDL_bool default_value)
void SDL_ResetHints(void)
void SDL_DelHintCallback(const char *name, SDL_HintCallback callback, void *userdata)
void SDL_ClearHints(void)
SDL_bool SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPriority priority)
SDL_bool SDL_SetHint(const char *name, const char *value)
SDL_bool SDL_ResetHint(const char *name)
int SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userdata)
SDL_HintPriority
An enumeration of hint priorities.
Definition: SDL_hints.h:2326
@ SDL_HINT_DEFAULT
Definition: SDL_hints.h:2327
@ SDL_HINT_OVERRIDE
Definition: SDL_hints.h:2329
@ SDL_HINT_NORMAL
Definition: SDL_hints.h:2328
const char * SDL_GetHint(const char *name)
void(* SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue)
Definition: SDL_hints.h:2441
typedef void(APIENTRYP PFNGLDRAWRANGEELEMENTSPROC)(GLenum mode
GLuint const GLchar * name
GLsizei const GLfloat * value
SDL_bool
Definition: SDL_stdinc.h:130