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