diff src/video/SDL_video.c @ 3450:173199bce642

Don't add the OpenGL renderers for drivers that don't support OpenGL
author Sam Lantinga <slouken@libsdl.org>
date Wed, 18 Nov 2009 09:17:29 +0000
parents bc27e1fdd3a7
children e77a69aae239
line wrap: on
line diff
--- 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);
         }