diff --git a/src/main.cpp b/src/main.cpp index 6fdb019..650f07d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -70,18 +70,16 @@ int main(void) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); shaderProgram->use(); - shaderProgram->setInt("Tex0", 0); shaderProgram->setMat4("view", cam->getView()); shaderProgram->setMat4("projection", cam->getProjection()); glBindVertexArray(VAO); + texture->bind(GL_TEXTURE0); + texture2->bind(GL_TEXTURE1); + glActiveTexture(GL_TEXTURE0); for (unsigned int i = 0; i < 10; i++) { - if (i % 2 == 0) { - texture->bind(GL_TEXTURE0); - } else { - texture2->bind(GL_TEXTURE0); - } + shaderProgram->setInt("tex0", i%2); glm::mat4 model = glm::mat4(1.0f); model = glm::translate(model, cubePositions[i]);