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 - Expose SDL_ScaleMode and add SDL_SetTextureScaleMode/SDL_GetTextureScaleMode
Summary: Expose SDL_ScaleMode and add SDL_SetTextureScaleMode/SDL_GetTextureScaleMode
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: render (show other bugs)
Version: HG 2.1
Hardware: x86_64 All
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-22 20:45 UTC by Konrad
Modified: 2019-12-23 16:27 UTC (History)
2 users (show)

See Also:


Attachments
Patch (18.09 KB, patch)
2019-12-22 20:45 UTC, Konrad
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.