Don't add the OpenGL renderers for drivers that don't support OpenGL
authorSam Lantinga <slouken@libsdl.org>
Wed, 18 Nov 2009 09:17:29 +0000
changeset 3450 173199bce642
parent 3449 7bd010656baf
child 3451 a65f7b3a2524
Don't add the OpenGL renderers for drivers that don't support OpenGL
src/video/SDL_video.c
--- a/src/video/SDL_video.c	Wed Nov 18 09:07:13 2009 +0000
+++ b/src/video/SDL_video.c	Wed Nov 18 09:17:29 2009 +0000
@@ -256,13 +256,14 @@
     }
     /* The software renderer is always available */
     for (i = 0; i < _this->num_displays; ++i) {
+        if (_this->GL_CreateContext) {
 #if SDL_VIDEO_RENDER_OGL
-        SDL_AddRenderDriver(i, &GL_RenderDriver);
+            SDL_AddRenderDriver(i, &GL_RenderDriver);
 #endif
-
 #if SDL_VIDEO_RENDER_OGL_ES
-        SDL_AddRenderDriver(i, &GL_ES_RenderDriver);
+            SDL_AddRenderDriver(i, &GL_ES_RenderDriver);
 #endif
+        }
         if (_this->displays[i].num_render_drivers > 0) {
             SDL_AddRenderDriver(i, &SW_RenderDriver);
         }