src/SDL_hints.c
changeset 10499 363c1c7e7a41
parent 9998 f67cf37e9cd4
child 10737 3406a0f8b041
     1.1 --- a/src/SDL_hints.c	Fri Sep 30 09:26:57 2016 -0400
     1.2 +++ b/src/SDL_hints.c	Fri Oct 07 23:40:44 2016 -0700
     1.3 @@ -118,6 +118,19 @@
     1.4      return env;
     1.5  }
     1.6  
     1.7 +SDL_bool
     1.8 +SDL_GetHintBoolean(const char *name, SDL_bool default_value)
     1.9 +{
    1.10 +    const char *hint = SDL_GetHint(name);
    1.11 +    if (!hint) {
    1.12 +        return default_value;
    1.13 +    }
    1.14 +    if (*hint == '0' || SDL_strcasecmp(hint, "false") == 0) {
    1.15 +        return SDL_FALSE;
    1.16 +    }
    1.17 +    return SDL_TRUE;
    1.18 +}
    1.19 +
    1.20  void
    1.21  SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userdata)
    1.22  {