From: Vadim Zeitlin Date: Sat, 8 Sep 2012 15:46:27 +0000 (+0000) Subject: Enable GL_CULL_FACE in OpenGL samples. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/948f48e7257086aef54f5ce853ff558014799338?hp=616ae1e8434e55bc11dcd0570e96a610bc7e88e5 Enable GL_CULL_FACE in OpenGL samples. Without it, the hidden faces are shown resulting in wrong display of both the cube and the penguin, at least with Mesa (but it also seems to be the correct thing to do according to OpenGL documentation). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72433 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/opengl/cube/cube.cpp b/samples/opengl/cube/cube.cpp index 76e7466a9f..cda5cca761 100644 --- a/samples/opengl/cube/cube.cpp +++ b/samples/opengl/cube/cube.cpp @@ -138,6 +138,7 @@ TestGLContext::TestGLContext(wxGLCanvas *canvas) SetCurrent(*canvas); // set up the parameters we want to use + glEnable(GL_CULL_FACE); glEnable(GL_DEPTH_TEST); glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); diff --git a/samples/opengl/penguin/penguin.cpp b/samples/opengl/penguin/penguin.cpp index b461b79df0..b60619ed77 100644 --- a/samples/opengl/penguin/penguin.cpp +++ b/samples/opengl/penguin/penguin.cpp @@ -276,7 +276,7 @@ void TestGLCanvas::InitGL() static const GLfloat light1_color[4] = { 0.4f, 0.4f, 1.0f, 1.0f }; /* remove back faces */ - glDisable(GL_CULL_FACE); + glEnable(GL_CULL_FACE); glEnable(GL_DEPTH_TEST); /* speedups */