Tangent128 / luasdl2

A pure C binding of SDL 2.0 for Lua 5.1, Lua 5.2, and LuaJIT.
ISC License
385 stars 74 forks source link

Texture Scaling on Renderers #51

Closed ghost closed 3 years ago

ghost commented 8 years ago

I don't seem to see any options to choose between nearest-neighbor scaling and bilinear when copying textures to a renderer. Am I just not finding it in the right place?

(Using LuaSDL2 on Ubuntu 16.04)

Tangent128 commented 8 years ago

Untested, but does calling

SDL.setHint("SDL_HINT_RENDER_SCALE_QUALITY", "0")

do what you want? (0 for nearest-neighbor, 1 for bilinear, according to this)

ghost commented 8 years ago

Doesn't seem to make any difference regardless of the setting (stays at nearest-neighbor). This is perfectly fine, as I prefer nearest-neighbor on account of using pixel art. If I happen to find that it doesn't retain this behavior on other platforms I'll definitely tinker with this a little bit more.

Web-eWorks commented 7 years ago

SDL2 itself - as far as I see - only supports choosing this via the "RENDER_SCALE_QUALITY" hint as described by Tangent128 above.

Unless you have any more information regarding this behavior, I believe this issue can be marked as resolved.

Web-eWorks commented 7 years ago

You may want to try pulling #62 into your local repo and using SDL.hintPriority.Override as the third argument to SDL.setHint.