Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2010-12-04 00:17:15 +0000
committerStijn Buys <ingar@osirion.org>2010-12-04 00:17:15 +0000
commitaffa3d2a6761c4040434e11726695ad6e53a4cab (patch)
treeb707815ba3009c9bdc1f75759633ca9250396e0b /src/ui/modelview.cc
parenta92778d557df8bc853153d119224ea28390bdc9a (diff)
Correct camera axis and clear depth buffer when rendering ui models.
Diffstat (limited to 'src/ui/modelview.cc')
-rwxr-xr-xsrc/ui/modelview.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ui/modelview.cc b/src/ui/modelview.cc
index 6d4e0e4..613382a 100755
--- a/src/ui/modelview.cc
+++ b/src/ui/modelview.cc
@@ -155,8 +155,6 @@ void ModelView::draw()
math ::Vector2f center(global_location() + size() * 0.5f);
- gl::clear(GL_DEPTH_BUFFER_BIT);
-
const float minscreen(math::min(root()->width(),root()->height()));
const float minwidget(math::min(width(), height()));
const float reference_radius = radius() * minwidget / minscreen;
@@ -178,6 +176,9 @@ void ModelView::draw()
gl::enable(GL_CULL_FACE); // enable culling
gl::enable(GL_COLOR_MATERIAL); // enable color tracking
+ // clear depth buffer
+ gl::clear(GL_DEPTH_BUFFER_BIT);
+
// enable vertex arrays
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);