Controlling interpolated scaling

Hi,

so SDL_RenderCopy() can do automatical scaling for me but is there also a way to
turn interpolation on or off? AFAICS it’s currently always scaling without any
interpolation. Is there a way to turn interpolation on for SDL_RenderCopy()?–
Best regards,
Andreas Falkenhahn mailto:@Andreas_Falkenhahn

SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, “linear”);

Not sure at which point it takes effect though (maybe it takes effect
only the moment a texture is created).

Yes, you need to set the hint BEFORE creating the texture

Pallav Nawani
IronCode Gaming Private Limited
Website: http://www.ironcode.com
Twitter: http://twitter.com/Ironcode_Gaming
Facebook: http://www.facebook.com/Ironcode.Gaming
Mobile: 9997478768On Fri, Aug 15, 2014 at 1:43 AM, Sik the hedgehog < sik.the.hedgehog at gmail.com> wrote:

SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, “linear”);

Not sure at which point it takes effect though (maybe it takes effect
only the moment a texture is created).


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Thanks, this seems to work fine. Is this a per texture setting or a global one?On 15.08.2014 at 05:01 Pallav Nawani wrote:

Yes, you need to set the hint BEFORE creating the texture

Pallav Nawani
IronCode Gaming Private Limited
Website: http://www.ironcode.com
Twitter: http://twitter.com/Ironcode_Gaming
Facebook: http://www.facebook.com/Ironcode.Gaming
Mobile: 9997478768

On Fri, Aug 15, 2014 at 1:43 AM, Sik the hedgehog <sik.the.hedgehog at gmail.com> wrote:

SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, “linear”);

Not sure at which point it takes effect though (maybe it takes effect
only the moment a texture is created).


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Best regards,
Andreas Falkenhahn mailto:@Andreas_Falkenhahn

2014-08-15 7:15 GMT-03:00, Andreas Falkenhahn :

Thanks, this seems to work fine. Is this a per texture setting or a global
one?

That’s the part I said I didn’t know :stuck_out_tongue: It does seem like it’s
intended to be a global setting but it could be getting checked just
when the textures get created (which would make it per texture). I’m
not even sure if this changes depending on the renderer.

If you just want to interpolate everything just set the hint before
you create the renderer. It’s going to be safer.

PS: forgot to mention, the software renderer will not do
interpolation as far as I know (not sure). Then again, if SDL ends up
falling back to that one you probably don’t want to use interpolation
either (at this point lack of performance will be your biggest issue).
It should only happen if something is wrong anyway (unless you
explicitly ask for it).

2014-08-15 7:15 GMT-03:00, Andreas Falkenhahn <@Andreas_Falkenhahn>:

Thanks, this seems to work fine. Is this a per texture setting or a global
one?

That’s the part I said I didn’t know :stuck_out_tongue:

Looking at the source code I think it’s local to the texture, at least for the
OpenGL backend that is.On 15.08.2014 at 12:49 Sik the hedgehog wrote:


Best regards,
Andreas Falkenhahn mailto:@Andreas_Falkenhahn