From 134d967be2dd4ba9531abb8ba8494c3ac423ca72 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Wed, 3 Oct 2018 23:02:45 +1000 Subject: Refactoring and cleanup of GLInterface (now GLContext) --- Source/Core/Common/GL/GLUtil.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'Source/Core/Common/GL/GLUtil.cpp') diff --git a/Source/Core/Common/GL/GLUtil.cpp b/Source/Core/Common/GL/GLUtil.cpp index 02a38d8654..729cc2c25d 100644 --- a/Source/Core/Common/GL/GLUtil.cpp +++ b/Source/Core/Common/GL/GLUtil.cpp @@ -5,19 +5,12 @@ #include #include "Common/Assert.h" -#include "Common/GL/GLInterfaceBase.h" +#include "Common/GL/GLContext.h" #include "Common/GL/GLUtil.h" #include "Common/Logging/Log.h" -std::unique_ptr GLInterface; - namespace GLUtil { -void InitInterface() -{ - GLInterface = HostGL_CreateGLInterface(); -} - GLuint CompileProgram(const std::string& vertexShader, const std::string& fragmentShader) { // generate objects @@ -107,7 +100,7 @@ void EnablePrimitiveRestart() { constexpr GLuint PRIMITIVE_RESTART_INDEX = 65535; - if (GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGLES3) + if (g_main_gl_context->GetMode() == GLContext::Mode::OpenGLES) { glEnable(GL_PRIMITIVE_RESTART_FIXED_INDEX); } @@ -125,4 +118,4 @@ void EnablePrimitiveRestart() } } } -} +} // namespace GLUtil -- cgit v1.2.3 From dcdd02d646230e7903520a41dc9f86e57ae16dbe Mon Sep 17 00:00:00 2001 From: Stenzek Date: Wed, 3 Oct 2018 23:03:26 +1000 Subject: GLContext: Remove global context pointer --- Source/Core/Common/GL/GLUtil.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/Core/Common/GL/GLUtil.cpp') diff --git a/Source/Core/Common/GL/GLUtil.cpp b/Source/Core/Common/GL/GLUtil.cpp index 729cc2c25d..ba0f76b9b0 100644 --- a/Source/Core/Common/GL/GLUtil.cpp +++ b/Source/Core/Common/GL/GLUtil.cpp @@ -96,11 +96,11 @@ GLuint CompileProgram(const std::string& vertexShader, const std::string& fragme return programID; } -void EnablePrimitiveRestart() +void EnablePrimitiveRestart(const GLContext* context) { constexpr GLuint PRIMITIVE_RESTART_INDEX = 65535; - if (g_main_gl_context->GetMode() == GLContext::Mode::OpenGLES) + if (context->IsGLES()) { glEnable(GL_PRIMITIVE_RESTART_FIXED_INDEX); } -- cgit v1.2.3