Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libSDL
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
libSDL
Commits
9c86971a
Commit
9c86971a
authored
Feb 09, 2011
by
Sam Lantinga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a hint to control whether the OpenGL driver uses shaders.
parent
752dd42d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletion
+24
-1
SDL_hints.h
include/SDL_hints.h
+15
-0
SDL_render_gl.c
src/render/opengl/SDL_render_gl.c
+9
-1
No files found.
include/SDL_hints.h
View file @
9c86971a
...
@@ -77,11 +77,26 @@ extern "C" {
...
@@ -77,11 +77,26 @@ extern "C" {
* This variable is case insensitive and can be set to the following values:
* This variable is case insensitive and can be set to the following values:
* "direct3d"
* "direct3d"
* "opengl"
* "opengl"
* "opengles2"
* "opengles"
* "opengles"
* "software"
* "software"
*
* The default varies by platform, but it's the first one in the list that
* is available on the current platform.
*/
*/
#define SDL_HINT_RENDER_DRIVER "SDL_RENDER_DRIVER"
#define SDL_HINT_RENDER_DRIVER "SDL_RENDER_DRIVER"
/**
* \brief A variable controlling whether the OpenGL render driver uses shaders if they are available.
*
* This variable can be set to the following values:
* "0" - Disable shaders
* "1" - Enable shaders
*
* By default shaders are used if OpenGL supports them.
*/
#define SDL_HINT_RENDER_OPENGL_SHADERS "SDL_RENDER_OPENGL_SHADERS"
/**
/**
* \brief A variable controlling whether updates to the SDL 1.2 screen surface should be synchronized with the vertical refresh, to avoid tearing.
* \brief A variable controlling whether updates to the SDL 1.2 screen surface should be synchronized with the vertical refresh, to avoid tearing.
*
*
...
...
src/render/opengl/SDL_render_gl.c
View file @
9c86971a
...
@@ -23,6 +23,8 @@
...
@@ -23,6 +23,8 @@
#if SDL_VIDEO_RENDER_OGL && !SDL_RENDER_DISABLED
#if SDL_VIDEO_RENDER_OGL && !SDL_RENDER_DISABLED
#include "SDL_hints.h"
#include "SDL_log.h"
#include "SDL_opengl.h"
#include "SDL_opengl.h"
#include "../SDL_sysrender.h"
#include "../SDL_sysrender.h"
#include "SDL_shaders_gl.h"
#include "SDL_shaders_gl.h"
...
@@ -183,6 +185,7 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags)
...
@@ -183,6 +185,7 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags)
{
{
SDL_Renderer
*
renderer
;
SDL_Renderer
*
renderer
;
GL_RenderData
*
data
;
GL_RenderData
*
data
;
const
char
*
hint
;
GLint
value
;
GLint
value
;
Uint32
window_flags
;
Uint32
window_flags
;
...
@@ -282,7 +285,12 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags)
...
@@ -282,7 +285,12 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags)
}
}
/* Check for shader support */
/* Check for shader support */
hint
=
SDL_GetHint
(
SDL_HINT_RENDER_OPENGL_SHADERS
);
if
(
!
hint
||
*
hint
!=
'0'
)
{
data
->
shaders
=
GL_CreateShaderContext
();
data
->
shaders
=
GL_CreateShaderContext
();
}
SDL_LogInfo
(
SDL_LOG_CATEGORY_RENDER
,
"OpenGL shaders: %s"
,
data
->
shaders
?
"ENABLED"
:
"DISABLED"
);
#if 0
#if 0
/* We support YV12 textures using 3 textures and a shader */
/* We support YV12 textures using 3 textures and a shader */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment