SDL_hints.h 111 KB

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