You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
commit 1c29a16821c31a5c5c70c32e84c0c7e4cf5ef44a
Author: memeka <[email protected]>
Date: Sat Feb 28 12:52:35 2015 +1030
SDL: initialize EGL only if using SDL1; in SDL2, CreateWindow will also initialize EGL
diff --git a/base/PCMain.cpp b/base/PCMain.cpp
index 536d2fd..c05dc37 100644
--- a/base/PCMain.cpp
+++ b/base/PCMain.cpp
@@ -413,6 +413,10 @@ int main(int argc, char *argv[]) {
return 1;
}
+ SDL_version sdl_version;
+ SDL_GetVersion(&sdl_version);
+ bool sdl1 = sdl_version.major == 1;
+
#ifdef __APPLE__
// Make sure to request a somewhat modern GL context at least - the
// latest supported by MacOSX (really, really sad...)
@@ -424,7 +428,7 @@ int main(int argc, char *argv[]) {
#endif
#ifdef USING_EGL
- if (EGL_Open())
+ if (sdl1 && EGL_Open())
return 1;
#endif
@@ -552,7 +556,7 @@ int main(int argc, char *argv[]) {
}
#ifdef USING_EGL
- EGL_Init();
+ if (sdl1) EGL_Init();
#endif
#ifdef PPSSPP
@@ -850,7 +854,10 @@ int main(int argc, char *argv[]) {
}
#ifdef USING_EGL
- eglSwapBuffers(g_eglDisplay, g_eglSurface);
+ if (sdl1)
+ eglSwapBuffers(g_eglDisplay, g_eglSurface);
+ else
+ SDL_GL_SwapWindow(g_Screen);
#else
if (!keys[SDLK_TAB] || t - lastT >= 1.0/60.0)
{
@@ -877,7 +884,7 @@ int main(int argc, char *argv[]) {
SDL_CloseAudio();
NativeShutdown();
#ifdef USING_EGL
- EGL_Close();
+ if (sdl1) EGL_Close();
#endif
SDL_GL_DeleteContext(glContext);
SDL_Quit();
The text was updated successfully, but these errors were encountered:
mihailescu2m
changed the title
SDL2 CreateWindow calls all the necessary EGL init/open/close function
SDL2 CreateWindow calls all the necessary EGL init/open/close functions
Feb 28, 2015
The text was updated successfully, but these errors were encountered: