include/SDL_hints.h
author Sam Lantinga <slouken@libsdl.org>
Fri, 11 Feb 2011 22:37:15 -0800
changeset 5262 b530ef003506
parent 5233 ce4f91138031
child 5272 3c94c559f5c2
permissions -rw-r--r--
Happy 2011! :)
slouken@5189
     1
/*
slouken@5189
     2
    SDL - Simple DihintsMedia Layer
slouken@5262
     3
    Copyright (C) 1997-2011 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@5233
    80
 *    "opengles2"
slouken@5192
    81
 *    "opengles"
slouken@5192
    82
 *    "software"
slouken@5233
    83
 *
slouken@5233
    84
 *  The default varies by platform, but it's the first one in the list that
slouken@5233
    85
 *  is available on the current platform.
slouken@5192
    86
 */
slouken@5192
    87
#define SDL_HINT_RENDER_DRIVER              "SDL_RENDER_DRIVER"
slouken@5192
    88
slouken@5192
    89
/**
slouken@5233
    90
 *  \brief  A variable controlling whether the OpenGL render driver uses shaders if they are available.
slouken@5233
    91
 *
slouken@5233
    92
 *  This variable can be set to the following values:
slouken@5233
    93
 *    "0"       - Disable shaders
slouken@5233
    94
 *    "1"       - Enable shaders
slouken@5233
    95
 *
slouken@5233
    96
 *  By default shaders are used if OpenGL supports them.
slouken@5233
    97
 */
slouken@5233
    98
#define SDL_HINT_RENDER_OPENGL_SHADERS      "SDL_RENDER_OPENGL_SHADERS"
slouken@5233
    99
slouken@5233
   100
/**
slouken@5192
   101
 *  \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
   102
 *
slouken@5192
   103
 *  This variable can be set to the following values:
slouken@5192
   104
 *    "0"       - Disable vsync
slouken@5192
   105
 *    "1"       - Enable vsync
slouken@5192
   106
 *
slouken@5192
   107
 *  By default SDL does not sync screen surface updates with vertical refresh.
slouken@5192
   108
 */
slouken@5192
   109
#define SDL_HINT_RENDER_VSYNC               "SDL_RENDER_VSYNC"
slouken@5192
   110
slouken@5189
   111
slouken@5189
   112
/**
slouken@5189
   113
 *  \brief  An enumeration of hint priorities
slouken@5189
   114
 */
slouken@5189
   115
typedef enum
slouken@5189
   116
{
slouken@5189
   117
    SDL_HINT_DEFAULT,
slouken@5189
   118
    SDL_HINT_NORMAL,
slouken@5189
   119
    SDL_HINT_OVERRIDE
slouken@5189
   120
} SDL_HintPriority;
slouken@5189
   121
slouken@5189
   122
slouken@5189
   123
/**
slouken@5200
   124
 *  \brief Set a hint with a specific priority
slouken@5189
   125
 *
slouken@5189
   126
 *  The priority controls the behavior when setting a hint that already
slouken@5189
   127
 *  has a value.  Hints will replace existing hints of their priority and
slouken@5189
   128
 *  lower.  Environment variables are considered to have override priority.
slouken@5189
   129
 * 
slouken@5189
   130
 *  \return SDL_TRUE if the hint was set, SDL_FALSE otherwise
slouken@5189
   131
 */
slouken@5200
   132
extern DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name,
slouken@5200
   133
                                                         const char *value,
slouken@5200
   134
                                                         SDL_HintPriority priority);
slouken@5200
   135
slouken@5200
   136
/**
slouken@5200
   137
 *  \brief Set a hint with normal priority
slouken@5200
   138
 * 
slouken@5200
   139
 *  \return SDL_TRUE if the hint was set, SDL_FALSE otherwise
slouken@5200
   140
 */
slouken@5189
   141
extern DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name,
slouken@5200
   142
                                             const char *value);
slouken@5200
   143
slouken@5189
   144
slouken@5189
   145
/**
slouken@5189
   146
 *  \brief Get a hint
slouken@5189
   147
 *  
slouken@5189
   148
 *  \return The string value of a hint variable.
slouken@5189
   149
 */
slouken@5189
   150
extern DECLSPEC const char * SDLCALL SDL_GetHint(const char *name);
slouken@5189
   151
slouken@5189
   152
/**
slouken@5189
   153
 *  \brief  Clear all hints
slouken@5189
   154
 *
slouken@5189
   155
 *  This function is called during SDL_Quit() to free stored hints.
slouken@5189
   156
 */
slouken@5189
   157
extern DECLSPEC void SDLCALL SDL_ClearHints();
slouken@5189
   158
slouken@5189
   159
slouken@5189
   160
/* Ends C function definitions when using C++ */
slouken@5189
   161
#ifdef __cplusplus
slouken@5189
   162
/* *INDENT-OFF* */
slouken@5189
   163
}
slouken@5189
   164
/* *INDENT-ON* */
slouken@5189
   165
#endif
slouken@5189
   166
#include "close_code.h"
slouken@5189
   167
slouken@5189
   168
#endif /* _SDL_hints_h */
slouken@5189
   169
slouken@5189
   170
/* vi: set ts=4 sw=4 expandtab: */