Commit 0d339059 authored by Jan Möbius's avatar Jan Möbius

Moved to GLDepthImage in glstate

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@12600 383ad7c9-94d9-4d36-a494-682f7c89f535
parent d45675a3
......@@ -271,26 +271,26 @@ draw(GLState& _state , const DrawModes::DrawMode& /*_drawMode*/)
// clear the depth buffer behind the coordsys
glDepthRange (1.0, 1.0);
ACG::GLState::depthRange (1.0, 1.0);
ACG::GLState::depthFunc (GL_ALWAYS);
drawCoordsys(_state);
glDepthRange (0.0, 1.0);
ACG::GLState::depthRange (0.0, 1.0);
ACG::GLState::depthFunc (GL_LESS);
// draw coordsys
drawCoordsys(_state);
// set depth buffer to 0 so that nothing can paint over cordsys
glDepthRange (0.0, 0.0);
ACG::GLState::depthRange (0.0, 0.0);
ACG::GLState::depthFunc (GL_ALWAYS);
glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE);
// Koordinatensystem zeichnen
drawCoordsys(_state);
glDepthRange (0.0, 1.0);
ACG::GLState::depthRange (0.0, 1.0);
ACG::GLState::depthFunc (prev_depth);
glColorMask (colorMask[0], colorMask[1], colorMask[2], colorMask[3]);
......@@ -309,21 +309,21 @@ draw(GLState& _state , const DrawModes::DrawMode& /*_drawMode*/)
_state.set_modelview (modelview);
// clear depth buffer in coordsys region
glDepthRange (1.0, 1.0);
ACG::GLState::depthRange (1.0, 1.0);
ACG::GLState::depthFunc (GL_ALWAYS);
// Koordinatensystem zeichnen
drawCoordsys(_state);
// draw coordsys in normal mode
glDepthRange (0.0, 1.0);
ACG::GLState::depthRange (0.0, 1.0);
ACG::GLState::depthFunc (GL_LESS);
// Koordinatensystem zeichnen
drawCoordsys(_state);
// set depth buffer to 0 so that nothing can paint over cordsys
glDepthRange (0.0, 0.0);
ACG::GLState::depthRange (0.0, 0.0);
ACG::GLState::depthFunc (GL_ALWAYS);
glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE);
......@@ -331,7 +331,7 @@ draw(GLState& _state , const DrawModes::DrawMode& /*_drawMode*/)
drawCoordsys(_state);
// reset to default
glDepthRange (0.0, 1.0);
ACG::GLState::depthRange (0.0, 1.0);
ACG::GLState::depthFunc (prev_depth);
glColorMask (colorMask[0], colorMask[1], colorMask[2], colorMask[3]);
}
......@@ -452,21 +452,21 @@ CoordsysNode::pick(GLState& _state, PickTarget _target)
else
{
// clear depth buffer in coordsys region
glDepthRange (1.0, 1.0);
ACG::GLState::depthRange (1.0, 1.0);
ACG::GLState::depthFunc (GL_ALWAYS);
// Koordinatensystem zeichnen
drawCoordsys(_state);
// draw coordsys in normal mode
glDepthRange (0.0, 1.0);
ACG::GLState::depthRange (0.0, 1.0);
ACG::GLState::depthFunc (GL_LESS);
// Koordinatensystem zeichnen
drawCoordsys(_state);
// set depth buffer to 0 so tah nothing can paint over cordsys
glDepthRange (0.0, 0.0);
ACG::GLState::depthRange (0.0, 0.0);
ACG::GLState::depthFunc (GL_ALWAYS);
glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE);
......@@ -474,7 +474,7 @@ CoordsysNode::pick(GLState& _state, PickTarget _target)
drawCoordsys(_state);
// reset to default
glDepthRange (0.0, 1.0);
ACG::GLState::depthRange (0.0, 1.0);
ACG::GLState::depthFunc (prev_depth);
glColorMask (GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
}
......@@ -522,21 +522,21 @@ CoordsysNode::pick(GLState& _state, PickTarget _target)
else
{
// clear depth buffer in coordsys region
glDepthRange (1.0, 1.0);
ACG::GLState::depthRange (1.0, 1.0);
ACG::GLState::depthFunc (GL_ALWAYS);
// Koordinatensystem zeichnen
drawCoordsys(_state);
// draw coordsys in normal mode
glDepthRange (0.0, 1.0);
ACG::GLState::depthRange (0.0, 1.0);
ACG::GLState::depthFunc (GL_LESS);
// Koordinatensystem zeichnen
drawCoordsys(_state);
// set depth buffer to 0 so tah nothing can paint over cordsys
glDepthRange (0.0, 0.0);
ACG::GLState::depthRange (0.0, 0.0);
ACG::GLState::depthFunc (GL_ALWAYS);
glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE);
......@@ -544,7 +544,7 @@ CoordsysNode::pick(GLState& _state, PickTarget _target)
drawCoordsys(_state);
// reset to default
glDepthRange (0.0, 1.0);
ACG::GLState::depthRange (0.0, 1.0);
ACG::GLState::depthFunc (prev_depth);
glColorMask (GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
}
......@@ -598,7 +598,7 @@ void CoordsysNode::clearPickArea(GLState& _state, bool _draw, GLfloat _depth)
_state.push_modelview_matrix();
_state.reset_modelview();
ACG::GLState::depthFunc (GL_ALWAYS);
glDepthRange (_depth, _depth);
ACG::GLState::depthRange (_depth, _depth);
_state.translate (center[0], center[1], -0.5);
if (_draw)
......@@ -613,7 +613,7 @@ void CoordsysNode::clearPickArea(GLState& _state, bool _draw, GLfloat _depth)
_state.pop_modelview_matrix();
_state.pop_projection_matrix();
glDepthRange (0.0, 1.0);
ACG::GLState::depthRange (0.0, 1.0);
if (!_draw)
glColorMask (colorMask[0], colorMask[1], colorMask[2], colorMask[3]);
......
......@@ -190,12 +190,12 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode)
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glColor(_state.clear_color());
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
draw_obj(i);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
glColor(base_color_backup);
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
draw_obj(i);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
......
......@@ -299,9 +299,9 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) {
// drawMesh_->SetFlatShading();
drawMesh_->disableColors();
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
draw_faces();
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
// Second
// Render the lines. All lines not on the front will be skipped in z-test
......@@ -344,7 +344,7 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) {
{
ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_SMOOTH);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
if ( enableNormals_ ) {
ACG::GLState::enable(GL_COLOR_MATERIAL);
} else {
......@@ -354,20 +354,20 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) {
drawMesh_->usePerVertexColors();
draw_faces();
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
}
if ( ( _drawMode & DrawModes::SOLID_FLAT_SHADED ) && mesh_.has_face_normals() && mesh_.n_faces() > 0)
{
ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_FLAT);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
drawMesh_->setFlatShading();
drawMesh_->disableColors();
draw_faces();
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
}
......@@ -375,12 +375,12 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) {
{
ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_SMOOTH);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
drawMesh_->setSmoothShading();
drawMesh_->disableColors();
draw_faces();
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
}
if ( ( _drawMode & DrawModes::SOLID_PHONG_SHADED ) && mesh_.has_vertex_normals() )
......@@ -398,13 +398,13 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) {
// enable_arrays(VERTEX_ARRAY | NORMAL_VERTEX_ARRAY );
ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_SMOOTH);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
drawMesh_->setSmoothShading();
drawMesh_->disableColors();
draw_faces();
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
//disable own Phong shader
// program->disable();
......@@ -419,13 +419,13 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) {
ACG::GLState::disable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_FLAT);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
// enable_arrays(PER_FACE_VERTEX_ARRAY | PER_FACE_COLOR_ARRAY);
drawMesh_->usePerFaceColors();
draw_faces();
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
_state.set_base_color(base_color_backup);
}
......@@ -437,14 +437,14 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) {
ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_FLAT);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
// enable_arrays(PER_FACE_VERTEX_ARRAY | PER_FACE_COLOR_ARRAY | PER_FACE_NORMAL_ARRAY );
drawMesh_->setFlatShading();
drawMesh_->usePerFaceColors();
draw_faces();
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
_state.set_base_color(base_color_backup);
}
......@@ -459,13 +459,13 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) {
ACG::GLState::enable(GL_TEXTURE_2D);
ACG::GLState::disable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_FLAT);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
drawMesh_->disableColors();
drawMesh_->usePerVertexTexcoords();
draw_faces();
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
ACG::GLState::disable(GL_TEXTURE_2D);
}
......@@ -475,14 +475,14 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) {
ACG::GLState::enable(GL_TEXTURE_2D);
ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_SMOOTH);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
drawMesh_->setSmoothShading();
drawMesh_->disableColors();
drawMesh_->usePerVertexTexcoords();
draw_faces();
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
ACG::GLState::disable(GL_TEXTURE_2D);
}
......@@ -496,13 +496,13 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) {
ACG::GLState::disable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_FLAT);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
drawMesh_->disableColors();
drawMesh_->usePerHalfedgeTexcoords();
draw_faces();
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
ACG::GLState::disable(GL_TEXTURE_2D);
}
......@@ -516,14 +516,14 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) {
ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_SMOOTH);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
drawMesh_->setSmoothShading();
drawMesh_->disableColors();
drawMesh_->usePerHalfedgeTexcoords();
draw_faces();
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
ACG::GLState::disable(GL_TEXTURE_2D);
}
......@@ -763,9 +763,9 @@ pick_vertices(GLState& _state, bool _front)
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
_state.set_base_color(clear_color);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
draw_faces();
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
ACG::GLState::depthFunc(GL_LEQUAL);
......@@ -847,9 +847,9 @@ pick_edges(GLState& _state, bool _front)
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
_state.set_base_color(clear_color);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
draw_faces();
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
ACG::GLState::depthFunc(GL_LEQUAL);
......
......@@ -623,9 +623,9 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode)
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
_state.set_base_color(clear_color);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
draw_faces(PER_VERTEX);
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
ACG::GLState::depthFunc(GL_LEQUAL);
......@@ -640,9 +640,9 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode)
{
ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_FLAT);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
draw_faces(FACE_NORMALS);
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
}
......@@ -651,9 +651,9 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode)
enable_arrays(VERTEX_ARRAY | NORMAL_ARRAY);
ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_SMOOTH);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
draw_faces(PER_VERTEX);
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
}
if ( ( _drawMode & DrawModes::SOLID_PHONG_SHADED ) && mesh_.has_vertex_normals() )
......@@ -671,9 +671,9 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode)
enable_arrays(VERTEX_ARRAY | NORMAL_ARRAY);
ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_SMOOTH);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
draw_faces(PER_VERTEX);
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
//disable own Phong shader
// program->disable();
......@@ -686,9 +686,9 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode)
enable_arrays(VERTEX_ARRAY | NORMAL_ARRAY);
ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_SMOOTH);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
draw_faces(PER_VERTEX);
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
}
......@@ -698,9 +698,9 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode)
ACG::GLState::disable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_FLAT);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
draw_faces(FACE_COLORS);
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
_state.set_base_color(base_color_backup);
}
......@@ -712,9 +712,9 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode)
ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_FLAT);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
draw_faces(FACE_NORMALS_COLORS);
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
_state.set_base_color(base_color_backup);
}
......@@ -727,9 +727,9 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode)
enable_arrays(VERTEX_ARRAY | COLOR_ARRAY);
ACG::GLState::disable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_SMOOTH);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
draw_faces(PER_VERTEX);
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
_state.set_base_color(base_color_backup);
}
......@@ -741,9 +741,9 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode)
ACG::GLState::enable(GL_TEXTURE_2D);
ACG::GLState::disable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_FLAT);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
draw_faces(PER_VERTEX);
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
ACG::GLState::disable(GL_TEXTURE_2D);
}
......@@ -754,9 +754,9 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode)
ACG::GLState::enable(GL_TEXTURE_2D);
ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_SMOOTH);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
draw_faces(PER_VERTEX);
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
ACG::GLState::disable(GL_TEXTURE_2D);
}
......@@ -768,9 +768,9 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode)
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
ACG::GLState::disable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_SMOOTH);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
draw_faces(PER_VERTEX);
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
ACG::GLState::disable(GL_TEXTURE_1D);
}
......@@ -794,9 +794,9 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode)
ACG::GLState::enable(GL_TEXTURE_1D);
ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_SMOOTH);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
draw_faces(PER_VERTEX);
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
ACG::GLState::disable(GL_TEXTURE_1D);
// restore colors
......@@ -816,9 +816,9 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode)
ACG::GLState::enable(GL_TEXTURE_3D);
ACG::GLState::disable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_FLAT);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
draw_faces(PER_VERTEX);
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
ACG::GLState::disable(GL_TEXTURE_3D);
}
......@@ -829,9 +829,9 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode)
ACG::GLState::enable(GL_TEXTURE_3D);
ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_SMOOTH);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
draw_faces(PER_VERTEX);
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
ACG::GLState::disable(GL_TEXTURE_3D);
}
......@@ -842,9 +842,9 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode)
ACG::GLState::enable(GL_TEXTURE_2D);
ACG::GLState::disable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_FLAT);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
draw_faces(FACE_HALFEDGE_TEXTURED);
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
ACG::GLState::disable(GL_TEXTURE_2D);
}
......@@ -856,9 +856,9 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode)
ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_FLAT);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
draw_faces(FACE_HALFEDGE_TEXTURED);
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
ACG::GLState::disable(GL_TEXTURE_2D);
}
......@@ -873,9 +873,9 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode)
ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_SMOOTH);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
draw_faces(PER_VERTEX);
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
}
......@@ -1260,9 +1260,9 @@ pick_vertices(GLState& _state, bool _front)
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
_state.set_base_color(clear_color);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
draw_faces(PER_VERTEX);
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
ACG::GLState::depthFunc(GL_LEQUAL);
......@@ -1510,9 +1510,9 @@ pick_edges(GLState& _state, bool _front)
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
_state.set_base_color(clear_color);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
draw_faces(PER_VERTEX);
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
ACG::GLState::depthFunc(GL_LEQUAL);
......
......@@ -139,12 +139,12 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode)
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glColor(_state.clear_color());
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
draw_obj();
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
glColor(base_color_backup);
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
draw_obj();
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
......
......@@ -148,18 +148,18 @@ draw(GLState& /* _state */ , const DrawModes::DrawMode& _drawMode)
{
ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_FLAT);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
draw_faces();
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
}
if (_drawMode & DrawModes::SOLID_FACES_COLORED)
{
ACG::GLState::disable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_FLAT);
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
draw_faces();
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
}
}
......
......@@ -253,7 +253,7 @@ SliceNode::draw_planes() const
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
glDepthRange(0.01, 1.0);
ACG::GLState::depthRange(0.01, 1.0);
Vec3f rel;
Vec3f tcmin;
......@@ -338,7 +338,7 @@ SliceNode::draw_planes() const
}
glDepthRange(0.0, 1.0);
ACG::GLState::depthRange(0.0, 1.0);
}
//----------------------------------------------------------------------------
......
......@@ -148,18 +148,18 @@ draw(GLState& /* _state */ , const DrawModes::DrawMode& _drawMode)