Maybe I am missing something, and SDL_RenderCopy() isn’t supposed to
downscale at all?
In the SDL wiki I read:
“dstrect: the destination SDL_Rect structure or NULL for the entire
rendering target. The texture will be stretched to fill the given
rectangle.”
I always assumed that “stretched” implied that if dstrect is smaller,
then the texture will be scaled down. And that’s what I get as long as I
pass NULL to srcrect.
But when I use a non-NULL srcrect, then the texture is only stretched
when the dstrect is larger than the texture. If dstrect is smaller than
the texture, then the texture is truncated instead of being scaled down.
I’d say this smells like a bug, because I think the scaling behavior
should be consistent with and without srcrect… but again, maybe I
missed something obvious?
Any hints would be welcome 
regards,
MateuszOn 04/26/2014 06:40 PM, Mateusz Viste wrote:
Hi all,
I am using SDL_RenderCopy() in my game. The function prototype is this:
int SDL_RenderCopy(SDL_Renderer* renderer, SDL_Texture* texture,
const SDL_Rect* srcrect, const SDL_Rect* dstrect)
I use dstrect to downscale the texture. It works fine as long as I pass
NULL as srcrect, but as soon as I use a srcrect, then the downscaling is
not applied anymore, and the texture is simply truncated…
Is it a bug? Or some undocumented behavior of SDL? Any idea how could I
make it downscale textures when using a srcrect?
best regards,
Mateusz
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org