mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-22 04:38:30 +00:00
Implemented SDL_GetHintBoolean() to make it easier to check boolean hints
This commit is contained in:
parent
92d700f199
commit
27d4f09929
26 changed files with 68 additions and 136 deletions
|
@ -118,6 +118,19 @@ SDL_GetHint(const char *name)
|
|||
return env;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_GetHintBoolean(const char *name, SDL_bool default_value)
|
||||
{
|
||||
const char *hint = SDL_GetHint(name);
|
||||
if (!hint) {
|
||||
return default_value;
|
||||
}
|
||||
if (*hint == '0' || SDL_strcasecmp(hint, "false") == 0) {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
return SDL_TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userdata)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue