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 4426

Summary: Failed to create multiples times the software renderer.
Product: SDL Reporter: Sylvain <sylvain.becker>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: ant
Version: don't know   
Hardware: All   
OS: Linux   
Attachments: test case

Description Sylvain 2018-12-15 15:14:59 UTC
When switching between renderers.
software -> opengl -> opengles2 -> software

It fails re-creating the software renderer.

"software -> opengl    -> software" would work
"software -> opengles2 -> software" would work

It appears "opengl -> opengles2" frees "window->surface" without marking it as invalid.
So, when doing SDL_GetWindowSurface, SW_Renderer re-creation fails.
Comment 1 Sylvain 2018-12-15 15:16:22 UTC
Created attachment 3548 [details]
test case

test case to switch renderers (actually same as bug #4425)
Comment 2 Sylvain 2018-12-15 15:23:33 UTC
"opengl -> opengles2" calls SDL_RecreateWindow() which frees "window->surface" without marking it as invalid.

When SW renderer is re-created it fails getting its surface.

Fixed https://hg.libsdl.org/SDL/rev/11f8bd1899c5
Comment 3 Anthony @ POW Games 2018-12-17 18:33:04 UTC
*** Bug 4161 has been marked as a duplicate of this bug. ***