Rev 1 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1 | Rev 8 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /* |
1 | /* |
2 | Simple DirectMedia Layer |
2 | Simple DirectMedia Layer |
3 | Copyright (C) 1997- |
3 | Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org> |
4 | 4 | ||
5 | This software is provided 'as-is', without any express or implied |
5 | This software is provided 'as-is', without any express or implied |
6 | warranty. In no event will the authors be held liable for any damages |
6 | warranty. In no event will the authors be held liable for any damages |
7 | arising from the use of this software. |
7 | arising from the use of this software. |
8 | 8 | ||
Line 74... | Line 74... | ||
74 | * This variable is case insensitive and can be set to the following values: |
74 | * This variable is case insensitive and can be set to the following values: |
75 | * "direct3d" |
75 | * "direct3d" |
76 | * "opengl" |
76 | * "opengl" |
77 | * "opengles2" |
77 | * "opengles2" |
78 | * "opengles" |
78 | * "opengles" |
- | 79 | * "metal" |
|
79 | * "software" |
80 | * "software" |
80 | * |
81 | * |
81 | * The default varies by platform, but it's the first one in the list that |
82 | * The default varies by platform, but it's the first one in the list that |
82 | * is available on the current platform. |
83 | * is available on the current platform. |
83 | */ |
84 | */ |
Line 207... | Line 208... | ||
207 | * will not always be able to respond to ping requests in a timely manner they can |
208 | * will not always be able to respond to ping requests in a timely manner they can |
208 | * turn it off to avoid the window manager thinking the app is hung. |
209 | * turn it off to avoid the window manager thinking the app is hung. |
209 | * The hint is checked in CreateWindow. |
210 | * The hint is checked in CreateWindow. |
210 | */ |
211 | */ |
211 | #define SDL_HINT_VIDEO_X11_NET_WM_PING "SDL_VIDEO_X11_NET_WM_PING" |
212 | #define SDL_HINT_VIDEO_X11_NET_WM_PING "SDL_VIDEO_X11_NET_WM_PING" |
- | 213 | ||
- | 214 | /** |
|
- | 215 | * \brief A variable controlling whether the X11 _NET_WM_BYPASS_COMPOSITOR hint should be used. |
|
- | 216 | * |
|
- | 217 | * This variable can be set to the following values: |
|
- | 218 | * "0" - Disable _NET_WM_BYPASS_COMPOSITOR |
|
- | 219 | * "1" - Enable _NET_WM_BYPASS_COMPOSITOR |
|
- | 220 | * |
|
- | 221 | * By default SDL will use _NET_WM_BYPASS_COMPOSITOR |
|
- | 222 | * |
|
- | 223 | */ |
|
- | 224 | #define SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR "SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR" |
|
212 | 225 | ||
213 | /** |
226 | /** |
214 | * \brief A variable controlling whether the window frame and title bar are interactive when the cursor is hidden |
227 | * \brief A variable controlling whether the window frame and title bar are interactive when the cursor is hidden |
215 | * |
228 | * |
216 | * This variable can be set to the following values: |
229 | * This variable can be set to the following values: |
Line 246... | Line 259... | ||
246 | * "1" - Grab will affect mouse and keyboard |
259 | * "1" - Grab will affect mouse and keyboard |
247 | * |
260 | * |
248 | * By default SDL will not grab the keyboard so system shortcuts still work. |
261 | * By default SDL will not grab the keyboard so system shortcuts still work. |
249 | */ |
262 | */ |
250 | #define SDL_HINT_GRAB_KEYBOARD "SDL_GRAB_KEYBOARD" |
263 | #define SDL_HINT_GRAB_KEYBOARD "SDL_GRAB_KEYBOARD" |
- | 264 | ||
- | 265 | /** |
|
- | 266 | * \brief A variable setting the double click time, in milliseconds. |
|
- | 267 | */ |
|
- | 268 | #define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME "SDL_MOUSE_DOUBLE_CLICK_TIME" |
|
- | 269 | ||
- | 270 | /** |
|
- | 271 | * \brief A variable setting the double click radius, in pixels. |
|
- | 272 | */ |
|
- | 273 | #define SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS "SDL_MOUSE_DOUBLE_CLICK_RADIUS" |
|
251 | 274 | ||
252 | /** |
275 | /** |
253 | * \brief A variable setting the speed scale for mouse motion, in floating point, when the mouse is not in relative mode |
276 | * \brief A variable setting the speed scale for mouse motion, in floating point, when the mouse is not in relative mode |
254 | */ |
277 | */ |
255 | #define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE "SDL_MOUSE_NORMAL_SPEED_SCALE" |
278 | #define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE "SDL_MOUSE_NORMAL_SPEED_SCALE" |
Line 314... | Line 337... | ||
314 | * "1" - Disable idle timer |
337 | * "1" - Disable idle timer |
315 | */ |
338 | */ |
316 | #define SDL_HINT_IDLE_TIMER_DISABLED "SDL_IOS_IDLE_TIMER_DISABLED" |
339 | #define SDL_HINT_IDLE_TIMER_DISABLED "SDL_IOS_IDLE_TIMER_DISABLED" |
317 | 340 | ||
318 | /** |
341 | /** |
319 | * \brief A variable controlling which orientations are allowed on iOS. |
342 | * \brief A variable controlling which orientations are allowed on iOS/Android. |
320 | * |
343 | * |
321 | * In some circumstances it is necessary to be able to explicitly control |
344 | * In some circumstances it is necessary to be able to explicitly control |
322 | * which UI orientations are allowed. |
345 | * which UI orientations are allowed. |
323 | * |
346 | * |
324 | * This variable is a space delimited list of the following values: |
347 | * This variable is a space delimited list of the following values: |
Line 351... | Line 374... | ||
351 | * This variable can be set to the following values: |
374 | * This variable can be set to the following values: |
352 | * "0" - Remote orientation does not affect joystick axes (the default). |
375 | * "0" - Remote orientation does not affect joystick axes (the default). |
353 | * "1" - Joystick axes are based on the orientation of the remote. |
376 | * "1" - Joystick axes are based on the orientation of the remote. |
354 | */ |
377 | */ |
355 | #define SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION "SDL_APPLE_TV_REMOTE_ALLOW_ROTATION" |
378 | #define SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION "SDL_APPLE_TV_REMOTE_ALLOW_ROTATION" |
- | 379 | ||
- | 380 | /** |
|
- | 381 | * \brief A variable controlling whether the home indicator bar on iPhone X |
|
- | 382 | * should be hidden. |
|
- | 383 | * |
|
- | 384 | * This variable can be set to the following values: |
|
- | 385 | * "0" - The indicator bar is not hidden (default for windowed applications) |
|
- | 386 | * "1" - The indicator bar is hidden and is shown when the screen is touched (useful for movie playback applications) |
|
- | 387 | * "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) |
|
- | 388 | */ |
|
- | 389 | #define SDL_HINT_IOS_HIDE_HOME_INDICATOR "SDL_IOS_HIDE_HOME_INDICATOR" |
|
356 | 390 | ||
357 | /** |
391 | /** |
358 | * \brief A variable controlling whether the Android / iOS built-in |
392 | * \brief A variable controlling whether the Android / iOS built-in |
359 | * accelerometer should be listed as a joystick |
393 | * accelerometer should be listed as a joystick device. |
360 | * actual joysticks only. |
- | |
361 | * |
394 | * |
362 | * This variable can be set to the following values: |
395 | * This variable can be set to the following values: |
363 | * "0" - |
396 | * "0" - The accelerometer is not listed as a joystick |
364 | * "1" - |
397 | * "1" - The accelerometer is available as a 3 axis joystick (the default). |
365 | */ |
398 | */ |
366 | #define SDL_HINT_ACCELEROMETER_AS_JOYSTICK "SDL_ACCELEROMETER_AS_JOYSTICK" |
399 | #define SDL_HINT_ACCELEROMETER_AS_JOYSTICK "SDL_ACCELEROMETER_AS_JOYSTICK" |
- | 400 | ||
- | 401 | /** |
|
- | 402 | * \brief A variable controlling whether the Android / tvOS remotes |
|
- | 403 | * should be listed as joystick devices, instead of sending keyboard events. |
|
- | 404 | * |
|
- | 405 | * This variable can be set to the following values: |
|
- | 406 | * "0" - Remotes send enter/escape/arrow key events |
|
- | 407 | * "1" - Remotes are available as 2 axis, 2 button joysticks (the default). |
|
- | 408 | */ |
|
- | 409 | #define SDL_HINT_TV_REMOTE_AS_JOYSTICK "SDL_TV_REMOTE_AS_JOYSTICK" |
|
367 | 410 | ||
368 | /** |
411 | /** |
369 | * \brief A variable that lets you disable the detection and use of Xinput gamepad devices |
412 | * \brief A variable that lets you disable the detection and use of Xinput gamepad devices |
370 | * |
413 | * |
371 | * The variable can be set to the following values: |
414 | * The variable can be set to the following values: |
Line 429... | Line 472... | ||
429 | * application is in the background. |
472 | * application is in the background. |
430 | * |
473 | * |
431 | * The default value is "0". This hint may be set at any time. |
474 | * The default value is "0". This hint may be set at any time. |
432 | */ |
475 | */ |
433 | #define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS" |
476 | #define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS" |
- | 477 | ||
- | 478 | /** |
|
- | 479 | * \brief A variable controlling whether the HIDAPI joystick drivers should be used. |
|
- | 480 | * |
|
- | 481 | * This variable can be set to the following values: |
|
- | 482 | * "0" - HIDAPI drivers are not used |
|
- | 483 | * "1" - HIDAPI drivers are used (the default) |
|
- | 484 | * |
|
- | 485 | * This variable is the default for all drivers, but can be overridden by the hints for specific drivers below. |
|
- | 486 | */ |
|
- | 487 | #define SDL_HINT_JOYSTICK_HIDAPI "SDL_JOYSTICK_HIDAPI" |
|
- | 488 | ||
- | 489 | /** |
|
- | 490 | * \brief A variable controlling whether the HIDAPI driver for PS4 controllers should be used. |
|
- | 491 | * |
|
- | 492 | * This variable can be set to the following values: |
|
- | 493 | * "0" - HIDAPI driver is not used |
|
- | 494 | * "1" - HIDAPI driver is used |
|
- | 495 | * |
|
- | 496 | * The default is the value of SDL_HINT_JOYSTICK_HIDAPI |
|
- | 497 | */ |
|
- | 498 | #define SDL_HINT_JOYSTICK_HIDAPI_PS4 "SDL_JOYSTICK_HIDAPI_PS4" |
|
- | 499 | ||
- | 500 | /** |
|
- | 501 | * \brief A variable controlling whether extended input reports should be used for PS4 controllers when using the HIDAPI driver. |
|
- | 502 | * |
|
- | 503 | * This variable can be set to the following values: |
|
- | 504 | * "0" - extended reports are not enabled (the default) |
|
- | 505 | * "1" - extended reports |
|
- | 506 | * |
|
- | 507 | * Extended input reports allow rumble on Bluetooth PS4 controllers, but |
|
- | 508 | * break DirectInput handling for applications that don't use SDL. |
|
- | 509 | * |
|
- | 510 | * Once extended reports are enabled, they can not be disabled without |
|
- | 511 | * power cycling the controller. |
|
- | 512 | */ |
|
- | 513 | #define SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE "SDL_JOYSTICK_HIDAPI_PS4_RUMBLE" |
|
- | 514 | ||
- | 515 | /** |
|
- | 516 | * \brief A variable controlling whether the HIDAPI driver for Steam Controllers should be used. |
|
- | 517 | * |
|
- | 518 | * This variable can be set to the following values: |
|
- | 519 | * "0" - HIDAPI driver is not used |
|
- | 520 | * "1" - HIDAPI driver is used |
|
- | 521 | * |
|
- | 522 | * The default is the value of SDL_HINT_JOYSTICK_HIDAPI |
|
- | 523 | */ |
|
- | 524 | #define SDL_HINT_JOYSTICK_HIDAPI_STEAM "SDL_JOYSTICK_HIDAPI_STEAM" |
|
- | 525 | ||
- | 526 | /** |
|
- | 527 | * \brief A variable controlling whether the HIDAPI driver for Nintendo Switch controllers should be used. |
|
- | 528 | * |
|
- | 529 | * This variable can be set to the following values: |
|
- | 530 | * "0" - HIDAPI driver is not used |
|
- | 531 | * "1" - HIDAPI driver is used |
|
- | 532 | * |
|
- | 533 | * The default is the value of SDL_HINT_JOYSTICK_HIDAPI |
|
- | 534 | */ |
|
- | 535 | #define SDL_HINT_JOYSTICK_HIDAPI_SWITCH "SDL_JOYSTICK_HIDAPI_SWITCH" |
|
- | 536 | ||
- | 537 | /** |
|
- | 538 | * \brief A variable controlling whether the HIDAPI driver for XBox controllers should be used. |
|
- | 539 | * |
|
- | 540 | * This variable can be set to the following values: |
|
- | 541 | * "0" - HIDAPI driver is not used |
|
- | 542 | * "1" - HIDAPI driver is used |
|
- | 543 | * |
|
- | 544 | * The default is the value of SDL_HINT_JOYSTICK_HIDAPI |
|
- | 545 | */ |
|
- | 546 | #define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX" |
|
- | 547 | ||
- | 548 | /** |
|
- | 549 | * \brief A variable that controls whether Steam Controllers should be exposed using the SDL joystick and game controller APIs |
|
- | 550 | * |
|
- | 551 | * The variable can be set to the following values: |
|
- | 552 | * "0" - Do not scan for Steam Controllers |
|
- | 553 | * "1" - Scan for Steam Controllers (the default) |
|
- | 554 | * |
|
- | 555 | * The default value is "1". This hint must be set before initializing the joystick subsystem. |
|
- | 556 | */ |
|
- | 557 | #define SDL_HINT_ENABLE_STEAM_CONTROLLERS "SDL_ENABLE_STEAM_CONTROLLERS" |
|
- | 558 | ||
434 | 559 | ||
435 | /** |
560 | /** |
436 | * \brief If set to "0" then never set the top most bit on a SDL Window, even if the video mode expects it. |
561 | * \brief If set to "0" then never set the top most bit on a SDL Window, even if the video mode expects it. |
437 | * This is a debugging aid for developers and not expected to be used by end users. The default is "1" |
562 | * This is a debugging aid for developers and not expected to be used by end users. The default is "1" |
438 | * |
563 | * |
Line 492... | Line 617... | ||
492 | * |
617 | * |
493 | * Use this hint in case you need to set SDL's threads stack size to other than the default. |
618 | * Use this hint in case you need to set SDL's threads stack size to other than the default. |
494 | * This is specially useful if you build SDL against a non glibc libc library (such as musl) which |
619 | * This is specially useful if you build SDL against a non glibc libc library (such as musl) which |
495 | * provides a relatively small default thread stack size (a few kilobytes versus the default 8MB glibc uses). |
620 | * provides a relatively small default thread stack size (a few kilobytes versus the default 8MB glibc uses). |
496 | * Support for this hint is currently available only in the pthread, Windows, and PSP backend. |
621 | * Support for this hint is currently available only in the pthread, Windows, and PSP backend. |
- | 622 | * |
|
- | 623 | * Instead of this hint, in 2.0.9 and later, you can use |
|
- | 624 | * SDL_CreateThreadWithStackSize(). This hint only works with the classic |
|
- | 625 | * SDL_CreateThread(). |
|
497 | */ |
626 | */ |
498 | #define SDL_HINT_THREAD_STACK_SIZE "SDL_THREAD_STACK_SIZE" |
627 | #define SDL_HINT_THREAD_STACK_SIZE "SDL_THREAD_STACK_SIZE" |
499 | 628 | ||
500 | /** |
629 | /** |
501 | * \brief If set to 1, then do not allow high-DPI windows. ("Retina" on Mac and iOS) |
630 | * \brief If set to 1, then do not allow high-DPI windows. ("Retina" on Mac and iOS) |
Line 716... | Line 845... | ||
716 | * "1" - Mouse events will be handled separately from pure touch events. |
845 | * "1" - Mouse events will be handled separately from pure touch events. |
717 | * |
846 | * |
718 | * The value of this hint is used at runtime, so it can be changed at any time. |
847 | * The value of this hint is used at runtime, so it can be changed at any time. |
719 | */ |
848 | */ |
720 | #define SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH "SDL_ANDROID_SEPARATE_MOUSE_AND_TOUCH" |
849 | #define SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH "SDL_ANDROID_SEPARATE_MOUSE_AND_TOUCH" |
- | 850 | ||
- | 851 | /** |
|
- | 852 | * \brief A variable to control whether we trap the Android back button to handle it manually. |
|
- | 853 | * This is necessary for the right mouse button to work on some Android devices, or |
|
- | 854 | * to be able to trap the back button for use in your code reliably. If set to true, |
|
- | 855 | * the back button will show up as an SDL_KEYDOWN / SDL_KEYUP pair with a keycode of |
|
- | 856 | * SDL_SCANCODE_AC_BACK. |
|
- | 857 | * |
|
- | 858 | * The variable can be set to the following values: |
|
- | 859 | * "0" - Back button will be handled as usual for system. (default) |
|
- | 860 | * "1" - Back button will be trapped, allowing you to handle the key press |
|
- | 861 | * manually. (This will also let right mouse click work on systems |
|
- | 862 | * where the right mouse button functions as back.) |
|
- | 863 | * |
|
- | 864 | * The value of this hint is used at runtime, so it can be changed at any time. |
|
- | 865 | */ |
|
- | 866 | #define SDL_HINT_ANDROID_TRAP_BACK_BUTTON "SDL_ANDROID_TRAP_BACK_BUTTON" |
|
- | 867 | ||
- | 868 | /** |
|
- | 869 | * \brief A variable to control whether the return key on the soft keyboard |
|
- | 870 | * should hide the soft keyboard on Android and iOS. |
|
- | 871 | * |
|
- | 872 | * The variable can be set to the following values: |
|
- | 873 | * "0" - The return key will be handled as a key event. This is the behaviour of SDL <= 2.0.3. (default) |
|
- | 874 | * "1" - The return key will hide the keyboard. |
|
- | 875 | * |
|
- | 876 | * The value of this hint is used at runtime, so it can be changed at any time. |
|
- | 877 | */ |
|
- | 878 | #define SDL_HINT_RETURN_KEY_HIDES_IME "SDL_RETURN_KEY_HIDES_IME" |
|
721 | 879 | ||
722 | /** |
880 | /** |
723 | * \brief override the binding element for keyboard inputs for Emscripten builds |
881 | * \brief override the binding element for keyboard inputs for Emscripten builds |
724 | * |
882 | * |
725 | * This hint only applies to the emscripten platform |
883 | * This hint only applies to the emscripten platform |
Line 750... | Line 908... | ||
750 | * |
908 | * |
751 | * The variable can be set to the following values: |
909 | * The variable can be set to the following values: |
752 | * "0" - SDL will generate a window-close event when it sees Alt+F4. |
910 | * "0" - SDL will generate a window-close event when it sees Alt+F4. |
753 | * "1" - SDL will only do normal key handling for Alt+F4. |
911 | * "1" - SDL will only do normal key handling for Alt+F4. |
754 | */ |
912 | */ |
755 | #define SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 |
913 | #define SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 "SDL_WINDOWS_NO_CLOSE_ON_ALT_F4" |
756 | 914 | ||
757 | /** |
915 | /** |
758 | * \brief Prevent SDL from using version 4 of the bitmap header when saving BMPs. |
916 | * \brief Prevent SDL from using version 4 of the bitmap header when saving BMPs. |
759 | * |
917 | * |
760 | * The bitmap header version 4 is required for proper alpha channel support and |
918 | * The bitmap header version 4 is required for proper alpha channel support and |
Line 794... | Line 952... | ||
794 | * |
952 | * |
795 | * Also known as Z-order. The variable can take a negative or positive value. |
953 | * Also known as Z-order. The variable can take a negative or positive value. |
796 | * The default is 10000. |
954 | * The default is 10000. |
797 | */ |
955 | */ |
798 | #define SDL_HINT_RPI_VIDEO_LAYER "SDL_RPI_VIDEO_LAYER" |
956 | #define SDL_HINT_RPI_VIDEO_LAYER "SDL_RPI_VIDEO_LAYER" |
- | 957 | ||
- | 958 | /** |
|
- | 959 | * \brief Tell the video driver that we only want a double buffer. |
|
- | 960 | * |
|
- | 961 | * By default, most lowlevel 2D APIs will use a triple buffer scheme that |
|
- | 962 | * wastes no CPU time on waiting for vsync after issuing a flip, but |
|
- | 963 | * introduces a frame of latency. On the other hand, using a double buffer |
|
- | 964 | * scheme instead is recommended for cases where low latency is an important |
|
- | 965 | * factor because we save a whole frame of latency. |
|
- | 966 | * We do so by waiting for vsync immediately after issuing a flip, usually just |
|
- | 967 | * after eglSwapBuffers call in the backend's *_SwapWindow function. |
|
- | 968 | * |
|
- | 969 | * Since it's driver-specific, it's only supported where possible and |
|
- | 970 | * implemented. Currently supported the following drivers: |
|
- | 971 | * - KMSDRM (kmsdrm) |
|
- | 972 | * - Raspberry Pi (raspberrypi) |
|
- | 973 | */ |
|
- | 974 | #define SDL_HINT_VIDEO_DOUBLE_BUFFER "SDL_VIDEO_DOUBLE_BUFFER" |
|
799 | 975 | ||
800 | /** |
976 | /** |
801 | * \brief A variable controlling what driver to use for OpenGL ES contexts. |
977 | * \brief A variable controlling what driver to use for OpenGL ES contexts. |
802 | * |
978 | * |
803 | * On some platforms, currently Windows and X11, OpenGL drivers may support |
979 | * On some platforms, currently Windows and X11, OpenGL drivers may support |