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