include/SDL_hints.h
author Sam Lantinga <slouken@libsdl.org>
Sat, 05 Feb 2011 10:02:39 -0800
changeset 5189 6f6a9340fb93
child 5190 82a48f4d65f6
permissions -rw-r--r--
Added a hint system to allow configuration hints to be specified by the application.
slouken@5189
     1
/*
slouken@5189
     2
    SDL - Simple DihintsMedia Layer
slouken@5189
     3
    Copyright (C) 1997-2010 Sam Lantinga
slouken@5189
     4
slouken@5189
     5
    This library is free software; you can redistribute it and/or
slouken@5189
     6
    modify it under the terms of the GNU Lesser General Public
slouken@5189
     7
    License as published by the Free Software Foundation; either
slouken@5189
     8
    version 2.1 of the License, or (at your option) any later version.
slouken@5189
     9
slouken@5189
    10
    This library is distributed in the hope that it will be useful,
slouken@5189
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@5189
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@5189
    13
    Lesser General Public License for more details.
slouken@5189
    14
slouken@5189
    15
    You should have received a copy of the GNU Lesser General Public
slouken@5189
    16
    License along with this library; if not, write to the Free Software
slouken@5189
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
slouken@5189
    18
slouken@5189
    19
    Sam Lantinga
slouken@5189
    20
    slouken@libsdl.org
slouken@5189
    21
*/
slouken@5189
    22
slouken@5189
    23
/**
slouken@5189
    24
 *  \file SDL_hints.h
slouken@5189
    25
 *  
slouken@5189
    26
 *  Official documentation for SDL configuration variables
slouken@5189
    27
 *
slouken@5189
    28
 *  This file contains functions to set and get configuration hints,
slouken@5189
    29
 *  as well as listing each of them alphabetically.
slouken@5189
    30
 *
slouken@5189
    31
 *  The convention for naming hints is SDL_HINT_X, where "SDL_X" is
slouken@5189
    32
 *  the environment variable that can be used to override the default.
slouken@5189
    33
 *
slouken@5189
    34
 *  In general these hints are just that - they may or may not be
slouken@5189
    35
 *  supported or applicable on any given platform, but they provide
slouken@5189
    36
 *  a way for an application or user to give the library a hint as
slouken@5189
    37
 *  to how they would like the library to work.
slouken@5189
    38
 */
slouken@5189
    39
slouken@5189
    40
#ifndef _SDL_hints_h
slouken@5189
    41
#define _SDL_hints_h
slouken@5189
    42
slouken@5189
    43
#include "SDL_stdinc.h"
slouken@5189
    44
slouken@5189
    45
#include "begin_code.h"
slouken@5189
    46
/* Set up for C function definitions, even when using C++ */
slouken@5189
    47
#ifdef __cplusplus
slouken@5189
    48
/* *INDENT-OFF* */
slouken@5189
    49
extern "C" {
slouken@5189
    50
/* *INDENT-ON* */
slouken@5189
    51
#endif
slouken@5189
    52
slouken@5189
    53
slouken@5189
    54
slouken@5189
    55
/**
slouken@5189
    56
 *  \brief  An enumeration of hint priorities
slouken@5189
    57
 */
slouken@5189
    58
typedef enum
slouken@5189
    59
{
slouken@5189
    60
    SDL_HINT_DEFAULT,
slouken@5189
    61
    SDL_HINT_NORMAL,
slouken@5189
    62
    SDL_HINT_OVERRIDE
slouken@5189
    63
} SDL_HintPriority;
slouken@5189
    64
slouken@5189
    65
slouken@5189
    66
/**
slouken@5189
    67
 *  \brief Set a hint
slouken@5189
    68
 *
slouken@5189
    69
 *  The priority controls the behavior when setting a hint that already
slouken@5189
    70
 *  has a value.  Hints will replace existing hints of their priority and
slouken@5189
    71
 *  lower.  Environment variables are considered to have override priority.
slouken@5189
    72
 * 
slouken@5189
    73
 *  \return SDL_TRUE if the hint was set, SDL_FALSE otherwise
slouken@5189
    74
 */
slouken@5189
    75
extern DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name,
slouken@5189
    76
                                             const char *value,
slouken@5189
    77
                                             SDL_HintPriority priority);
slouken@5189
    78
slouken@5189
    79
/**
slouken@5189
    80
 *  \brief Get a hint
slouken@5189
    81
 *  
slouken@5189
    82
 *  \return The string value of a hint variable.
slouken@5189
    83
 */
slouken@5189
    84
extern DECLSPEC const char * SDLCALL SDL_GetHint(const char *name);
slouken@5189
    85
slouken@5189
    86
/**
slouken@5189
    87
 *  \brief  Clear all hints
slouken@5189
    88
 *
slouken@5189
    89
 *  This function is called during SDL_Quit() to free stored hints.
slouken@5189
    90
 */
slouken@5189
    91
extern DECLSPEC void SDLCALL SDL_ClearHints();
slouken@5189
    92
slouken@5189
    93
slouken@5189
    94
/* Ends C function definitions when using C++ */
slouken@5189
    95
#ifdef __cplusplus
slouken@5189
    96
/* *INDENT-OFF* */
slouken@5189
    97
}
slouken@5189
    98
/* *INDENT-ON* */
slouken@5189
    99
#endif
slouken@5189
   100
#include "close_code.h"
slouken@5189
   101
slouken@5189
   102
#endif /* _SDL_hints_h */
slouken@5189
   103
slouken@5189
   104
/* vi: set ts=4 sw=4 expandtab: */