Regression: Starting with linear filter then switching to nearest results in blurry graphics
InfoTeddy opened this issue · comments
Filing this here so we don't forget.
If you start the game with a linear filter, then switch to nearest, the following graphics will still be blurry as if they had a linear filter applied:
- Any scaled graphics (e.g. header text)
- Screen shaking
This is a regression caused by #923.
A very annoying detail about SDL_Render: The hint for filter applies to textures made after that point, so it's basically a static variable that acts as what should be a function (probably SDL_SetTextureFilter). So, we probably want all textures to be nearest, then just for the final blit texture we set it either to linear or nearest.
The easiest way is probably to always have the variable at nearest, and temporarily set it to linear for the final target if that's enabled.
Someone may have added that function after all:
https://github.com/libsdl-org/SDL/blob/SDL2/include/SDL_render.h#L524
That also reminds me, we still use the VSync hint even though I added SDL_RenderSetVSync
. Should we get rid of that hint too? It seems like these hints are more confusing than they're worth.
We should be able to bump to SDL 2.28 at this point, let's fix both of these.