Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EGl Context EGL_BAD_SURFACE issue when pausing and resuming app and solution #1530

Closed
DanielDorn opened this issue Dec 29, 2018 · 1 comment

Comments

@DanielDorn
Copy link

DanielDorn commented Dec 29, 2018

Hello i am current creating a smaller more compact version of SFML mainly for use as my inhouse game engine, i came across a bug with EGLContext and patched it, but seeing as my engines code cant being integrated i would just like to post it as an issue and hopefully someone in the community can create a patch based on my findings,

this effects all versions of SFML supporting android to date, including 2.5.x

under the EGLContext.cpp file

//-------------------------------------------------------------------
void EglContext::destroySurface()
{	
    eglCheck(eglDestroySurface(m_display, m_surface));
    m_surface = EGL_NO_SURFACE;

       // Ensure that this context is no longer active since our surface is now destroyed
   setActive(false);
}

this code is bugged, you are essentially calling makecurrent with no surface which will in part cause many issues, the solution is pretty simple just move setActive before you destroy the active surface,

//-------------------------------------------------------------------
void EglContext::destroySurface()
{
    // Ensure that this context is no longer active since our surface is now destroyed
    setActive(false);

    eglCheck(eglDestroySurface(m_display, m_surface));
    m_surface = EGL_NO_SURFACE;
}

hope this helps, cheers (=

@binary1248
Copy link
Member

Should be fixed with #1531.

@eXpl0it3r eXpl0it3r added this to Discussion in SFML 2.6.0 via automation Jan 2, 2019
@eXpl0it3r eXpl0it3r added this to the 2.6 milestone Jan 2, 2019
@eXpl0it3r eXpl0it3r moved this from Discussion to Ready in SFML 2.6.0 Jan 2, 2019
SFML 2.6.0 automation moved this from Ready to Done Jan 4, 2019
Unarelith pushed a commit to Unarelith/SFML that referenced this issue May 28, 2020
Unarelith pushed a commit to Unarelith/SFML that referenced this issue May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
SFML 2.6.0
  
Done
Development

No branches or pull requests

3 participants