mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
Demos: GLTeapot: Enable depth testing in demo
This commit is contained in:
parent
e8f66f821c
commit
e4db18e644
Notes:
sideshowbarker
2024-07-18 18:26:16 +09:00
Author: https://github.com/sunverwerth Commit: https://github.com/SerenityOS/serenity/commit/e4db18e6443 Pull-request: https://github.com/SerenityOS/serenity/pull/6973
1 changed files with 3 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue