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 3457 - Using soft renderer SDL_SetTextureColorMod() with certain RGB values makes texture unusable
Summary: Using soft renderer SDL_SetTextureColorMod() with certain RGB values makes te...
Status: RESOLVED ABANDONED
Alias: None
Product: SDL
Classification: Unclassified
Component: render (show other bugs)
Version: HG 2.1
Hardware: x86 Other
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-16 17:10 UTC by Tero Lindeman
Modified: 2018-08-06 21:20 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 Tero Lindeman 2016-10-16 17:10:03 UTC
When using SDL_SetTextureColorMod in a software renderer created by SDL_CreateRenderer (with flag SDL_RENDERER_SOFTWARE) results in weird behavior. The following example will make the texture not render anything after subsequent SDL_RenderCopy calls (even if you change the texture mod color back):

SDL_SetTextureColorMod(mFont, 0, 0, 0);       // Set mod color to black
SDL_SetTextureColorMod(mFont, 255, 255, 255); // I would assume this cancels the above, i.e. renders the original texture color values
SDL_RenderCopy(...)                           // This will render all black 

However, the following will work and is a workaround:

SDL_SetTextureColorMod(mFont, 0, 0, 0);       
SDL_SetTextureColorMod(mFont, 254, 254, 254); 
SDL_RenderCopy(...)                           // renders almost correctly (254 vs. 255 :)

In the function SDL_SetSurfaceColorMod (to which the SDL_SetTextureColorMod is forwarded) there is a test if bitwise R & G & B equals 255 that disables RLE blitting. Using 254/254/254 as "white" will not trigger this.

This happens on my Windows setup (SDL 2.0.4) and also on a 2.0.4 CHIP Debian setup. I can also test on Ubuntu if that helps.
Comment 1 Sylvain 2017-11-06 08:11:27 UTC
Can't reproduce your issue on ubuntu system with SDL 2.0.4
Do you have more information, or even better, a test-case ?
Comment 2 Ryan C. Gordon 2018-08-06 21:20:18 UTC
Hello, and sorry if you're getting dozens of copies of this message by email.

We are closing out bugs that appear to be abandoned in some form. This can happen for lots of reasons: we couldn't reproduce it, conversation faded out, the bug was noted as fixed in a comment but we forgot to mark it resolved, the report is good but the fix is impractical, we fixed it a long time ago without realizing there was an associated report, etc.

Individually, any of these bugs might have a better resolution (such as WONTFIX or WORKSFORME or INVALID) but we've added a new resolution of ABANDONED to make this easily searchable and make it clear that it's not necessarily unreasonable to revive a given bug report.

So if this bug is still a going concern and you feel it should still be open: please feel free to reopen it! But unless you respond, we'd like to consider these bugs closed, as many of them are several years old and overwhelming our ability to prioritize recent issues.

(please note that hundred of bug reports were sorted through here, so we apologize for any human error. Just reopen the bug in that case!)

Thanks,
--ryan.