summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2023-10-01 09:48:35 +0200
committerMitya Selivanov <automainint@guattari.tech>2023-10-01 09:48:35 +0200
commit6504efe0032ada117b09f1130cf9841b64c54aa7 (patch)
treea1185c46a38f08894d44d4c18a577907fb505d13
parent6f3be6d907f9dad9bd0d1b725d3609be0e7ce4df (diff)
downloadsaw-6504efe0032ada117b09f1130cf9841b64c54aa7.zip
emscripten glClearDepth fix
-rw-r--r--source/saw/main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/saw/main.c b/source/saw/main.c
index 3add53a..d67efd1 100644
--- a/source/saw/main.c
+++ b/source/saw/main.c
@@ -1530,7 +1530,11 @@ static void saw_frame(void) {
glViewport(0, 0, frame_width, frame_height);
glClearColor(.15f, .12f, .10f, 1.f);
+#ifdef __EMSCRIPTEN__
+ glClearDepthf(1.f);
+#else
glClearDepth(1.);
+#endif
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT |
GL_STENCIL_BUFFER_BIT);