mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-28 05:58:29 +00:00
Fixed bug 4134 - Render targets lose scale quality after minimizing a fullscreen window
Olli-Samuli Lehmus If one creates a window with the SDL_WINDOW_FULLSCREEN_DESKTOP flag, and creates a render target with SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear"), and afterwards sets SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "nearest"), after minimizing the window, the scale quality hint is lost on the render target. Textures however do keep their interpolation modes.
This commit is contained in:
@@ -524,18 +524,6 @@ power_of_2(int input)
|
||||
return value;
|
||||
}
|
||||
|
||||
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
|
||||
GLES_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||
{
|
||||
@@ -603,7 +591,7 @@ GLES_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->glBindTexture(data->type, data->texture);
|
||||
renderdata->glTexParameteri(data->type, GL_TEXTURE_MIN_FILTER, scaleMode);
|
||||
renderdata->glTexParameteri(data->type, GL_TEXTURE_MAG_FILTER, scaleMode);
|
||||
|
Reference in New Issue
Block a user