From cfb3ad598ff6972d170f67edaab9cf7b1210f9a2 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Sun, 11 Sep 2016 21:59:48 -0400 Subject: [PATCH] SDL support for glad --- Engine/source/gfx/gl/sdl/gfxGLDevice.sdl.cpp | 8 +++++--- Engine/source/platformSDL/sdlPlatformGL.cpp | 5 ----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Engine/source/gfx/gl/sdl/gfxGLDevice.sdl.cpp b/Engine/source/gfx/gl/sdl/gfxGLDevice.sdl.cpp index 74e1773fc..a3a5f3694 100644 --- a/Engine/source/gfx/gl/sdl/gfxGLDevice.sdl.cpp +++ b/Engine/source/gfx/gl/sdl/gfxGLDevice.sdl.cpp @@ -106,6 +106,10 @@ void GFXGLDevice::enumerateAdapters( Vector &adapterList ) AssertFatal(0, err ); } + // Init GL + loadGLCore(); + loadGLExtensions(tempContext); + //check minimun Opengl 3.2 int major, minor; glGetIntegerv(GL_MAJOR_VERSION, &major); @@ -114,8 +118,6 @@ void GFXGLDevice::enumerateAdapters( Vector &adapterList ) { return; } - - loadGLCore(); GFXAdapter *toAdd = new GFXAdapter; toAdd->mIndex = 0; @@ -163,7 +165,7 @@ void GFXGLDevice::init( const GFXVideoMode &mode, PlatformWindow *window ) PlatformGL::MakeCurrentGL( x11Window, mContext ); loadGLCore(); - loadGLExtensions(0); + loadGLExtensions(mContext); // It is very important that extensions be loaded before we call initGLState() initGLState(); diff --git a/Engine/source/platformSDL/sdlPlatformGL.cpp b/Engine/source/platformSDL/sdlPlatformGL.cpp index bc663cef6..5d4038c1c 100644 --- a/Engine/source/platformSDL/sdlPlatformGL.cpp +++ b/Engine/source/platformSDL/sdlPlatformGL.cpp @@ -68,11 +68,6 @@ namespace PlatformGL Con::printf( err ); AssertFatal(0, err ); } - - #ifdef TORQUE_OS_WIN - // JTH: Update the internals of epoxy on windows. - epoxy_handle_external_wglMakeCurrent(); - #endif } void setVSync(const int i)