Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

428 lines
15 KiB

  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
  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. * 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 "SDL_stdinc.h"
  37. #include "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 how 3D acceleration is used to accelerate the SDL screen surface.
  44. *
  45. * SDL can try to accelerate the SDL screen surface by using streaming
  46. * textures with a 3D rendering engine. This variable controls whether and
  47. * how this is done.
  48. *
  49. * This variable can be set to the following values:
  50. * "0" - Disable 3D acceleration
  51. * "1" - Enable 3D acceleration, using the default renderer.
  52. * "X" - Enable 3D acceleration, using X where X is one of the valid rendering drivers. (e.g. "direct3d", "opengl", etc.)
  53. *
  54. * By default SDL tries to make a best guess for each platform whether
  55. * to use acceleration or not.
  56. */
  57. #define SDL_HINT_FRAMEBUFFER_ACCELERATION "SDL_FRAMEBUFFER_ACCELERATION"
  58. /**
  59. * \brief A variable specifying which render driver to use.
  60. *
  61. * If the application doesn't pick a specific renderer to use, this variable
  62. * specifies the name of the preferred renderer. If the preferred renderer
  63. * can't be initialized, the normal default renderer is used.
  64. *
  65. * This variable is case insensitive and can be set to the following values:
  66. * "direct3d"
  67. * "opengl"
  68. * "opengles2"
  69. * "opengles"
  70. * "software"
  71. *
  72. * The default varies by platform, but it's the first one in the list that
  73. * is available on the current platform.
  74. */
  75. #define SDL_HINT_RENDER_DRIVER "SDL_RENDER_DRIVER"
  76. /**
  77. * \brief A variable controlling whether the OpenGL render driver uses shaders if they are available.
  78. *
  79. * This variable can be set to the following values:
  80. * "0" - Disable shaders
  81. * "1" - Enable shaders
  82. *
  83. * By default shaders are used if OpenGL supports them.
  84. */
  85. #define SDL_HINT_RENDER_OPENGL_SHADERS "SDL_RENDER_OPENGL_SHADERS"
  86. /**
  87. * \brief A variable controlling whether the Direct3D device is initialized for thread-safe operations.
  88. *
  89. * This variable can be set to the following values:
  90. * "0" - Thread-safety is not enabled (faster)
  91. * "1" - Thread-safety is enabled
  92. *
  93. * By default the Direct3D device is created with thread-safety disabled.
  94. */
  95. #define SDL_HINT_RENDER_DIRECT3D_THREADSAFE "SDL_RENDER_DIRECT3D_THREADSAFE"
  96. /**
  97. * \brief A variable controlling the scaling quality
  98. *
  99. * This variable can be set to the following values:
  100. * "0" or "nearest" - Nearest pixel sampling
  101. * "1" or "linear" - Linear filtering (supported by OpenGL and Direct3D)
  102. * "2" or "best" - Currently this is the same as "linear"
  103. *
  104. * By default nearest pixel sampling is used
  105. */
  106. #define SDL_HINT_RENDER_SCALE_QUALITY "SDL_RENDER_SCALE_QUALITY"
  107. /**
  108. * \brief A variable controlling whether updates to the SDL screen surface should be synchronized with the vertical refresh, to avoid tearing.
  109. *
  110. * This variable can be set to the following values:
  111. * "0" - Disable vsync
  112. * "1" - Enable vsync
  113. *
  114. * By default SDL does not sync screen surface updates with vertical refresh.
  115. */
  116. #define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC"
  117. /**
  118. * \brief A variable controlling whether the X11 VidMode extension should be used.
  119. *
  120. * This variable can be set to the following values:
  121. * "0" - Disable XVidMode
  122. * "1" - Enable XVidMode
  123. *
  124. * By default SDL will use XVidMode if it is available.
  125. */
  126. #define SDL_HINT_VIDEO_X11_XVIDMODE "SDL_VIDEO_X11_XVIDMODE"
  127. /**
  128. * \brief A variable controlling whether the X11 Xinerama extension should be used.
  129. *
  130. * This variable can be set to the following values:
  131. * "0" - Disable Xinerama
  132. * "1" - Enable Xinerama
  133. *
  134. * By default SDL will use Xinerama if it is available.
  135. */
  136. #define SDL_HINT_VIDEO_X11_XINERAMA "SDL_VIDEO_X11_XINERAMA"
  137. /**
  138. * \brief A variable controlling whether the X11 XRandR extension should be used.
  139. *
  140. * This variable can be set to the following values:
  141. * "0" - Disable XRandR
  142. * "1" - Enable XRandR
  143. *
  144. * By default SDL will not use XRandR because of window manager issues.
  145. */
  146. #define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR"
  147. /**
  148. * \brief A variable controlling whether grabbing input grabs the keyboard
  149. *
  150. * This variable can be set to the following values:
  151. * "0" - Grab will affect only the mouse
  152. * "1" - Grab will affect mouse and keyboard
  153. *
  154. * By default SDL will not grab the keyboard so system shortcuts still work.
  155. */
  156. #define SDL_HINT_GRAB_KEYBOARD "SDL_GRAB_KEYBOARD"
  157. /**
  158. * \brief A variable controlling whether relative mouse mode is implemented using mouse warping
  159. *
  160. * This variable can be set to the following values:
  161. * "0" - Relative mouse mode uses raw input
  162. * "1" - Relative mouse mode uses mouse warping
  163. *
  164. * By default SDL will use raw input for relative mouse mode
  165. */
  166. #define SDL_HINT_MOUSE_RELATIVE_MODE_WARP "SDL_MOUSE_RELATIVE_MODE_WARP"
  167. /**
  168. * \brief Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to true.
  169. *
  170. */
  171. #define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS"
  172. /**
  173. * \brief Set whether windows go fullscreen in their own spaces on Mac OS X
  174. *
  175. * This variable can be set to the following values:
  176. * "0" - Fullscreen windows will use the classic fullscreen mode
  177. * "1" - Fullscreen windows will use fullscreen spaces
  178. *
  179. * By default SDL will use the classic fullscreen mode.
  180. */
  181. #define SDL_HINT_VIDEO_FULLSCREEN_SPACES "SDL_VIDEO_FULLSCREEN_SPACES"
  182. /**
  183. * \brief A variable controlling whether the idle timer is disabled on iOS.
  184. *
  185. * When an iOS app does not receive touches for some time, the screen is
  186. * dimmed automatically. For games where the accelerometer is the only input
  187. * this is problematic. This functionality can be disabled by setting this
  188. * hint.
  189. *
  190. * This variable can be set to the following values:
  191. * "0" - Enable idle timer
  192. * "1" - Disable idle timer
  193. */
  194. #define SDL_HINT_IDLE_TIMER_DISABLED "SDL_IOS_IDLE_TIMER_DISABLED"
  195. /**
  196. * \brief A variable controlling which orientations are allowed on iOS.
  197. *
  198. * In some circumstances it is necessary to be able to explicitly control
  199. * which UI orientations are allowed.
  200. *
  201. * This variable is a space delimited list of the following values:
  202. * "LandscapeLeft", "LandscapeRight", "Portrait" "PortraitUpsideDown"
  203. */
  204. #define SDL_HINT_ORIENTATIONS "SDL_IOS_ORIENTATIONS"
  205. /**
  206. * \brief A variable controlling whether an Android built-in accelerometer should be
  207. * listed as a joystick device, rather than listing actual joysticks only.
  208. *
  209. * This variable can be set to the following values:
  210. * "0" - List only real joysticks and accept input from them
  211. * "1" - List real joysticks along with the accelerometer as if it were a 3 axis joystick (the default).
  212. */
  213. #define SDL_HINT_ACCEL_AS_JOY "SDL_ACCEL_AS_JOY"
  214. /**
  215. * \brief A variable that lets you disable the detection and use of Xinput gamepad devices
  216. *
  217. * The variable can be set to the following values:
  218. * "0" - Disable XInput timer (only uses direct input)
  219. * "1" - Enable XInput timer (the default)
  220. */
  221. #define SDL_HINT_XINPUT_ENABLED "SDL_XINPUT_ENABLED"
  222. /**
  223. * \brief A variable that lets you manually hint extra gamecontroller db entries
  224. *
  225. * The variable should be newline delimited rows of gamecontroller config data, see SDL_gamecontroller.h
  226. *
  227. * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER)
  228. * You can update mappings after the system is initialized with SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping()
  229. */
  230. #define SDL_HINT_GAMECONTROLLERCONFIG "SDL_GAMECONTROLLERCONFIG"
  231. /**
  232. * \brief A variable that lets you enable joystick (and gamecontroller) events even when your app is in the background.
  233. *
  234. * The variable can be set to the following values:
  235. * "0" - Disable joystick & gamecontroller input events when the
  236. * application is in the background.
  237. * "1" - Enable joystick & gamecontroller input events when the
  238. * application is in the backgroumd.
  239. *
  240. * The default value is "0". This hint may be set at any time.
  241. */
  242. #define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS"
  243. /**
  244. * \brief If set to 0 then never set the top most bit on a SDL Window, even if the video mode expects it.
  245. * This is a debugging aid for developers and not expected to be used by end users. The default is "1"
  246. *
  247. * This variable can be set to the following values:
  248. * "0" - don't allow topmost
  249. * "1" - allow topmost
  250. */
  251. #define SDL_HINT_ALLOW_TOPMOST "SDL_ALLOW_TOPMOST"
  252. /**
  253. * \brief A variable that controls the timer resolution, in milliseconds.
  254. *
  255. * The higher resolution the timer, the more frequently the CPU services
  256. * timer interrupts, and the more precise delays are, but this takes up
  257. * power and CPU time. This hint is only used on Windows 7 and earlier.
  258. *
  259. * See this blog post for more information:
  260. * http://randomascii.wordpress.com/2013/07/08/windows-timer-resolution-megawatts-wasted/
  261. *
  262. * If this variable is set to "0", the system timer resolution is not set.
  263. *
  264. * The default value is "1". This hint may be set at any time.
  265. */
  266. #define SDL_HINT_TIMER_RESOLUTION "SDL_TIMER_RESOLUTION"
  267. /**
  268. * \brief If set to 1, then do not allow high-DPI windows. ("Retina" on Mac)
  269. */
  270. #define SDL_HINT_VIDEO_HIGHDPI_DISABLED "SDL_VIDEO_HIGHDPI_DISABLED"
  271. /**
  272. * \brief A variable that determines whether ctrl+click should generate a right-click event on Mac
  273. *
  274. * If present, holding ctrl while left clicking will generate a right click
  275. * event when on Mac.
  276. */
  277. #define SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK "SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK"
  278. /**
  279. * \brief A variable specifying which shader compiler to preload when using the Chrome ANGLE binaries
  280. *
  281. * SDL has EGL and OpenGL ES2 support on Windows via the ANGLE project. It
  282. * can use two different sets of binaries, those compiled by the user from source
  283. * or those provided by the Chrome browser. In the later case, these binaries require
  284. * that SDL loads
  285. *
  286. * This variable can be set to the following values:
  287. * "d3dcompiler_46.dll" - default, best for Vista or later.
  288. * "d3dcompiler_43.dll" - for XP support.
  289. * "none" - do not load any library, useful if you compiled ANGLE from source and included the compiler in your binaries.
  290. *
  291. */
  292. #define SDL_HINT_VIDEO_WIN_D3DCOMPILER "SDL_VIDEO_WIN_D3DCOMPILER"
  293. /**
  294. * \brief A variable that is the address of another SDL_Window* (as a hex string formatted with "%p").
  295. *
  296. * If this hint is set before SDL_CreateWindowFrom() and the SDL_Window* it is set to has
  297. * SDL_WINDOW_OPENGL set (and running on WGL only, currently), then two things will occur on the newly
  298. * created SDL_Window:
  299. * 1. Its pixel format will be set to the same pixel format as this SDL_Window. This is
  300. * needed for example when sharing an OpenGL context across multiple windows.
  301. *
  302. * 2. The flag SDL_WINDOW_OPENGL will be set on the new window so it can be used for
  303. * OpenGL rendering.
  304. *
  305. * This variable can be set to the following values:
  306. * The address (as a string "%p") of the SDL_Window* that new windows created with SDL_CreateWindowFrom() should
  307. * share a pixel format with.
  308. */
  309. #define SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT "SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT"
  310. /**
  311. * \brief An enumeration of hint priorities
  312. */
  313. typedef enum
  314. {
  315. SDL_HINT_DEFAULT,
  316. SDL_HINT_NORMAL,
  317. SDL_HINT_OVERRIDE
  318. } SDL_HintPriority;
  319. /**
  320. * \brief Set a hint with a specific priority
  321. *
  322. * The priority controls the behavior when setting a hint that already
  323. * has a value. Hints will replace existing hints of their priority and
  324. * lower. Environment variables are considered to have override priority.
  325. *
  326. * \return SDL_TRUE if the hint was set, SDL_FALSE otherwise
  327. */
  328. extern DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name,
  329. const char *value,
  330. SDL_HintPriority priority);
  331. /**
  332. * \brief Set a hint with normal priority
  333. *
  334. * \return SDL_TRUE if the hint was set, SDL_FALSE otherwise
  335. */
  336. extern DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name,
  337. const char *value);
  338. /**
  339. * \brief Get a hint
  340. *
  341. * \return The string value of a hint variable.
  342. */
  343. extern DECLSPEC const char * SDLCALL SDL_GetHint(const char *name);
  344. /**
  345. * \brief Add a function to watch a particular hint
  346. *
  347. * \param name The hint to watch
  348. * \param callback The function to call when the hint value changes
  349. * \param userdata A pointer to pass to the callback function
  350. */
  351. typedef void (*SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue);
  352. extern DECLSPEC void SDLCALL SDL_AddHintCallback(const char *name,
  353. SDL_HintCallback callback,
  354. void *userdata);
  355. /**
  356. * \brief Remove a function watching a particular hint
  357. *
  358. * \param name The hint being watched
  359. * \param callback The function being called when the hint value changes
  360. * \param userdata A pointer being passed to the callback function
  361. */
  362. extern DECLSPEC void SDLCALL SDL_DelHintCallback(const char *name,
  363. SDL_HintCallback callback,
  364. void *userdata);
  365. /**
  366. * \brief Clear all hints
  367. *
  368. * This function is called during SDL_Quit() to free stored hints.
  369. */
  370. extern DECLSPEC void SDLCALL SDL_ClearHints(void);
  371. /* Ends C function definitions when using C++ */
  372. #ifdef __cplusplus
  373. }
  374. #endif
  375. #include "close_code.h"
  376. #endif /* _SDL_hints_h */
  377. /* vi: set ts=4 sw=4 expandtab: */