From ce869ba55abf9a3c5cc702434f46909e434688dd Mon Sep 17 00:00:00 2001 From: fgenesis Date: Tue, 15 Nov 2016 04:49:53 +0100 Subject: [PATCH] Load GL symbols *after* creating the window, else we only get a basic GL 1.1 context --- BBGE/Core.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/BBGE/Core.cpp b/BBGE/Core.cpp index cb92ad7..c32a354 100644 --- a/BBGE/Core.cpp +++ b/BBGE/Core.cpp @@ -606,23 +606,6 @@ void Core::init() exit_error("Failed to init SDL"); } -#if BBGE_BUILD_OPENGL_DYNAMIC - if (SDL_GL_LoadLibrary(NULL) == -1) - { - std::string err = std::string("SDL_GL_LoadLibrary Error: ") + std::string(SDL_GetError()); - SDL_Quit(); - exit_error(err); - } - - if (!lookup_all_glsyms()) - { - std::ostringstream os; - os << "Couldn't load OpenGL symbols we need\n"; - SDL_Quit(); - exit_error(os.str()); - } -#endif - loopDone = false; initLocalization(); @@ -857,6 +840,23 @@ bool Core::initGraphicsLibrary(int width, int height, bool fullscreen, bool vsyn #endif } +#if BBGE_BUILD_OPENGL_DYNAMIC + if (SDL_GL_LoadLibrary(NULL) == -1) + { + std::string err = std::string("SDL_GL_LoadLibrary Error: ") + std::string(SDL_GetError()); + SDL_Quit(); + exit_error(err); + } + + if (!lookup_all_glsyms()) + { + std::ostringstream os; + os << "Couldn't load OpenGL symbols we need\n"; + SDL_Quit(); + exit_error(os.str()); + } +#endif + debugLog("GL vendor, renderer & version:"); debugLog((const char*)glGetString(GL_VENDOR)); debugLog((const char*)glGetString(GL_RENDERER));