Question

The SDL documentation for SDL_RenderCopy says that the texture will be stretched, but I can find absolutely no information about how the stretching will be done.

My experiments on Linux show that stretching is not anti-aliased. Can I rely on this? Will it behave the same way on other platforms? Will it not change in future versions?

Searching for anti-aliasing in SDL Wiki yields only 1 result, and it refers to the OpenGL configuration; the Wiki seems to be silent on how the stretching of textures is done. I’m writing a pixel-art game that won’t look good if anti-aliasing is applied, so I’d like to make sure it will never be anti-aliased.

Was it helpful?

Solution

Yes, it is guaranteed that by default SDL2 uses the nearest pixel stretching. You need to explicitly enable any other format by hinting it (explained at http://wiki.libsdl.org/SDL_HINT_RENDER_SCALE_QUALITY).

Good look at your game.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top