From 1ab1c30e394acad5ca79cdae47d608eeb8b50d2a Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Thu, 1 Oct 2020 18:37:31 +0100 Subject: [PATCH] Remove glGetTexImage/glBindFragDataLocation on GLES. These functions are not available in GLES3. --- OpenRA.Platforms.Default/OpenGL.cs | 13 +++++++++++-- OpenRA.Platforms.Default/Shader.cs | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/OpenRA.Platforms.Default/OpenGL.cs b/OpenRA.Platforms.Default/OpenGL.cs index 7f49bb34ad..dbf6ffe9a7 100644 --- a/OpenRA.Platforms.Default/OpenGL.cs +++ b/OpenRA.Platforms.Default/OpenGL.cs @@ -596,15 +596,24 @@ namespace OpenRA.Platforms.Default glBindTexture = Bind("glBindTexture"); glActiveTexture = Bind("glActiveTexture"); glTexImage2D = Bind("glTexImage2D"); - glGetTexImage = Bind("glGetTexImage"); glTexParameteri = Bind("glTexParameteri"); glTexParameterf = Bind("glTexParameterf"); if (Profile != GLProfile.Legacy) { + if (Profile != GLProfile.Embedded) + { + glGetTexImage = Bind("glGetTexImage"); + glBindFragDataLocation = Bind("glBindFragDataLocation"); + } + else + { + glGetTexImage = null; + glBindFragDataLocation = null; + } + glGenVertexArrays = Bind("glGenVertexArrays"); glBindVertexArray = Bind("glBindVertexArray"); - glBindFragDataLocation = Bind("glBindFragDataLocation"); glGenFramebuffers = Bind("glGenFramebuffers"); glBindFramebuffer = Bind("glBindFramebuffer"); glFramebufferTexture2D = Bind("glFramebufferTexture2D"); diff --git a/OpenRA.Platforms.Default/Shader.cs b/OpenRA.Platforms.Default/Shader.cs index 1ae7dd9b67..0062434af5 100644 --- a/OpenRA.Platforms.Default/Shader.cs +++ b/OpenRA.Platforms.Default/Shader.cs @@ -84,7 +84,7 @@ namespace OpenRA.Platforms.Default OpenGL.glBindAttribLocation(program, TintAttributeIndex, "aVertexTint"); OpenGL.CheckGLError(); - if (OpenGL.Profile != GLProfile.Legacy) + if (OpenGL.Profile == GLProfile.Modern) { OpenGL.glBindFragDataLocation(program, 0, "fragColor"); OpenGL.CheckGLError();