include/SDL_hints.h
author Sam Lantinga <slouken@libsdl.org>
Sat, 05 Feb 2011 10:03:12 -0800
changeset 5190 82a48f4d65f6
parent 5189 6f6a9340fb93
child 5192 ef5a61ea3202
permissions -rw-r--r--
Added a hint to determine whether framebuffer texture acceleration should be used, and added default behaviors for the various platforms.
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@5190
    53
/**
slouken@5190
    54
 *  \brief  A variable controlling how 3D acceleration is used to accelerate the SDL 1.2 screen surface. 
slouken@5190
    55
 *
slouken@5190
    56
 *  SDL can try to accelerate the SDL 1.2 screen surface by using streaming
slouken@5190
    57
 *  textures with a 3D rendering engine.  This variable controls whether and
slouken@5190
    58
 *  how this is done.
slouken@5190
    59
 *
slouken@5190
    60
 *  This variable can be set to the following values:
slouken@5190
    61
 *    "0"       - Disable 3D acceleration
slouken@5190
    62
 *    "1"       - Enable 3D acceleration, using the default renderer.
slouken@5190
    63
 *    "X"       - Enable 3D acceleration, using X where X is one of the valid rendering drivers.  (e.g. "direct3d", "opengl", etc.)
slouken@5190
    64
 *
slouken@5190
    65
 *  By default SDL tries to make a best guess for each platform whether
slouken@5190
    66
 *  to use acceleration or not.
slouken@5190
    67
 */
slouken@5190
    68
#define SDL_HINT_FRAMEBUFFER_ACCELERATION   "SDL_FRAMEBUFFER_ACCELERATION"
slouken@5189
    69
slouken@5189
    70
slouken@5189
    71
/**
slouken@5189
    72
 *  \brief  An enumeration of hint priorities
slouken@5189
    73
 */
slouken@5189
    74
typedef enum
slouken@5189
    75
{
slouken@5189
    76
    SDL_HINT_DEFAULT,
slouken@5189
    77
    SDL_HINT_NORMAL,
slouken@5189
    78
    SDL_HINT_OVERRIDE
slouken@5189
    79
} SDL_HintPriority;
slouken@5189
    80
slouken@5189
    81
slouken@5189
    82
/**
slouken@5189
    83
 *  \brief Set a hint
slouken@5189
    84
 *
slouken@5189
    85
 *  The priority controls the behavior when setting a hint that already
slouken@5189
    86
 *  has a value.  Hints will replace existing hints of their priority and
slouken@5189
    87
 *  lower.  Environment variables are considered to have override priority.
slouken@5189
    88
 * 
slouken@5189
    89
 *  \return SDL_TRUE if the hint was set, SDL_FALSE otherwise
slouken@5189
    90
 */
slouken@5189
    91
extern DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name,
slouken@5189
    92
                                             const char *value,
slouken@5189
    93
                                             SDL_HintPriority priority);
slouken@5189
    94
slouken@5189
    95
/**
slouken@5189
    96
 *  \brief Get a hint
slouken@5189
    97
 *  
slouken@5189
    98
 *  \return The string value of a hint variable.
slouken@5189
    99
 */
slouken@5189
   100
extern DECLSPEC const char * SDLCALL SDL_GetHint(const char *name);
slouken@5189
   101
slouken@5189
   102
/**
slouken@5189
   103
 *  \brief  Clear all hints
slouken@5189
   104
 *
slouken@5189
   105
 *  This function is called during SDL_Quit() to free stored hints.
slouken@5189
   106
 */
slouken@5189
   107
extern DECLSPEC void SDLCALL SDL_ClearHints();
slouken@5189
   108
slouken@5189
   109
slouken@5189
   110
/* Ends C function definitions when using C++ */
slouken@5189
   111
#ifdef __cplusplus
slouken@5189
   112
/* *INDENT-OFF* */
slouken@5189
   113
}
slouken@5189
   114
/* *INDENT-ON* */
slouken@5189
   115
#endif
slouken@5189
   116
#include "close_code.h"
slouken@5189
   117
slouken@5189
   118
#endif /* _SDL_hints_h */
slouken@5189
   119
slouken@5189
   120
/* vi: set ts=4 sw=4 expandtab: */