Tangent128 / luasdl2

A pure C binding of SDL 2.0 for Lua 5.1, Lua 5.2, and LuaJIT.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Texture Scaling on Renderers

opened this issue · comments

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)

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)

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.

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.

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