diff options
Diffstat (limited to 'Source/3rdParty/SDL2/src/render/opengl')
-rw-r--r-- | Source/3rdParty/SDL2/src/render/opengl/SDL_render_gl.c | 14 | ||||
-rw-r--r-- | Source/3rdParty/SDL2/src/render/opengl/SDL_shaders_gl.h | 6 |
2 files changed, 7 insertions, 13 deletions
diff --git a/Source/3rdParty/SDL2/src/render/opengl/SDL_render_gl.c b/Source/3rdParty/SDL2/src/render/opengl/SDL_render_gl.c index 1c379eb..f3e8326 100644 --- a/Source/3rdParty/SDL2/src/render/opengl/SDL_render_gl.c +++ b/Source/3rdParty/SDL2/src/render/opengl/SDL_render_gl.c @@ -703,18 +703,6 @@ convert_format(GL_RenderData *renderdata, Uint32 pixel_format, return SDL_TRUE; } -static GLenum -GetScaleQuality(void) -{ - const char *hint = SDL_GetHint(SDL_HINT_RENDER_SCALE_QUALITY); - - if (!hint || *hint == '0' || SDL_strcasecmp(hint, "nearest") == 0) { - return GL_NEAREST; - } else { - return GL_LINEAR; - } -} - static int GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) { @@ -803,7 +791,7 @@ GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) data->format = format; data->formattype = type; - scaleMode = GetScaleQuality(); + scaleMode = (texture->scaleMode == SDL_ScaleModeNearest) ? GL_NEAREST : GL_LINEAR; renderdata->glEnable(data->type); renderdata->glBindTexture(data->type, data->texture); renderdata->glTexParameteri(data->type, GL_TEXTURE_MIN_FILTER, scaleMode); diff --git a/Source/3rdParty/SDL2/src/render/opengl/SDL_shaders_gl.h b/Source/3rdParty/SDL2/src/render/opengl/SDL_shaders_gl.h index 9805c59..3697521 100644 --- a/Source/3rdParty/SDL2/src/render/opengl/SDL_shaders_gl.h +++ b/Source/3rdParty/SDL2/src/render/opengl/SDL_shaders_gl.h @@ -18,6 +18,10 @@ misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ + +#ifndef SDL_shaders_gl_h_ +#define SDL_shaders_gl_h_ + #include "../../SDL_internal.h" /* OpenGL shader implementation */ @@ -44,4 +48,6 @@ extern GL_ShaderContext * GL_CreateShaderContext(void); extern void GL_SelectShader(GL_ShaderContext *ctx, GL_Shader shader); extern void GL_DestroyShaderContext(GL_ShaderContext *ctx); +#endif /* SDL_shaders_gl_h_ */ + /* vi: set ts=4 sw=4 expandtab: */ |