SDL standard library

Dependents:   H261_encoder

Embed: (wiki syntax)

« Back to documentation index

SDL_hints.h File Reference

SDL_hints.h File Reference

Official documentation for SDL configuration variables. More...

Go to the source code of this file.

Typedefs

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

Enumerations

enum  SDL_HintPriority
 

An enumeration of hint priorities.

More...

Functions

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

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.


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 416 of file SDL_hints.h.


Enumeration Type Documentation

An enumeration of hint priorities.

Definition at line 373 of file SDL_hints.h.


Function Documentation

DECLSPEC void SDLCALL SDL_ClearHints ( void   )

Clear all hints.

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

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
DECLSPEC const char* SDLCALL SDL_GetHint ( const char *  name )

Get a hint.

Returns:
The string value of a hint variable.
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
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