We need to lookup the address of glGetString before calling GL_MakeCurrent(),
authorRyan C. Gordon <icculus@icculus.org>
Sat, 12 Jul 2003 13:30:30 +0000
changeset 650fe445b59d307
parent 649 81c74904f51f
child 651 35ff0890ac4e
We need to lookup the address of glGetString before calling GL_MakeCurrent(),
since the X11 target needs to query for extensions in there...hopefully this
other platforms don't need to have a current context before symbol lookup
works or something strange like that... --ryan.
src/video/SDL_video.c
     1.1 --- a/src/video/SDL_video.c	Thu Jul 10 07:56:19 2003 +0000
     1.2 +++ b/src/video/SDL_video.c	Sat Jul 12 13:30:30 2003 +0000
     1.3 @@ -722,6 +722,22 @@
     1.4  	SDL_WM_GrabInput(saved_grab);
     1.5  	SDL_GetRelativeMouseState(NULL, NULL); /* Clear first large delta */
     1.6  
     1.7 +#ifdef HAVE_OPENGL
     1.8 +	/* Load GL symbols (before MakeCurrent, where we need glGetString). */
     1.9 +	if ( flags & (SDL_OPENGL | SDL_OPENGLBLIT) ) {
    1.10 +#define SDL_PROC(ret,func,params) \
    1.11 +do { \
    1.12 +	video->func = SDL_GL_GetProcAddress(#func); \
    1.13 +	if ( ! video->func ) { \
    1.14 +		SDL_SetError("Couldn't load GL function: %s\n", #func); \
    1.15 +		return(NULL); \
    1.16 +	} \
    1.17 +} while ( 0 );
    1.18 +#include "SDL_glfuncs.h"
    1.19 +#undef SDL_PROC	
    1.20 +	}
    1.21 +#endif
    1.22 +
    1.23  	/* If we're running OpenGL, make the context current */
    1.24  	if ( (video->screen->flags & SDL_OPENGL) &&
    1.25  	      video->GL_MakeCurrent ) {
    1.26 @@ -734,16 +750,6 @@
    1.27  	if ( (flags & SDL_OPENGLBLIT) == SDL_OPENGLBLIT ) {
    1.28  		/* Load GL functions for performing the texture updates */
    1.29  #ifdef HAVE_OPENGL
    1.30 -#define SDL_PROC(ret,func,params) \
    1.31 -do { \
    1.32 -	video->func = SDL_GL_GetProcAddress(#func); \
    1.33 -	if ( ! video->func ) { \
    1.34 -		SDL_SetError("Couldn't load GL function: %s\n", #func); \
    1.35 -		return(NULL); \
    1.36 -	} \
    1.37 -} while ( 0 );
    1.38 -#include "SDL_glfuncs.h"
    1.39 -#undef SDL_PROC	
    1.40  
    1.41  		/* Create a software surface for blitting */
    1.42  #ifdef GL_VERSION_1_2