aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/main.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/main.cpp b/source/main.cpp
index 1437c4f..592350f 100644
--- a/source/main.cpp
+++ b/source/main.cpp
@@ -359,6 +359,10 @@ void main() {
App app;
glfwUserData.app = &app;
+ // NOTE: don't enable backface culling, because the game mainly runs in 2D and sometimes we'd like to flip sprites around
+ // it also helps with debugging layers in 3D view
+ glEnable(GL_DEPTH_TEST);
+
// 60 updates per second
constexpr double kMsPerUpdate = 1000.0 / 60;
constexpr double kSecondsPerUpdate = kMsPerUpdate / 1000;
@@ -403,7 +407,7 @@ void main() {
glViewport(0, 0, fbWidth, fbHeight);
auto clearColor = ImVec4(0.45f, 0.55f, 0.60f, 1.00f);
glClearColor(clearColor.x * clearColor.w, clearColor.y * clearColor.w, clearColor.z * clearColor.w, clearColor.w);
- glClear(GL_COLOR_BUFFER_BIT);
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
{ // Regular draw
ZoneScopedN("Render");