Path: blob/main/system/include/SDL/SDL_hints.h
6169 views
/*1Simple DirectMedia Layer2Copyright (C) 1997-2011 Sam Lantinga <[email protected]>34This software is provided 'as-is', without any express or implied5warranty. In no event will the authors be held liable for any damages6arising from the use of this software.78Permission is granted to anyone to use this software for any purpose,9including commercial applications, and to alter it and redistribute it10freely, subject to the following restrictions:11121. The origin of this software must not be misrepresented; you must not13claim that you wrote the original software. If you use this software14in a product, an acknowledgment in the product documentation would be15appreciated but is not required.162. Altered source versions must be plainly marked as such, and must not be17misrepresented as being the original software.183. This notice may not be removed or altered from any source distribution.19*/2021/**22* \file SDL_hints.h23*24* Official documentation for SDL configuration variables25*26* This file contains functions to set and get configuration hints,27* as well as listing each of them alphabetically.28*29* The convention for naming hints is SDL_HINT_X, where "SDL_X" is30* the environment variable that can be used to override the default.31*32* In general these hints are just that - they may or may not be33* supported or applicable on any given platform, but they provide34* a way for an application or user to give the library a hint as35* to how they would like the library to work.36*/3738#ifndef _SDL_hints_h39#define _SDL_hints_h4041#include "SDL_stdinc.h"4243#include "begin_code.h"44/* Set up for C function definitions, even when using C++ */45#ifdef __cplusplus46/* *INDENT-OFF* */47extern "C" {48/* *INDENT-ON* */49#endif5051/**52* \brief A variable controlling how 3D acceleration is used to accelerate the SDL 1.2 screen surface.53*54* SDL can try to accelerate the SDL 1.2 screen surface by using streaming55* textures with a 3D rendering engine. This variable controls whether and56* how this is done.57*58* This variable can be set to the following values:59* "0" - Disable 3D acceleration60* "1" - Enable 3D acceleration, using the default renderer.61* "X" - Enable 3D acceleration, using X where X is one of the valid rendering drivers. (e.g. "direct3d", "opengl", etc.)62*63* By default SDL tries to make a best guess for each platform whether64* to use acceleration or not.65*/66#define SDL_HINT_FRAMEBUFFER_ACCELERATION "SDL_FRAMEBUFFER_ACCELERATION"6768/**69* \brief A variable specifying which render driver to use.70*71* If the application doesn't pick a specific renderer to use, this variable72* specifies the name of the preferred renderer. If the preferred renderer73* can't be initialized, the normal default renderer is used.74*75* This variable is case insensitive and can be set to the following values:76* "direct3d"77* "opengl"78* "opengles2"79* "opengles"80* "software"81*82* The default varies by platform, but it's the first one in the list that83* is available on the current platform.84*/85#define SDL_HINT_RENDER_DRIVER "SDL_RENDER_DRIVER"8687/**88* \brief A variable controlling whether the OpenGL render driver uses shaders if they are available.89*90* This variable can be set to the following values:91* "0" - Disable shaders92* "1" - Enable shaders93*94* By default shaders are used if OpenGL supports them.95*/96#define SDL_HINT_RENDER_OPENGL_SHADERS "SDL_RENDER_OPENGL_SHADERS"9798/**99* \brief A variable controlling the scaling quality100*101* This variable can be set to the following values:102* "0" or "nearest" - Nearest pixel sampling103* "1" or "linear" - Linear filtering (supported by OpenGL and Direct3D)104* "2" or "best" - Anisotropic filtering (supported by Direct3D)105*106* By default nearest pixel sampling is used107*/108#define SDL_HINT_RENDER_SCALE_QUALITY "SDL_RENDER_SCALE_QUALITY"109110/**111* \brief A variable controlling whether updates to the SDL 1.2 screen surface should be synchronized with the vertical refresh, to avoid tearing.112*113* This variable can be set to the following values:114* "0" - Disable vsync115* "1" - Enable vsync116*117* By default SDL does not sync screen surface updates with vertical refresh.118*/119#define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC"120121/**122* \brief A variable controlling whether the idle timer is disabled on iOS.123*124* When an iOS app does not receive touches for some time, the screen is125* dimmed automatically. For games where the accelerometer is the only input126* this is problematic. This functionality can be disabled by setting this127* hint.128*129* This variable can be set to the following values:130* "0" - Enable idle timer131* "1" - Disable idle timer132*/133#define SDL_HINT_IDLE_TIMER_DISABLED "SDL_IOS_IDLE_TIMER_DISABLED"134135/**136* \brief A variable controlling which orientations are allowed on iOS.137*138* In some circumstances it is necessary to be able to explicitly control139* which UI orientations are allowed.140*141* This variable is a space delimited list of the following values:142* "LandscapeLeft", "LandscapeRight", "Portrait" "PortraitUpsideDown"143*/144#define SDL_HINT_ORIENTATIONS "SDL_IOS_ORIENTATIONS"145146147/**148* \brief An enumeration of hint priorities149*/150typedef enum151{152SDL_HINT_DEFAULT,153SDL_HINT_NORMAL,154SDL_HINT_OVERRIDE155} SDL_HintPriority;156157158/**159* \brief Set a hint with a specific priority160*161* The priority controls the behavior when setting a hint that already162* has a value. Hints will replace existing hints of their priority and163* lower. Environment variables are considered to have override priority.164*165* \return SDL_TRUE if the hint was set, SDL_FALSE otherwise166*/167extern DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name,168const char *value,169SDL_HintPriority priority);170171/**172* \brief Set a hint with normal priority173*174* \return SDL_TRUE if the hint was set, SDL_FALSE otherwise175*/176extern DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name,177const char *value);178179180/**181* \brief Get a hint182*183* \return The string value of a hint variable.184*/185extern DECLSPEC const char * SDLCALL SDL_GetHint(const char *name);186187/**188* \brief Clear all hints189*190* This function is called during SDL_Quit() to free stored hints.191*/192extern DECLSPEC void SDLCALL SDL_ClearHints(void);193194195/* Ends C function definitions when using C++ */196#ifdef __cplusplus197/* *INDENT-OFF* */198}199/* *INDENT-ON* */200#endif201#include "close_code.h"202203#endif /* _SDL_hints_h */204205/* vi: set ts=4 sw=4 expandtab: */206207208