[Commits] SDL: emscripten: Fixed compiling without OpenGL support.

libsdl.org revision control commits-owner at libsdl.org
Sat Aug 5 13:20:40 PDT 2017


details:   https://hg.libsdl.org/SDL/rev/c3b94a174d81
changeset: 11191:c3b94a174d81
user:      Philipp Wiesemann <philipp.wiesemann at arcor.de>
date:      Sat Aug 05 22:10:48 2017 +0200
description:
emscripten: Fixed compiling without OpenGL support.

diffstat:

 src/video/emscripten/SDL_emscriptenvideo.c |  6 ++++++
 src/video/emscripten/SDL_emscriptenvideo.h |  2 ++
 2 files changed, 8 insertions(+), 0 deletions(-)

diffs (61 lines):

diff -r 478630f6b756 -r c3b94a174d81 src/video/emscripten/SDL_emscriptenvideo.c
--- a/src/video/emscripten/SDL_emscriptenvideo.c	Sat Aug 05 22:10:36 2017 +0200
+++ b/src/video/emscripten/SDL_emscriptenvideo.c	Sat Aug 05 22:10:48 2017 +0200
@@ -111,6 +111,7 @@
     device->UpdateWindowFramebuffer = Emscripten_UpdateWindowFramebuffer;
     device->DestroyWindowFramebuffer = Emscripten_DestroyWindowFramebuffer;
 
+#if SDL_VIDEO_OPENGL_EGL
     device->GL_LoadLibrary = Emscripten_GLES_LoadLibrary;
     device->GL_GetProcAddress = Emscripten_GLES_GetProcAddress;
     device->GL_UnloadLibrary = Emscripten_GLES_UnloadLibrary;
@@ -121,6 +122,7 @@
     device->GL_SwapWindow = Emscripten_GLES_SwapWindow;
     device->GL_DeleteContext = Emscripten_GLES_DeleteContext;
     device->GL_GetDrawableSize = Emscripten_GLES_GetDrawableSize;
+#endif
 
     device->free = Emscripten_DeleteDevice;
 
@@ -228,6 +230,7 @@
         }
     }
 
+#if SDL_VIDEO_OPENGL_EGL
     if (window->flags & SDL_WINDOW_OPENGL) {
         if (!_this->egl_data) {
             if (SDL_GL_LoadLibrary(NULL) < 0) {
@@ -240,6 +243,7 @@
             return SDL_SetError("Could not create GLES window surface");
         }
     }
+#endif
 
     wdata->window = window;
 
@@ -284,10 +288,12 @@
         data = (SDL_WindowData *) window->driverdata;
 
         Emscripten_UnregisterEventHandlers(data);
+#if SDL_VIDEO_OPENGL_EGL
         if (data->egl_surface != EGL_NO_SURFACE) {
             SDL_EGL_DestroySurface(_this, data->egl_surface);
             data->egl_surface = EGL_NO_SURFACE;
         }
+#endif
         SDL_free(window->driverdata);
         window->driverdata = NULL;
     }
diff -r 478630f6b756 -r c3b94a174d81 src/video/emscripten/SDL_emscriptenvideo.h
--- a/src/video/emscripten/SDL_emscriptenvideo.h	Sat Aug 05 22:10:36 2017 +0200
+++ b/src/video/emscripten/SDL_emscriptenvideo.h	Sat Aug 05 22:10:48 2017 +0200
@@ -28,7 +28,9 @@
 #include <emscripten/emscripten.h>
 #include <emscripten/html5.h>
 
+#if SDL_VIDEO_OPENGL_EGL
 #include <EGL/egl.h>
+#endif
 
 typedef struct SDL_WindowData
 {


More information about the commits mailing list