We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4914

Summary: Expose SDL_ScaleMode and add SDL_SetTextureScaleMode/SDL_GetTextureScaleMode
Product: SDL Reporter: Konrad <iryont>
Component: renderAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: sezeroz, sylvain.becker
Version: HG 2.1   
Hardware: x86_64   
OS: All   
Attachments: Patch

Description Konrad 2019-12-22 20:45:03 UTC
Created attachment 4136 [details]
Patch

This was something rather trivial to add, but asked at least several times before (I did google about it as well).

It should be possible to dynamically change scaling mode of the texture. It is actually trivial task, but until now it was only possible with a hint before creating a texture.

I needed it for my game as well, so I took the liberty of writing it myself.

This patch adds following functions:

SDL_SetTextureScaleMode(SDL_Texture * texture, SDL_ScaleMode scaleMode);
SDL_GetTextureScaleMode(SDL_Texture * texture, SDL_ScaleMode *scaleMode);

That way you can change texture scaling on the fly.
Comment 1 Sam Lantinga 2019-12-22 21:40:01 UTC
Added, thanks!
https://hg.libsdl.org/SDL/rev/35f99d918ca2
Comment 2 Sylvain 2019-12-23 15:46:56 UTC
Fixing a compilation error for the GLES renderer: 
https://hg.libsdl.org/SDL/rev/6bf10b024882
Comment 3 Konrad 2019-12-23 16:21:13 UTC
Good job. By accident I did copy that unused variable from OpenGL renderer and since OpenGL ES 1 was not being compiled here (due to OpenGL ES 2) I did not notice it.
Comment 4 Ozkan Sezer 2019-12-23 16:27:10 UTC
This caused bug #4916.