720 video->UpdateMouse(this); |
720 video->UpdateMouse(this); |
721 } |
721 } |
722 SDL_WM_GrabInput(saved_grab); |
722 SDL_WM_GrabInput(saved_grab); |
723 SDL_GetRelativeMouseState(NULL, NULL); /* Clear first large delta */ |
723 SDL_GetRelativeMouseState(NULL, NULL); /* Clear first large delta */ |
724 |
724 |
725 /* If we're running OpenGL, make the context current */ |
|
726 if ( (video->screen->flags & SDL_OPENGL) && |
|
727 video->GL_MakeCurrent ) { |
|
728 if ( video->GL_MakeCurrent(this) < 0 ) { |
|
729 return(NULL); |
|
730 } |
|
731 } |
|
732 |
|
733 /* Set up a fake SDL surface for OpenGL "blitting" */ |
|
734 if ( (flags & SDL_OPENGLBLIT) == SDL_OPENGLBLIT ) { |
|
735 /* Load GL functions for performing the texture updates */ |
|
736 #ifdef HAVE_OPENGL |
725 #ifdef HAVE_OPENGL |
|
726 /* Load GL symbols (before MakeCurrent, where we need glGetString). */ |
|
727 if ( flags & (SDL_OPENGL | SDL_OPENGLBLIT) ) { |
737 #define SDL_PROC(ret,func,params) \ |
728 #define SDL_PROC(ret,func,params) \ |
738 do { \ |
729 do { \ |
739 video->func = SDL_GL_GetProcAddress(#func); \ |
730 video->func = SDL_GL_GetProcAddress(#func); \ |
740 if ( ! video->func ) { \ |
731 if ( ! video->func ) { \ |
741 SDL_SetError("Couldn't load GL function: %s\n", #func); \ |
732 SDL_SetError("Couldn't load GL function: %s\n", #func); \ |
742 return(NULL); \ |
733 return(NULL); \ |
743 } \ |
734 } \ |
744 } while ( 0 ); |
735 } while ( 0 ); |
745 #include "SDL_glfuncs.h" |
736 #include "SDL_glfuncs.h" |
746 #undef SDL_PROC |
737 #undef SDL_PROC |
|
738 } |
|
739 #endif |
|
740 |
|
741 /* If we're running OpenGL, make the context current */ |
|
742 if ( (video->screen->flags & SDL_OPENGL) && |
|
743 video->GL_MakeCurrent ) { |
|
744 if ( video->GL_MakeCurrent(this) < 0 ) { |
|
745 return(NULL); |
|
746 } |
|
747 } |
|
748 |
|
749 /* Set up a fake SDL surface for OpenGL "blitting" */ |
|
750 if ( (flags & SDL_OPENGLBLIT) == SDL_OPENGLBLIT ) { |
|
751 /* Load GL functions for performing the texture updates */ |
|
752 #ifdef HAVE_OPENGL |
747 |
753 |
748 /* Create a software surface for blitting */ |
754 /* Create a software surface for blitting */ |
749 #ifdef GL_VERSION_1_2 |
755 #ifdef GL_VERSION_1_2 |
750 /* If the implementation either supports the packed pixels |
756 /* If the implementation either supports the packed pixels |
751 extension, or implements the core OpenGL 1.2 API, it will |
757 extension, or implements the core OpenGL 1.2 API, it will |