diff options
Diffstat (limited to 'backends')
-rw-r--r-- | backends/graphics/opengl/pipelines/shader.cpp | 4 | ||||
-rw-r--r-- | backends/graphics/opengl/shader.cpp | 5 | ||||
-rw-r--r-- | backends/graphics/opengl/texture.cpp | 1 |
3 files changed, 7 insertions, 3 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/shader.cpp b/backends/graphics/opengl/shader.cpp index 27981f25dc..0b4c677d70 100644 --- a/backends/graphics/opengl/shader.cpp +++ b/backends/graphics/opengl/shader.cpp @@ -37,7 +37,7 @@ namespace { #pragma mark - Builtin Shader Sources - -const char *const g_defaultVertexShader = +const char *const g_defaultVertexShader = "attribute vec4 position;\n" "attribute vec2 texCoordIn;\n" "attribute vec4 blendColorIn;\n" @@ -286,6 +286,9 @@ GLshader Shader::compileShader(const char *source, GLenum shaderType) { } ShaderManager::ShaderManager() : _initializeShaders(true) { + for (int i = 0; i < ARRAYSIZE(_builtIn); ++i) { + _builtIn[i] = nullptr; + } } ShaderManager::~ShaderManager() { 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() { |