diff src/render/opengl/SDL_render_gl.c @ 5207:daa5463466c5

Fixed building on Android, added SDL_opengles2.h, removed unnecessary SDL_glesfuncs.h
author Sam Lantinga <slouken@libsdl.org>
date Sun, 06 Feb 2011 02:35:14 -0800
parents 25ffd4e5255c
children 2178ffe17222
line wrap: on
line diff
--- a/src/render/opengl/SDL_render_gl.c	Sun Feb 06 00:48:41 2011 -0800
+++ b/src/render/opengl/SDL_render_gl.c	Sun Feb 06 02:35:14 2011 -0800
@@ -88,7 +88,7 @@
 
     /* OpenGL functions */
 #define SDL_PROC(ret,func,params) ret (APIENTRY *func) params;
-#include "../../video/SDL_glfuncs.h"
+#include "SDL_glfuncs.h"
 #undef SDL_PROC
 
     void (*glTextureRangeAPPLE) (GLenum target, GLsizei length,
@@ -161,7 +161,7 @@
     } while ( 0 );
 #endif /* __SDL_NOGETPROCADDR__ */
 
-#include "../../video/SDL_glfuncs.h"
+#include "SDL_glfuncs.h"
 #undef SDL_PROC
     return 0;
 }
@@ -213,11 +213,6 @@
 
     renderer->info.flags = SDL_RENDERER_ACCELERATED;
 
-    if (GL_LoadFunctions(data) < 0) {
-        GL_DestroyRenderer(renderer);
-        return NULL;
-    }
-
     data->context = SDL_GL_CreateContext(window);
     if (!data->context) {
         GL_DestroyRenderer(renderer);
@@ -227,6 +222,12 @@
         GL_DestroyRenderer(renderer);
         return NULL;
     }
+
+    if (GL_LoadFunctions(data) < 0) {
+        GL_DestroyRenderer(renderer);
+        return NULL;
+    }
+
 #ifdef __MACOSX__
     /* Enable multi-threaded rendering */
     /* Disabled until Ryan finishes his VBO/PBO code...