diff --git a/src/hello.cpp b/src/hello.cpp index 9ea7e48..fcaa096 100644 --- a/src/hello.cpp +++ b/src/hello.cpp @@ -86,6 +86,8 @@ int initGraphics(GLFWwindow** window) return -1; } + glEnable(GL_DEPTH_TEST); + return 0; } @@ -155,8 +157,6 @@ int main() Icosphere sphere(0.5, 2); Orbit orbit(30, glm::vec3(.5, .5, 0)); - glEnable(GL_DEPTH_TEST); - // Main loop while (!glfwWindowShouldClose(window)) {