This commit is contained in:
parent
6e69a543f0
commit
78ba333164
10
src/main.cpp
10
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]);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user