summaryrefslogtreecommitdiff
path: root/Source/Core/Common/GL/GLUtil.cpp
diff options
context:
space:
mode:
authorStenzek <stenzek@users.noreply.github.com>2018-10-24 14:51:21 +1100
committerGitHub <noreply@github.com>2018-10-24 14:51:21 +1100
commitc4d1e4adffcd380cc87b841069ce2fe8b62d7b60 (patch)
treec61a0a07c14ccc3c1f7247bdcc82927a82c145bb /Source/Core/Common/GL/GLUtil.cpp
parent9c9d598ec006527bc47aea306e5171d03c12c5f5 (diff)
parent2c6d96433c322b50470705d43005fd6308506d49 (diff)
Merge pull request #7450 from stenzek/glcontext
GLInterface refactoring/cleanup and runtime platform selection
Diffstat (limited to 'Source/Core/Common/GL/GLUtil.cpp')
-rw-r--r--Source/Core/Common/GL/GLUtil.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/Source/Core/Common/GL/GLUtil.cpp b/Source/Core/Common/GL/GLUtil.cpp
index 02a38d8654..ba0f76b9b0 100644
--- a/Source/Core/Common/GL/GLUtil.cpp
+++ b/Source/Core/Common/GL/GLUtil.cpp
@@ -5,19 +5,12 @@
#include <memory>
#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<cInterfaceBase> GLInterface;
-
namespace GLUtil
{
-void InitInterface()
-{
- GLInterface = HostGL_CreateGLInterface();
-}
-
GLuint CompileProgram(const std::string& vertexShader, const std::string& fragmentShader)
{
// generate objects
@@ -103,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 (GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGLES3)
+ if (context->IsGLES())
{
glEnable(GL_PRIMITIVE_RESTART_FIXED_INDEX);
}
@@ -125,4 +118,4 @@ void EnablePrimitiveRestart()
}
}
}
-}
+} // namespace GLUtil