cube example: always set required state in paintGL
...instead of expecting whatever was set in initializeGL will persist. Task-number: QTBUG-111304 Pick-to: 6.5 6.4 Change-Id: Ifcf75a3df9bed6a45d2e9264a5e3f32504b42313 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
This commit is contained in:
parent
84f9293ea2
commit
25fcded977
@ -72,14 +72,6 @@ void MainWidget::initializeGL()
|
||||
initShaders();
|
||||
initTextures();
|
||||
|
||||
//! [2]
|
||||
// Enable depth buffer
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
// Enable back face culling
|
||||
glEnable(GL_CULL_FACE);
|
||||
//! [2]
|
||||
|
||||
geometries = new GeometryEngine;
|
||||
|
||||
// Use QBasicTimer because its faster than QTimer
|
||||
@ -147,6 +139,14 @@ void MainWidget::paintGL()
|
||||
// Clear color and depth buffer
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
//! [2]
|
||||
// Enable depth buffer
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
// Enable back face culling
|
||||
glEnable(GL_CULL_FACE);
|
||||
//! [2]
|
||||
|
||||
texture->bind();
|
||||
program.bind();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user