fix shaders for OpenGL ES

This commit is contained in:
Eduardo Bart
2011-12-06 23:48:39 -02:00
parent a6b66e3f7e
commit f89bc352d5
4 changed files with 15 additions and 16 deletions

View File

@@ -36,10 +36,8 @@ void Painter::init()
setCompositionMode(CompositionMode_SourceOver);
PainterShaderProgramPtr program = PainterShaderProgramPtr(new PainterShaderProgram);
program->addShaderFromSourceCode(Shader::Vertex, glslMainWithTexCoordsVertexShader);
program->addShaderFromSourceCode(Shader::Vertex, glslPositionOnlyVertexShader);
program->addShaderFromSourceCode(Shader::Fragment, glslMainFragmentShader);
program->addShaderFromSourceCode(Shader::Fragment, glslTextureSrcFragmentShader);
program->addShaderFromSourceCode(Shader::Vertex, glslMainWithTexCoordsVertexShader + glslPositionOnlyVertexShader);
program->addShaderFromSourceCode(Shader::Fragment, glslMainFragmentShader + glslTextureSrcFragmentShader);
program->bindAttributeLocation(VERTEX_COORDS_ATTR, "vertexCoord");
program->bindAttributeLocation(TEXTURE_COORDS_ATTR, "textureCoord");
assert(program->link());
@@ -51,10 +49,8 @@ void Painter::init()
m_drawTexturedProgram = program;
program = PainterShaderProgramPtr(new PainterShaderProgram);
program->addShaderFromSourceCode(Shader::Vertex, glslMainVertexShader);
program->addShaderFromSourceCode(Shader::Vertex, glslPositionOnlyVertexShader);
program->addShaderFromSourceCode(Shader::Fragment, glslMainFragmentShader);
program->addShaderFromSourceCode(Shader::Fragment, glslSolidColorFragmentShader);
program->addShaderFromSourceCode(Shader::Vertex, glslMainVertexShader + glslPositionOnlyVertexShader);
program->addShaderFromSourceCode(Shader::Fragment, glslMainFragmentShader + glslSolidColorFragmentShader);
program->bindAttributeLocation(VERTEX_COORDS_ATTR, "vertexCoord");
assert(program->link());
program->bindUniformLocation(PainterShaderProgram::PROJECTION_MATRIX_UNIFORM, "projectionMatrix");