aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorJohannes Schickel2016-05-03 20:39:13 +0200
committerJohannes Schickel2016-05-03 20:43:18 +0200
commit8ff5329b496c4d599f95eb2703716506bff94ffa (patch)
treec6fb2a6dac73513e478163ac545d7f51917486ee /backends
parent8cf10f0a5a7e1bb630fb8ddea848ea11f85726a4 (diff)
downloadscummvm-rg350-8ff5329b496c4d599f95eb2703716506bff94ffa.tar.gz
scummvm-rg350-8ff5329b496c4d599f95eb2703716506bff94ffa.tar.bz2
scummvm-rg350-8ff5329b496c4d599f95eb2703716506bff94ffa.zip
OPENGL: Assure color attributes for shader pipeline are always set.
Diffstat (limited to 'backends')
-rw-r--r--backends/graphics/opengl/pipelines/shader.cpp4
-rw-r--r--backends/graphics/opengl/texture.cpp1
2 files changed, 3 insertions, 2 deletions
diff --git a/backends/graphics/opengl/pipelines/shader.cpp b/backends/graphics/opengl/pipelines/shader.cpp
index 8e38458f73..a2dabb7c22 100644
--- a/backends/graphics/opengl/pipelines/shader.cpp
+++ b/backends/graphics/opengl/pipelines/shader.cpp
@@ -56,6 +56,8 @@ void ShaderPipeline::activateInternal() {
}
_activeShader->activate();
+
+ GL_CALL(glVertexAttribPointer(_colorAttribLocation, 4, GL_FLOAT, GL_FALSE, 0, _colorAttributes));
}
void ShaderPipeline::deactivateInternal() {
@@ -74,8 +76,6 @@ void ShaderPipeline::setColor(GLfloat r, GLfloat g, GLfloat b, GLfloat a) {
*dst++ = b;
*dst++ = a;
}
-
- GL_CALL(glVertexAttribPointer(_colorAttribLocation, 4, GL_FLOAT, GL_FALSE, 0, _colorAttributes));
}
void ShaderPipeline::drawTexture(const GLTexture &texture, const GLfloat *coordinates) {
diff --git a/backends/graphics/opengl/texture.cpp b/backends/graphics/opengl/texture.cpp
index 8b94549971..33598b5488 100644
--- a/backends/graphics/opengl/texture.cpp
+++ b/backends/graphics/opengl/texture.cpp
@@ -509,6 +509,7 @@ TextureCLUT8GPU::TextureCLUT8GPU()
// Setup pipeline.
_clut8Pipeline->setFramebuffer(_target);
_clut8Pipeline->setPaletteTexture(&_paletteTexture);
+ _clut8Pipeline->setColor(1.0f, 1.0f, 1.0f, 1.0f);
}
TextureCLUT8GPU::~TextureCLUT8GPU() {