fix texture1 uniform name & two shader variables

This commit is contained in:
Charles Zhang
2017-06-29 18:37:08 +08:00
parent 905be9ce52
commit e7382fdfb0

View File

@@ -170,7 +170,7 @@ int main()
// shader configuration
// --------------------
shader.use();
shader.setInt("ourTexture", 0);
shader.setInt("texture1", 0);
// render loop
// -----------
@@ -243,12 +243,12 @@ int main()
model = glm::mat4();
model = glm::translate(model, glm::vec3(-1.0f, 0.0f, -1.0f));
model = glm::scale(model, glm::vec3(scale, scale, scale));
shader.setMat4("model", model);
shaderSingleColor.setMat4("model", model);
glDrawArrays(GL_TRIANGLES, 0, 36);
model = glm::mat4();
model = glm::translate(model, glm::vec3(2.0f, 0.0f, 0.0f));
model = glm::scale(model, glm::vec3(scale, scale, scale));
shader.setMat4("model", model);
shaderSingleColor.setMat4("model", model);
glDrawArrays(GL_TRIANGLES, 0, 36);
glBindVertexArray(0);
glStencilMask(0xFF);