zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SDL_hints.h File Reference
#include "SDL_stdinc.h"
#include "begin_code.h"
#include "close_code.h"

Go to the source code of this file.

Macros

#define SDL_HINT_ALLOW_TOPMOST   "SDL_ALLOW_TOPMOST"
 If set to 0 then never set the top most bit on a SDL Window, even if the video mode expects it. This is a debugging aid for developers and not expected to be used by end users. The default is "1". More...
 
#define SDL_HINT_FRAMEBUFFER_ACCELERATION   "SDL_FRAMEBUFFER_ACCELERATION"
 A variable controlling how 3D acceleration is used to accelerate the SDL screen surface. More...
 
#define SDL_HINT_GAMECONTROLLERCONFIG   "SDL_GAMECONTROLLERCONFIG"
 A variable that lets you manually hint extra gamecontroller db entries. More...
 
#define SDL_HINT_GRAB_KEYBOARD   "SDL_GRAB_KEYBOARD"
 A variable controlling whether grabbing input grabs the keyboard. More...
 
#define SDL_HINT_IDLE_TIMER_DISABLED   "SDL_IOS_IDLE_TIMER_DISABLED"
 A variable controlling whether the idle timer is disabled on iOS. More...
 
#define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS   "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS"
 A variable that lets you enable joystick (and gamecontroller) events even when your app is in the background. More...
 
#define SDL_HINT_ORIENTATIONS   "SDL_IOS_ORIENTATIONS"
 A variable controlling which orientations are allowed on iOS. More...
 
#define SDL_HINT_RENDER_DIRECT3D_THREADSAFE   "SDL_RENDER_DIRECT3D_THREADSAFE"
 A variable controlling whether the Direct3D device is initialized for thread-safe operations. More...
 
#define SDL_HINT_RENDER_DRIVER   "SDL_RENDER_DRIVER"
 A variable specifying which render driver to use. More...
 
#define SDL_HINT_RENDER_OPENGL_SHADERS   "SDL_RENDER_OPENGL_SHADERS"
 A variable controlling whether the OpenGL render driver uses shaders if they are available. More...
 
#define SDL_HINT_RENDER_SCALE_QUALITY   "SDL_RENDER_SCALE_QUALITY"
 A variable controlling the scaling quality. More...
 
#define SDL_HINT_RENDER_VSYNC   "SDL_RENDER_VSYNC"
 A variable controlling whether updates to the SDL screen surface should be synchronized with the vertical refresh, to avoid tearing. More...
 
#define SDL_HINT_TIMER_RESOLUTION   "SDL_TIMER_RESOLUTION"
 A variable that controls the timer resolution, in milliseconds. More...
 
#define SDL_HINT_VIDEO_HIGHDPI_DISABLED   "SDL_VIDEO_HIGHDPI_DISABLED"
 If set to 1, then do not allow high-DPI windows. ("Retina" on Mac) More...
 
#define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS   "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS"
 Minimize your SDL_Window if it loses key focus when in Fullscreen mode. Defaults to true. More...
 
#define SDL_HINT_VIDEO_X11_XINERAMA   "SDL_VIDEO_X11_XINERAMA"
 A variable controlling whether the X11 Xinerama extension should be used. More...
 
#define SDL_HINT_VIDEO_X11_XRANDR   "SDL_VIDEO_X11_XRANDR"
 A variable controlling whether the X11 XRandR extension should be used. More...
 
#define SDL_HINT_VIDEO_X11_XVIDMODE   "SDL_VIDEO_X11_XVIDMODE"
 A variable controlling whether the X11 VidMode extension should be used. More...
 
#define SDL_HINT_XINPUT_ENABLED   "SDL_XINPUT_ENABLED"
 A variable that lets you disable the detection and use of Xinput gamepad devices. More...
 

Typedefs

typedef void(* SDL_HintCallback )(void *userdata, const char *name, const char *oldValue, const char *newValue)
 Add a function to watch a particular hint. More...
 

Enumerations

enum  SDL_HintPriority { SDL_HINT_DEFAULT, SDL_HINT_NORMAL, SDL_HINT_OVERRIDE }
 An enumeration of hint priorities. More...
 

Functions

DECLSPEC void SDLCALL SDL_AddHintCallback (const char *name, SDL_HintCallback callback, void *userdata)
 
DECLSPEC void SDLCALL SDL_ClearHints (void)
 Clear all hints. More...
 
DECLSPEC void SDLCALL SDL_DelHintCallback (const char *name, SDL_HintCallback callback, void *userdata)
 Remove a function watching a particular hint. More...
 
DECLSPEC const char *SDLCALL SDL_GetHint (const char *name)
 Get a hint. More...
 
DECLSPEC SDL_bool SDLCALL SDL_SetHint (const char *name, const char *value)
 Set a hint with normal priority. More...
 
DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority (const char *name, const char *value, SDL_HintPriority priority)
 Set a hint with a specific priority. More...
 

Detailed Description

Official documentation for SDL configuration variables

This file contains functions to set and get configuration hints, as well as listing each of them alphabetically.

The convention for naming hints is SDL_HINT_X, where "SDL_X" is the environment variable that can be used to override the default.

In general these hints are just that - they may or may not be supported or applicable on any given platform, but they provide a way for an application or user to give the library a hint as to how they would like the library to work.

Definition in file SDL_hints.h.

Macro Definition Documentation

#define SDL_HINT_ALLOW_TOPMOST   "SDL_ALLOW_TOPMOST"

If set to 0 then never set the top most bit on a SDL Window, even if the video mode expects it. This is a debugging aid for developers and not expected to be used by end users. The default is "1".

This variable can be set to the following values: "0" - don't allow topmost "1" - allow topmost

Definition at line 251 of file SDL_hints.h.

Referenced by SDL_ShouldAllowTopmost().

#define SDL_HINT_FRAMEBUFFER_ACCELERATION   "SDL_FRAMEBUFFER_ACCELERATION"

A variable controlling how 3D acceleration is used to accelerate the SDL screen surface.

SDL can try to accelerate the SDL screen surface by using streaming textures with a 3D rendering engine. This variable controls whether and how this is done.

This variable can be set to the following values: "0" - Disable 3D acceleration "1" - Enable 3D acceleration, using the default renderer. "X" - Enable 3D acceleration, using X where X is one of the valid rendering drivers. (e.g. "direct3d", "opengl", etc.)

By default SDL tries to make a best guess for each platform whether to use acceleration or not.

Definition at line 65 of file SDL_hints.h.

Referenced by SDL_CreateWindowTexture(), and ShouldUseTextureFramebuffer().

#define SDL_HINT_GAMECONTROLLERCONFIG   "SDL_GAMECONTROLLERCONFIG"

A variable that lets you manually hint extra gamecontroller db entries.

The variable should be newline delimited rows of gamecontroller config data, see SDL_gamecontroller.h

This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) You can update mappings after the system is initialized with SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping()

Definition at line 226 of file SDL_hints.h.

Referenced by SDL_GameControllerLoadHints().

#define SDL_HINT_GRAB_KEYBOARD   "SDL_GRAB_KEYBOARD"

A variable controlling whether grabbing input grabs the keyboard.

This variable can be set to the following values: "0" - Grab will affect only the mouse "1" - Grab will affect mouse and keyboard

By default SDL will not grab the keyboard so system shortcuts still work.

Definition at line 173 of file SDL_hints.h.

#define SDL_HINT_IDLE_TIMER_DISABLED   "SDL_IOS_IDLE_TIMER_DISABLED"

A variable controlling whether the idle timer is disabled on iOS.

When an iOS app does not receive touches for some time, the screen is dimmed automatically. For games where the accelerometer is the only input this is problematic. This functionality can be disabled by setting this hint.

This variable can be set to the following values: "0" - Enable idle timer "1" - Disable idle timer

Definition at line 194 of file SDL_hints.h.

#define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS   "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS"

A variable that lets you enable joystick (and gamecontroller) events even when your app is in the background.

The variable can be set to the following values: "0" - Disable joystick & gamecontroller input events when the application is in the background. "1" - Enable joystick & gamecontroller input events when the application is in the backgroumd.

The default value is "0". This hint may be set at any time.

Definition at line 240 of file SDL_hints.h.

Referenced by SDL_JoystickInit().

#define SDL_HINT_ORIENTATIONS   "SDL_IOS_ORIENTATIONS"

A variable controlling which orientations are allowed on iOS.

In some circumstances it is necessary to be able to explicitly control which UI orientations are allowed.

This variable is a space delimited list of the following values: "LandscapeLeft", "LandscapeRight", "Portrait" "PortraitUpsideDown"

Definition at line 205 of file SDL_hints.h.

#define SDL_HINT_RENDER_DIRECT3D_THREADSAFE   "SDL_RENDER_DIRECT3D_THREADSAFE"

A variable controlling whether the Direct3D device is initialized for thread-safe operations.

This variable can be set to the following values: "0" - Thread-safety is not enabled (faster) "1" - Thread-safety is enabled

By default the Direct3D device is created with thread-safety disabled.

Definition at line 106 of file SDL_hints.h.

#define SDL_HINT_RENDER_DRIVER   "SDL_RENDER_DRIVER"

A variable specifying which render driver to use.

If the application doesn't pick a specific renderer to use, this variable specifies the name of the preferred renderer. If the preferred renderer can't be initialized, the normal default renderer is used.

This variable is case insensitive and can be set to the following values: "direct3d" "opengl" "opengles2" "opengles" "software"

The default varies by platform, but it's the first one in the list that is available on the current platform.

Definition at line 84 of file SDL_hints.h.

Referenced by SDL_CreateRenderer(), and ShouldUseTextureFramebuffer().

#define SDL_HINT_RENDER_OPENGL_SHADERS   "SDL_RENDER_OPENGL_SHADERS"

A variable controlling whether the OpenGL render driver uses shaders if they are available.

This variable can be set to the following values: "0" - Disable shaders "1" - Enable shaders

By default shaders are used if OpenGL supports them.

Definition at line 95 of file SDL_hints.h.

#define SDL_HINT_RENDER_SCALE_QUALITY   "SDL_RENDER_SCALE_QUALITY"

A variable controlling the scaling quality.

This variable can be set to the following values: "0" or "nearest" - Nearest pixel sampling "1" or "linear" - Linear filtering (supported by OpenGL and Direct3D) "2" or "best" - Currently this is the same as "linear"

By default nearest pixel sampling is used

Definition at line 118 of file SDL_hints.h.

Referenced by GetScaleQuality().

#define SDL_HINT_RENDER_VSYNC   "SDL_RENDER_VSYNC"

A variable controlling whether updates to the SDL screen surface should be synchronized with the vertical refresh, to avoid tearing.

This variable can be set to the following values: "0" - Disable vsync "1" - Enable vsync

By default SDL does not sync screen surface updates with vertical refresh.

Definition at line 129 of file SDL_hints.h.

Referenced by SDL_CreateRenderer().

#define SDL_HINT_TIMER_RESOLUTION   "SDL_TIMER_RESOLUTION"

A variable that controls the timer resolution, in milliseconds.

The higher resolution the timer, the more frequently the CPU services timer interrupts, and the more precise delays are, but this takes up power and CPU time. This hint is only used on Windows 7 and earlier.

See this blog post for more information: http://randomascii.wordpress.com/2013/07/08/windows-timer-resolution-megawatts-wasted/

If this variable is set to "0", the system timer resolution is not set.

The default value is "1". This hint may be set at any time.

Definition at line 268 of file SDL_hints.h.

#define SDL_HINT_VIDEO_HIGHDPI_DISABLED   "SDL_VIDEO_HIGHDPI_DISABLED"

If set to 1, then do not allow high-DPI windows. ("Retina" on Mac)

Definition at line 274 of file SDL_hints.h.

Referenced by SDL_CreateWindow().

#define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS   "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS"

Minimize your SDL_Window if it loses key focus when in Fullscreen mode. Defaults to true.

Definition at line 179 of file SDL_hints.h.

Referenced by ShouldMinimizeOnFocusLoss().

#define SDL_HINT_VIDEO_X11_XINERAMA   "SDL_VIDEO_X11_XINERAMA"

A variable controlling whether the X11 Xinerama extension should be used.

This variable can be set to the following values: "0" - Disable Xinerama "1" - Enable Xinerama

By default SDL will use Xinerama if it is available.

Definition at line 151 of file SDL_hints.h.

#define SDL_HINT_VIDEO_X11_XRANDR   "SDL_VIDEO_X11_XRANDR"

A variable controlling whether the X11 XRandR extension should be used.

This variable can be set to the following values: "0" - Disable XRandR "1" - Enable XRandR

By default SDL will not use XRandR because of window manager issues.

Definition at line 162 of file SDL_hints.h.

#define SDL_HINT_VIDEO_X11_XVIDMODE   "SDL_VIDEO_X11_XVIDMODE"

A variable controlling whether the X11 VidMode extension should be used.

This variable can be set to the following values: "0" - Disable XVidMode "1" - Enable XVidMode

By default SDL will use XVidMode if it is available.

Definition at line 140 of file SDL_hints.h.

#define SDL_HINT_XINPUT_ENABLED   "SDL_XINPUT_ENABLED"

A variable that lets you disable the detection and use of Xinput gamepad devices.

The variable can be set to the following values: "0" - Disable XInput timer (only uses direct input) "1" - Enable XInput timer (the default)

Definition at line 215 of file SDL_hints.h.

Typedef Documentation

typedef void(* SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue)

Add a function to watch a particular hint.

Parameters
nameThe hint to watch
callbackThe function to call when the hint value changes
userdataA pointer to pass to the callback function

Definition at line 323 of file SDL_hints.h.

Enumeration Type Documentation

An enumeration of hint priorities.

Enumerator
SDL_HINT_DEFAULT 
SDL_HINT_NORMAL 
SDL_HINT_OVERRIDE 

Definition at line 280 of file SDL_hints.h.

Function Documentation

DECLSPEC void SDLCALL SDL_AddHintCallback ( const char *  name,
SDL_HintCallback  callback,
void userdata 
)
DECLSPEC void SDLCALL SDL_ClearHints ( void  )

Clear all hints.

This function is called during SDL_Quit() to free stored hints.

Definition at line 197 of file SDL_hints.c.

References SDL_free(), and SDL_hints.

Referenced by SDL_Quit().

DECLSPEC void SDLCALL SDL_DelHintCallback ( const char *  name,
SDL_HintCallback  callback,
void userdata 
)

Remove a function watching a particular hint.

Parameters
nameThe hint being watched
callbackThe function being called when the hint value changes
userdataA pointer being passed to the callback function

Definition at line 172 of file SDL_hints.c.

References NULL, SDL_free(), and SDL_strcmp().

Referenced by SDL_AddHintCallback().

DECLSPEC SDL_bool SDLCALL SDL_SetHint ( const char *  name,
const char *  value 
)

Set a hint with normal priority.

Returns
SDL_TRUE if the hint was set, SDL_FALSE otherwise

Definition at line 98 of file SDL_hints.c.

References SDL_HINT_NORMAL, and SDL_SetHintWithPriority().

DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority ( const char *  name,
const char *  value,
SDL_HintPriority  priority 
)

Set a hint with a specific priority.

The priority controls the behavior when setting a hint that already has a value. Hints will replace existing hints of their priority and lower. Environment variables are considered to have override priority.

Returns
SDL_TRUE if the hint was set, SDL_FALSE otherwise

Definition at line 47 of file SDL_hints.c.

References env, NULL, SDL_FALSE, SDL_free(), SDL_getenv(), SDL_HINT_OVERRIDE, SDL_hints, SDL_malloc(), SDL_strcmp(), SDL_strdup(), and SDL_TRUE.

Referenced by SDL_SetHint().