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 2936

Summary: SDL_GL_SwapBuffers returns no error code.
Product: SDL Reporter: x414e54
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED DUPLICATE QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: philipp.wiesemann
Version: HG 1.2   
Hardware: All   
OS: All   

Description x414e54 2015-04-09 01:54:41 UTC
SDL_GL_SwapBuffers currently returns a void and does not set any errors.

This means an application cannot check if an error occurred. In some cases the application may want to bail out if it cannot swap buffers rather than loop not rendering anything to the screen.

This may not be relevant to all video targets as some may have errored elsewhere but this should be fairly simple to implement for eglSwapBuffers which returns a boolean. Everything else could just return success.

You may say that this should not occur but it certainly can in the case of EGL even after eglMakeCurrent has passed. This is most likely a driver bug but could also be due to context race conditions.
Comment 1 Sam Lantinga 2016-10-08 00:08:54 UTC
Makes sense. Would you like to create a patch to implement this?
Comment 2 Philipp Wiesemann 2016-12-10 22:24:58 UTC
It was implemented for SDL_GL_SwapWindow() to resolve bug 3513.
Comment 3 x414e54 2016-12-11 02:35:10 UTC
I was actually intending to refer to SDL_GL_SwapWindow got confused with old SDL and new SDL :)
Comment 4 Sam Lantinga 2016-12-11 20:11:39 UTC
This is a duplicate of bug 3513

*** This bug has been marked as a duplicate of bug 3513 ***