im getting a rare crash i cannot reproduce when calling
SDL_GL_SwapWindow(window);
in android sdl2.0.9
does any one know whats the issue?
at SDL_elg.c in this code the error is returned:
int
SDL_EGL_SwapBuffers(_THIS, EGLSurface egl_surface)
{
if (!_this->egl_data->eglSwapBuffers(_this->egl_data->egl_display, egl_surface)) {
return SDL_EGL_SetError("unable to show color buffer in an OS-native window", "eglSwapBuffers");
}
return 0;
}
this is the init flow:
if (SDL_Init(SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS) == 0)
{
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
window = SDL_CreateWindow("game", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, width, height, SDL_WINDOW_FULLSCREEN | SDL_WINDOW_OPENGL);
isRunning = true;
if (!window)
{
SDL_Log("Error creating window: %s", SDL_GetError());
isRunning = false;
return;
}
glcontext = SDL_GL_CreateContext(window);
if (!glcontext)
{
std::cerr << "Error creating GL context: " << SDL_GetError() << std::endl;
isRunning = false;
return;
}
SDL_GL_SetSwapInterval(1);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
}