The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Controlling interpolated scaling
Andreas Falkenhahn
Guest

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:

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Controlling interpolated scaling
Sik


Joined: 26 Nov 2011
Posts: 905
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

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Controlling interpolated scaling
Pallav Nawani


Joined: 19 May 2011
Posts: 122
Location: Dehradun, India
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 wrote:
Quote:
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

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Controlling interpolated scaling
Andreas Falkenhahn
Guest

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:

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

Quote:
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



Quote:
On Fri, Aug 15, 2014 at 1:43 AM, Sik the hedgehog
wrote:

Quote:
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

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org




--
Best regards,
Andreas Falkenhahn mailto:

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Controlling interpolated scaling
Sik


Joined: 26 Nov 2011
Posts: 905
2014-08-15 7:15 GMT-03:00, Andreas Falkenhahn:
Quote:
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 Razz 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).
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Controlling interpolated scaling
Andreas Falkenhahn
Guest

On 15.08.2014 at 12:49 Sik the hedgehog wrote:

Quote:
2014-08-15 7:15 GMT-03:00, Andreas Falkenhahn:
Quote:
Thanks, this seems to work fine. Is this a per texture setting or a global
one?

Quote:
That's the part I said I didn't know Razz

Looking at the source code I think it's local to the texture, at least for the
OpenGL backend that is.

--
Best regards,
Andreas Falkenhahn mailto:

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org