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 2202

Summary: SDL_Texture alpha mod value is lost on window resize with render logic size
Product: SDL Reporter: Rubinson Ivan <soryy708>
Component: renderAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: trivial    
Priority: P2 CC: touk
Version: 2.0.0   
Hardware: x86_64   
OS: Windows 7   

Description Rubinson Ivan 2013-11-02 03:03:00 UTC
I have a window with SDL_WINDOW_RESIZABLE flag, and it's renderer has a logical size of 640x480. I create an SDL_Surface*, apply colorkey on it, and then convert it to an SDL_Texture*. On top of that, I set the SDL_Texture*s alpha mod to some value and blend mode to SDL_BLENDMODE_BLEND. When the window is resized, the texture becomes fully opaque (the alpha mod value is lost).
Comment 1 touk 2013-12-20 03:32:28 UTC
Just want to add: I too have run into this bug, even without using the Logical Size or Color Key functions. Simply using an accelerated renderer and a semi-transparent PNG texture, calling SDL_SetWindowSize seems to break SDL_SetTextureAlphaMod. I can provide an example ZIP if necessary.
Comment 2 Sam Lantinga 2017-08-14 10:32:15 UTC
Yes, an example would be great, thanks!
Comment 3 touk 2017-08-17 15:06:28 UTC
Still seems to happen in 2.0.5 (Windows / mingw / x86).
You can try this example:
http://github.com/kenmo-pb/SDL-Tests/blob/master/bug2202_main.c

32x32 PNG for testing:
http://github.com/kenmo-pb/SDL-Tests/raw/master/32x32.png
Comment 4 touk 2017-09-12 15:24:33 UTC
Disregard my previous comment! I may have been testing with the wrong version of SDL2.dll

This bug seems to have been fixed sometime since 2.0.0.

Using the 2.0.5 and prerelease 2.0.6 DLLs, the texture alpha seems to be correctly preserved after calling SDL_SetWindowSize.
Comment 5 Sam Lantinga 2017-09-12 16:46:31 UTC
Glad to hear it! :)