From e4db18e6443d84e44c6f2713780cce1c3739f463 Mon Sep 17 00:00:00 2001 From: Stephan Unverwerth Date: Sat, 8 May 2021 23:20:11 +0200 Subject: [PATCH] Demos: GLTeapot: Enable depth testing in demo --- Userland/Demos/GLTeapot/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Userland/Demos/GLTeapot/main.cpp b/Userland/Demos/GLTeapot/main.cpp index dead9e6d6a..a2017b77dc 100644 --- a/Userland/Demos/GLTeapot/main.cpp +++ b/Userland/Demos/GLTeapot/main.cpp @@ -36,6 +36,7 @@ private: GL::make_context_current(m_context); glFrontFace(GL_CW); glEnable(GL_CULL_FACE); + glEnable(GL_DEPTH_TEST); // Set projection matrix glMatrixMode(GL_PROJECTION); @@ -72,7 +73,8 @@ void GLContextWidget::timer_event(Core::TimerEvent&) angle -= 0.01f; glClearColor(0.0f, 0.0f, 0.0f, 1.0f); - glClear(GL_COLOR_BUFFER_BIT); + glClearDepth(1.0); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); auto matrix = FloatMatrix4x4::translate(FloatVector3(0, 0, -8.5)) * FloatMatrix4x4::rotate(FloatVector3(1, 0, 0), angle)