diff --git a/graphics.cc b/graphics.cc index 9ec7e48..2da3a50 100644 --- a/graphics.cc +++ b/graphics.cc @@ -27,6 +27,13 @@ Graphics::Graphics() { void Graphics::init(Level* level) { // save Level this->level = level; + + // OpenGL state: + glClearColor( 0.0, 0.0, 0.0, 1.0 ); + glEnable( GL_DEPTH_TEST ); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS); // update lights on creation lastUpdate = -lightUpdateDelay; diff --git a/main.cc b/main.cc index 08ddf72..b8afae6 100644 --- a/main.cc +++ b/main.cc @@ -126,12 +126,6 @@ int main( int argc, char *argv[] ) // Enable vertical sync (on cards that support it) with parameter 1 - 0 means off glfwSwapInterval( 0 ); - // OpenGL state: - glClearColor( 0.0, 0.0, 0.0, 1.0 ); - glEnable( GL_DEPTH_TEST ); - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS); app.init(); int frameCount = 0;