Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Created a simpler version of SDL_SetHint() that doesn't need a priority.
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Feb 6, 2011
1 parent 8938cbf commit b52f716
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
15 changes: 12 additions & 3 deletions include/SDL_hints.h
Expand Up @@ -106,17 +106,26 @@ typedef enum


/**
* \brief Set a hint
* \brief 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.
*
* \return SDL_TRUE if the hint was set, SDL_FALSE otherwise
*/
extern DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name,
const char *value,
SDL_HintPriority priority);

/**
* \brief Set a hint with normal priority
*
* \return SDL_TRUE if the hint was set, SDL_FALSE otherwise
*/
extern DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name,
const char *value,
SDL_HintPriority priority);
const char *value);


/**
* \brief Get a hint
Expand Down
9 changes: 8 additions & 1 deletion src/SDL_hints.c
Expand Up @@ -38,7 +38,8 @@ static SDL_Hint *SDL_hints;


SDL_bool
SDL_SetHint(const char *name, const char *value, SDL_HintPriority priority)
SDL_SetHintWithPriority(const char *name, const char *value,
SDL_HintPriority priority)
{
const char *env;
SDL_Hint *prev, *hint;
Expand Down Expand Up @@ -80,6 +81,12 @@ SDL_SetHint(const char *name, const char *value, SDL_HintPriority priority)
return SDL_TRUE;
}

SDL_bool
SDL_SetHint(const char *name, const char *value)
{
return SDL_SetHintWithPriority(name, value, SDL_HINT_NORMAL);
}

const char *
SDL_GetHint(const char *name)
{
Expand Down

0 comments on commit b52f716

Please sign in to comment.