mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:27:45 +00:00
Demos: GLTeapot: Enable depth testing in demo
This commit is contained in:
parent
e8f66f821c
commit
e4db18e644
1 changed files with 3 additions and 1 deletions
|
@ -36,6 +36,7 @@ private:
|
||||||
GL::make_context_current(m_context);
|
GL::make_context_current(m_context);
|
||||||
glFrontFace(GL_CW);
|
glFrontFace(GL_CW);
|
||||||
glEnable(GL_CULL_FACE);
|
glEnable(GL_CULL_FACE);
|
||||||
|
glEnable(GL_DEPTH_TEST);
|
||||||
|
|
||||||
// Set projection matrix
|
// Set projection matrix
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
|
@ -72,7 +73,8 @@ void GLContextWidget::timer_event(Core::TimerEvent&)
|
||||||
angle -= 0.01f;
|
angle -= 0.01f;
|
||||||
|
|
||||||
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
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))
|
auto matrix = FloatMatrix4x4::translate(FloatVector3(0, 0, -8.5))
|
||||||
* FloatMatrix4x4::rotate(FloatVector3(1, 0, 0), angle)
|
* FloatMatrix4x4::rotate(FloatVector3(1, 0, 0), angle)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue