include/SDL_hints.h
author Sam Lantinga <slouken@libsdl.org>
Sat, 05 Feb 2011 10:35:36 -0800
changeset 5192 ef5a61ea3202
parent 5190 82a48f4d65f6
child 5200 01bced9a4cc1
permissions -rw-r--r--
Added the SDL_HINT_RENDER_DRIVER and SDL_HINT_RENDER_VSYNC hints.
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@5192
    70
/**
slouken@5192
    71
 *  \brief  A variable specifying which render driver to use.
slouken@5192
    72
 *
slouken@5192
    73
 *  If the application doesn't pick a specific renderer to use, this variable
slouken@5192
    74
 *  specifies the name of the preferred renderer.  If the preferred renderer
slouken@5192
    75
 *  can't be initialized, the normal default renderer is used.
slouken@5192
    76
 *
slouken@5192
    77
 *  This variable is case insensitive and can be set to the following values:
slouken@5192
    78
 *    "direct3d"
slouken@5192
    79
 *    "opengl"
slouken@5192
    80
 *    "opengles"
slouken@5192
    81
 *    "software"
slouken@5192
    82
 */
slouken@5192
    83
#define SDL_HINT_RENDER_DRIVER              "SDL_RENDER_DRIVER"
slouken@5192
    84
slouken@5192
    85
/**
slouken@5192
    86
 *  \brief  A variable controlling whether updates to the SDL 1.2 screen surface should be synchronized with the vertical refresh, to avoid tearing.
slouken@5192
    87
 *
slouken@5192
    88
 *  This variable can be set to the following values:
slouken@5192
    89
 *    "0"       - Disable vsync
slouken@5192
    90
 *    "1"       - Enable vsync
slouken@5192
    91
 *
slouken@5192
    92
 *  By default SDL does not sync screen surface updates with vertical refresh.
slouken@5192
    93
 */
slouken@5192
    94
#define SDL_HINT_RENDER_VSYNC               "SDL_RENDER_VSYNC"
slouken@5192
    95
slouken@5189
    96
slouken@5189
    97
/**
slouken@5189
    98
 *  \brief  An enumeration of hint priorities
slouken@5189
    99
 */
slouken@5189
   100
typedef enum
slouken@5189
   101
{
slouken@5189
   102
    SDL_HINT_DEFAULT,
slouken@5189
   103
    SDL_HINT_NORMAL,
slouken@5189
   104
    SDL_HINT_OVERRIDE
slouken@5189
   105
} SDL_HintPriority;
slouken@5189
   106
slouken@5189
   107
slouken@5189
   108
/**
slouken@5189
   109
 *  \brief Set a hint
slouken@5189
   110
 *
slouken@5189
   111
 *  The priority controls the behavior when setting a hint that already
slouken@5189
   112
 *  has a value.  Hints will replace existing hints of their priority and
slouken@5189
   113
 *  lower.  Environment variables are considered to have override priority.
slouken@5189
   114
 * 
slouken@5189
   115
 *  \return SDL_TRUE if the hint was set, SDL_FALSE otherwise
slouken@5189
   116
 */
slouken@5189
   117
extern DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name,
slouken@5189
   118
                                             const char *value,
slouken@5189
   119
                                             SDL_HintPriority priority);
slouken@5189
   120
slouken@5189
   121
/**
slouken@5189
   122
 *  \brief Get a hint
slouken@5189
   123
 *  
slouken@5189
   124
 *  \return The string value of a hint variable.
slouken@5189
   125
 */
slouken@5189
   126
extern DECLSPEC const char * SDLCALL SDL_GetHint(const char *name);
slouken@5189
   127
slouken@5189
   128
/**
slouken@5189
   129
 *  \brief  Clear all hints
slouken@5189
   130
 *
slouken@5189
   131
 *  This function is called during SDL_Quit() to free stored hints.
slouken@5189
   132
 */
slouken@5189
   133
extern DECLSPEC void SDLCALL SDL_ClearHints();
slouken@5189
   134
slouken@5189
   135
slouken@5189
   136
/* Ends C function definitions when using C++ */
slouken@5189
   137
#ifdef __cplusplus
slouken@5189
   138
/* *INDENT-OFF* */
slouken@5189
   139
}
slouken@5189
   140
/* *INDENT-ON* */
slouken@5189
   141
#endif
slouken@5189
   142
#include "close_code.h"
slouken@5189
   143
slouken@5189
   144
#endif /* _SDL_hints_h */
slouken@5189
   145
slouken@5189
   146
/* vi: set ts=4 sw=4 expandtab: */