Update render.cpp
This commit is contained in:
@@ -40,16 +40,19 @@ void Render::render() {
|
||||
glLoadIdentity();
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST_MIPMAP_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
//TODO: *Always* render the camera first.
|
||||
glCullFace(GL_BACK);
|
||||
for (auto& e : engine->world->GetChildren()) {
|
||||
if (e->draw)
|
||||
e->render();
|
||||
}
|
||||
if (engine->glError != GL_NO_ERROR)
|
||||
std::cerr << "OpenGL: " << glGetError() << std::endl;
|
||||
engine->glError = glGetError();
|
||||
if (engine->glError != GL_NO_ERROR) {
|
||||
std::cerr << "OpenGL: " << gluErrorString(engine->glError) << std::endl;
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
void Render::post_render() {
|
||||
@@ -57,8 +60,8 @@ void Render::post_render() {
|
||||
e->post_render();
|
||||
|
||||
//Reset all the transformations for the next frame.
|
||||
glPopMatrix();
|
||||
glPushMatrix();
|
||||
glPopMatrix();
|
||||
RWindow::glSwapBuffers();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user