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 - Failed to create multiples times the software renderer.
Summary: Failed to create multiples times the software renderer.
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: don't know
Hardware: All Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
: 4161 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-12-15 15:14 UTC by Sylvain
Modified: 2018-12-17 18:33 UTC (History)
1 user (show)

See Also:


Attachments
test case (5.57 KB, text/x-csrc)
2018-12-15 15:16 UTC, Sylvain
Details

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