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 2167 - Allow specifying texture scale filter mode for each SDL_RenderCopy/SDL_RenderCopyEx call
Summary: Allow specifying texture scale filter mode for each SDL_RenderCopy/SDL_Render...
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: render (show other bugs)
Version: HG 2.1
Hardware: x86_64 Linux
: P2 enhancement
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-20 15:37 UTC by Ellie
Modified: 2020-01-17 21:42 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ellie 2013-10-20 15:37:10 UTC
My engine is object-centered. Each object uses a texture, possibly shared with other objects. An object has various properties like position, scale, and texture filter mode (so it's possible to mix smoothly scaled and pixelated things).

Currently, it appears SDL handles the texture filter hint per texture/in the SDL_CreateTexture call (source: mailing list). This means I would need to create multiple versions of the same texture to be able to switch filter mode per object for objects sharing a texture. That seems like a uselessly complicated and memory-wasting solution.

Therefore, please provide a way to specify/change the texture scale filter for each single SDL_RenderCopy/SDL_RenderCopyEx call, the simplest solution being that the hint for texture scaling is re-evaluated for each of those calls.
Comment 1 Sam Lantinga 2013-10-21 04:59:40 UTC
I looked through the code, and this looks pretty easy to do.  I'll add this to the TODO list post 2.0.1
Comment 2 Sam Lantinga 2017-08-15 05:18:54 UTC
Planning to add this for SDL 2.1
Comment 3 Konrad 2020-01-17 19:42:00 UTC
Sam, this bug report can me marked as resolved because some time ago my commit with SDL_SetTextureScaleMode and SDL_GetTextureScaleMode was merged into SDL. This can be done on the fly now.
Comment 4 Ellie 2020-01-17 21:42:48 UTC
Ah, very neat! Thanks <3