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*/) ...@@ -271,26 +271,26 @@ draw(GLState& _state , const DrawModes::DrawMode& /*_drawMode*/)
// clear the depth buffer behind the coordsys // clear the depth buffer behind the coordsys
glDepthRange (1.0, 1.0); ACG::GLState::depthRange (1.0, 1.0);
ACG::GLState::depthFunc (GL_ALWAYS); ACG::GLState::depthFunc (GL_ALWAYS);
drawCoordsys(_state); drawCoordsys(_state);
glDepthRange (0.0, 1.0); ACG::GLState::depthRange (0.0, 1.0);
ACG::GLState::depthFunc (GL_LESS); ACG::GLState::depthFunc (GL_LESS);
// draw coordsys // draw coordsys
drawCoordsys(_state); drawCoordsys(_state);
// set depth buffer to 0 so that nothing can paint over cordsys // 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); ACG::GLState::depthFunc (GL_ALWAYS);
glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE); glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE);
// Koordinatensystem zeichnen // Koordinatensystem zeichnen
drawCoordsys(_state); drawCoordsys(_state);
glDepthRange (0.0, 1.0); ACG::GLState::depthRange (0.0, 1.0);
ACG::GLState::depthFunc (prev_depth); ACG::GLState::depthFunc (prev_depth);
glColorMask (colorMask[0], colorMask[1], colorMask[2], colorMask[3]); glColorMask (colorMask[0], colorMask[1], colorMask[2], colorMask[3]);
...@@ -309,21 +309,21 @@ draw(GLState& _state , const DrawModes::DrawMode& /*_drawMode*/) ...@@ -309,21 +309,21 @@ draw(GLState& _state , const DrawModes::DrawMode& /*_drawMode*/)
_state.set_modelview (modelview); _state.set_modelview (modelview);
// clear depth buffer in coordsys region // clear depth buffer in coordsys region
glDepthRange (1.0, 1.0); ACG::GLState::depthRange (1.0, 1.0);
ACG::GLState::depthFunc (GL_ALWAYS); ACG::GLState::depthFunc (GL_ALWAYS);
// Koordinatensystem zeichnen // Koordinatensystem zeichnen
drawCoordsys(_state); drawCoordsys(_state);
// draw coordsys in normal mode // draw coordsys in normal mode
glDepthRange (0.0, 1.0); ACG::GLState::depthRange (0.0, 1.0);
ACG::GLState::depthFunc (GL_LESS); ACG::GLState::depthFunc (GL_LESS);
// Koordinatensystem zeichnen // Koordinatensystem zeichnen
drawCoordsys(_state); drawCoordsys(_state);
// set depth buffer to 0 so that nothing can paint over cordsys // 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); ACG::GLState::depthFunc (GL_ALWAYS);
glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE); glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE);
...@@ -331,7 +331,7 @@ draw(GLState& _state , const DrawModes::DrawMode& /*_drawMode*/) ...@@ -331,7 +331,7 @@ draw(GLState& _state , const DrawModes::DrawMode& /*_drawMode*/)
drawCoordsys(_state); drawCoordsys(_state);
// reset to default // reset to default
glDepthRange (0.0, 1.0); ACG::GLState::depthRange (0.0, 1.0);
ACG::GLState::depthFunc (prev_depth); ACG::GLState::depthFunc (prev_depth);
glColorMask (colorMask[0], colorMask[1], colorMask[2], colorMask[3]); glColorMask (colorMask[0], colorMask[1], colorMask[2], colorMask[3]);
} }
...@@ -452,21 +452,21 @@ CoordsysNode::pick(GLState& _state, PickTarget _target) ...@@ -452,21 +452,21 @@ CoordsysNode::pick(GLState& _state, PickTarget _target)
else else
{ {
// clear depth buffer in coordsys region // clear depth buffer in coordsys region
glDepthRange (1.0, 1.0); ACG::GLState::depthRange (1.0, 1.0);
ACG::GLState::depthFunc (GL_ALWAYS); ACG::GLState::depthFunc (GL_ALWAYS);
// Koordinatensystem zeichnen // Koordinatensystem zeichnen
drawCoordsys(_state); drawCoordsys(_state);
// draw coordsys in normal mode // draw coordsys in normal mode
glDepthRange (0.0, 1.0); ACG::GLState::depthRange (0.0, 1.0);
ACG::GLState::depthFunc (GL_LESS); ACG::GLState::depthFunc (GL_LESS);
// Koordinatensystem zeichnen // Koordinatensystem zeichnen
drawCoordsys(_state); drawCoordsys(_state);
// set depth buffer to 0 so tah nothing can paint over cordsys // 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); ACG::GLState::depthFunc (GL_ALWAYS);
glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE); glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE);
...@@ -474,7 +474,7 @@ CoordsysNode::pick(GLState& _state, PickTarget _target) ...@@ -474,7 +474,7 @@ CoordsysNode::pick(GLState& _state, PickTarget _target)
drawCoordsys(_state); drawCoordsys(_state);
// reset to default // reset to default
glDepthRange (0.0, 1.0); ACG::GLState::depthRange (0.0, 1.0);
ACG::GLState::depthFunc (prev_depth); ACG::GLState::depthFunc (prev_depth);
glColorMask (GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); glColorMask (GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
} }
...@@ -522,21 +522,21 @@ CoordsysNode::pick(GLState& _state, PickTarget _target) ...@@ -522,21 +522,21 @@ CoordsysNode::pick(GLState& _state, PickTarget _target)
else else
{ {
// clear depth buffer in coordsys region // clear depth buffer in coordsys region
glDepthRange (1.0, 1.0); ACG::GLState::depthRange (1.0, 1.0);
ACG::GLState::depthFunc (GL_ALWAYS); ACG::GLState::depthFunc (GL_ALWAYS);
// Koordinatensystem zeichnen // Koordinatensystem zeichnen
drawCoordsys(_state); drawCoordsys(_state);
// draw coordsys in normal mode // draw coordsys in normal mode
glDepthRange (0.0, 1.0); ACG::GLState::depthRange (0.0, 1.0);
ACG::GLState::depthFunc (GL_LESS); ACG::GLState::depthFunc (GL_LESS);
// Koordinatensystem zeichnen // Koordinatensystem zeichnen
drawCoordsys(_state); drawCoordsys(_state);
// set depth buffer to 0 so tah nothing can paint over cordsys // 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); ACG::GLState::depthFunc (GL_ALWAYS);
glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE); glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE);
...@@ -544,7 +544,7 @@ CoordsysNode::pick(GLState& _state, PickTarget _target) ...@@ -544,7 +544,7 @@ CoordsysNode::pick(GLState& _state, PickTarget _target)
drawCoordsys(_state); drawCoordsys(_state);
// reset to default // reset to default
glDepthRange (0.0, 1.0); ACG::GLState::depthRange (0.0, 1.0);
ACG::GLState::depthFunc (prev_depth); ACG::GLState::depthFunc (prev_depth);
glColorMask (GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); glColorMask (GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
} }
...@@ -598,7 +598,7 @@ void CoordsysNode::clearPickArea(GLState& _state, bool _draw, GLfloat _depth) ...@@ -598,7 +598,7 @@ void CoordsysNode::clearPickArea(GLState& _state, bool _draw, GLfloat _depth)
_state.push_modelview_matrix(); _state.push_modelview_matrix();
_state.reset_modelview(); _state.reset_modelview();
ACG::GLState::depthFunc (GL_ALWAYS); ACG::GLState::depthFunc (GL_ALWAYS);
glDepthRange (_depth, _depth); ACG::GLState::depthRange (_depth, _depth);
_state.translate (center[0], center[1], -0.5); _state.translate (center[0], center[1], -0.5);
if (_draw) if (_draw)
...@@ -613,7 +613,7 @@ void CoordsysNode::clearPickArea(GLState& _state, bool _draw, GLfloat _depth) ...@@ -613,7 +613,7 @@ void CoordsysNode::clearPickArea(GLState& _state, bool _draw, GLfloat _depth)
_state.pop_modelview_matrix(); _state.pop_modelview_matrix();
_state.pop_projection_matrix(); _state.pop_projection_matrix();
glDepthRange (0.0, 1.0); ACG::GLState::depthRange (0.0, 1.0);
if (!_draw) if (!_draw)
glColorMask (colorMask[0], colorMask[1], colorMask[2], colorMask[3]); glColorMask (colorMask[0], colorMask[1], colorMask[2], colorMask[3]);
......
...@@ -190,12 +190,12 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) ...@@ -190,12 +190,12 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode)
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glColor(_state.clear_color()); glColor(_state.clear_color());
glDepthRange(0.01, 1.0); ACG::GLState::depthRange(0.01, 1.0);
draw_obj(i); draw_obj(i);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
glColor(base_color_backup); glColor(base_color_backup);
glDepthRange(0.0, 1.0); ACG::GLState::depthRange(0.0, 1.0);
draw_obj(i); draw_obj(i);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
......
...@@ -299,9 +299,9 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) { ...@@ -299,9 +299,9 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) {
// drawMesh_->SetFlatShading(); // drawMesh_->SetFlatShading();
drawMesh_->disableColors(); drawMesh_->disableColors();
glDepthRange(0.01, 1.0); ACG::GLState::depthRange(0.01, 1.0);
draw_faces(); draw_faces();
glDepthRange(0.0, 1.0); ACG::GLState::depthRange(0.0, 1.0);
// Second // Second
// Render the lines. All lines not on the front will be skipped in z-test // 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) { ...@@ -344,7 +344,7 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) {
{ {
ACG::GLState::enable(GL_LIGHTING); ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_SMOOTH); ACG::GLState::shadeModel(GL_SMOOTH);
glDepthRange(0.01, 1.0); ACG::GLState::depthRange(0.01, 1.0);
if ( enableNormals_ ) { if ( enableNormals_ ) {
ACG::GLState::enable(GL_COLOR_MATERIAL); ACG::GLState::enable(GL_COLOR_MATERIAL);
} else { } else {
...@@ -354,20 +354,20 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) { ...@@ -354,20 +354,20 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) {
drawMesh_->usePerVertexColors(); drawMesh_->usePerVertexColors();
draw_faces(); 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) if ( ( _drawMode & DrawModes::SOLID_FLAT_SHADED ) && mesh_.has_face_normals() && mesh_.n_faces() > 0)
{ {
ACG::GLState::enable(GL_LIGHTING); ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_FLAT); ACG::GLState::shadeModel(GL_FLAT);
glDepthRange(0.01, 1.0); ACG::GLState::depthRange(0.01, 1.0);
drawMesh_->setFlatShading(); drawMesh_->setFlatShading();
drawMesh_->disableColors(); drawMesh_->disableColors();
draw_faces(); 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) { ...@@ -375,12 +375,12 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) {
{ {
ACG::GLState::enable(GL_LIGHTING); ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_SMOOTH); ACG::GLState::shadeModel(GL_SMOOTH);
glDepthRange(0.01, 1.0); ACG::GLState::depthRange(0.01, 1.0);
drawMesh_->setSmoothShading(); drawMesh_->setSmoothShading();
drawMesh_->disableColors(); drawMesh_->disableColors();
draw_faces(); draw_faces();
glDepthRange(0.0, 1.0); ACG::GLState::depthRange(0.0, 1.0);
} }
if ( ( _drawMode & DrawModes::SOLID_PHONG_SHADED ) && mesh_.has_vertex_normals() ) if ( ( _drawMode & DrawModes::SOLID_PHONG_SHADED ) && mesh_.has_vertex_normals() )
...@@ -398,13 +398,13 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) { ...@@ -398,13 +398,13 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) {
// enable_arrays(VERTEX_ARRAY | NORMAL_VERTEX_ARRAY ); // enable_arrays(VERTEX_ARRAY | NORMAL_VERTEX_ARRAY );
ACG::GLState::enable(GL_LIGHTING); ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_SMOOTH); ACG::GLState::shadeModel(GL_SMOOTH);
glDepthRange(0.01, 1.0); ACG::GLState::depthRange(0.01, 1.0);
drawMesh_->setSmoothShading(); drawMesh_->setSmoothShading();
drawMesh_->disableColors(); drawMesh_->disableColors();
draw_faces(); draw_faces();
glDepthRange(0.0, 1.0); ACG::GLState::depthRange(0.0, 1.0);
//disable own Phong shader //disable own Phong shader
// program->disable(); // program->disable();
...@@ -419,13 +419,13 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) { ...@@ -419,13 +419,13 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) {
ACG::GLState::disable(GL_LIGHTING); ACG::GLState::disable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_FLAT); 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); // enable_arrays(PER_FACE_VERTEX_ARRAY | PER_FACE_COLOR_ARRAY);
drawMesh_->usePerFaceColors(); drawMesh_->usePerFaceColors();
draw_faces(); draw_faces();
glDepthRange(0.0, 1.0); ACG::GLState::depthRange(0.0, 1.0);
_state.set_base_color(base_color_backup); _state.set_base_color(base_color_backup);
} }
...@@ -437,14 +437,14 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) { ...@@ -437,14 +437,14 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) {
ACG::GLState::enable(GL_LIGHTING); ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_FLAT); 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 ); // enable_arrays(PER_FACE_VERTEX_ARRAY | PER_FACE_COLOR_ARRAY | PER_FACE_NORMAL_ARRAY );
drawMesh_->setFlatShading(); drawMesh_->setFlatShading();
drawMesh_->usePerFaceColors(); drawMesh_->usePerFaceColors();
draw_faces(); draw_faces();
glDepthRange(0.0, 1.0); ACG::GLState::depthRange(0.0, 1.0);
_state.set_base_color(base_color_backup); _state.set_base_color(base_color_backup);
} }
...@@ -459,13 +459,13 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) { ...@@ -459,13 +459,13 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) {
ACG::GLState::enable(GL_TEXTURE_2D); ACG::GLState::enable(GL_TEXTURE_2D);
ACG::GLState::disable(GL_LIGHTING); ACG::GLState::disable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_FLAT); ACG::GLState::shadeModel(GL_FLAT);
glDepthRange(0.01, 1.0); ACG::GLState::depthRange(0.01, 1.0);
drawMesh_->disableColors(); drawMesh_->disableColors();
drawMesh_->usePerVertexTexcoords(); drawMesh_->usePerVertexTexcoords();
draw_faces(); draw_faces();
glDepthRange(0.0, 1.0); ACG::GLState::depthRange(0.0, 1.0);
ACG::GLState::disable(GL_TEXTURE_2D); ACG::GLState::disable(GL_TEXTURE_2D);
} }
...@@ -475,14 +475,14 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) { ...@@ -475,14 +475,14 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) {
ACG::GLState::enable(GL_TEXTURE_2D); ACG::GLState::enable(GL_TEXTURE_2D);
ACG::GLState::enable(GL_LIGHTING); ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_SMOOTH); ACG::GLState::shadeModel(GL_SMOOTH);
glDepthRange(0.01, 1.0); ACG::GLState::depthRange(0.01, 1.0);
drawMesh_->setSmoothShading(); drawMesh_->setSmoothShading();
drawMesh_->disableColors(); drawMesh_->disableColors();
drawMesh_->usePerVertexTexcoords(); drawMesh_->usePerVertexTexcoords();
draw_faces(); draw_faces();
glDepthRange(0.0, 1.0); ACG::GLState::depthRange(0.0, 1.0);
ACG::GLState::disable(GL_TEXTURE_2D); ACG::GLState::disable(GL_TEXTURE_2D);
} }
...@@ -496,13 +496,13 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) { ...@@ -496,13 +496,13 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) {
ACG::GLState::disable(GL_LIGHTING); ACG::GLState::disable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_FLAT); ACG::GLState::shadeModel(GL_FLAT);
glDepthRange(0.01, 1.0); ACG::GLState::depthRange(0.01, 1.0);
drawMesh_->disableColors(); drawMesh_->disableColors();
drawMesh_->usePerHalfedgeTexcoords(); drawMesh_->usePerHalfedgeTexcoords();
draw_faces(); draw_faces();
glDepthRange(0.0, 1.0); ACG::GLState::depthRange(0.0, 1.0);
ACG::GLState::disable(GL_TEXTURE_2D); ACG::GLState::disable(GL_TEXTURE_2D);
} }
...@@ -516,14 +516,14 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) { ...@@ -516,14 +516,14 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) {
ACG::GLState::enable(GL_LIGHTING); ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_SMOOTH); ACG::GLState::shadeModel(GL_SMOOTH);
glDepthRange(0.01, 1.0); ACG::GLState::depthRange(0.01, 1.0);
drawMesh_->setSmoothShading(); drawMesh_->setSmoothShading();
drawMesh_->disableColors(); drawMesh_->disableColors();
drawMesh_->usePerHalfedgeTexcoords(); drawMesh_->usePerHalfedgeTexcoords();
draw_faces(); draw_faces();
glDepthRange(0.0, 1.0); ACG::GLState::depthRange(0.0, 1.0);
ACG::GLState::disable(GL_TEXTURE_2D); ACG::GLState::disable(GL_TEXTURE_2D);
} }
...@@ -763,9 +763,9 @@ pick_vertices(GLState& _state, bool _front) ...@@ -763,9 +763,9 @@ pick_vertices(GLState& _state, bool _front)
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
_state.set_base_color(clear_color); _state.set_base_color(clear_color);
glDepthRange(0.01, 1.0); ACG::GLState::depthRange(0.01, 1.0);
draw_faces(); draw_faces();
glDepthRange(0.0, 1.0); ACG::GLState::depthRange(0.0, 1.0);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
ACG::GLState::depthFunc(GL_LEQUAL); ACG::GLState::depthFunc(GL_LEQUAL);
...@@ -847,9 +847,9 @@ pick_edges(GLState& _state, bool _front) ...@@ -847,9 +847,9 @@ pick_edges(GLState& _state, bool _front)
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
_state.set_base_color(clear_color); _state.set_base_color(clear_color);
glDepthRange(0.01, 1.0); ACG::GLState::depthRange(0.01, 1.0);
draw_faces(); draw_faces();
glDepthRange(0.0, 1.0); ACG::GLState::depthRange(0.0, 1.0);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
ACG::GLState::depthFunc(GL_LEQUAL); ACG::GLState::depthFunc(GL_LEQUAL);
......
...@@ -623,9 +623,9 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) ...@@ -623,9 +623,9 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode)
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
_state.set_base_color(clear_color); _state.set_base_color(clear_color);
glDepthRange(0.01, 1.0); ACG::GLState::depthRange(0.01, 1.0);
draw_faces(PER_VERTEX); draw_faces(PER_VERTEX);
glDepthRange(0.0, 1.0); ACG::GLState::depthRange(0.0, 1.0);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
ACG::GLState::depthFunc(GL_LEQUAL); ACG::GLState::depthFunc(GL_LEQUAL);
...@@ -640,9 +640,9 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) ...@@ -640,9 +640,9 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode)
{ {
ACG::GLState::enable(GL_LIGHTING); ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_FLAT); ACG::GLState::shadeModel(GL_FLAT);
glDepthRange(0.01, 1.0); ACG::GLState::depthRange(0.01, 1.0);
draw_faces(FACE_NORMALS); 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) ...@@ -651,9 +651,9 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode)
enable_arrays(VERTEX_ARRAY | NORMAL_ARRAY); enable_arrays(VERTEX_ARRAY | NORMAL_ARRAY);
ACG::GLState::enable(GL_LIGHTING); ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_SMOOTH); ACG::GLState::shadeModel(GL_SMOOTH);
glDepthRange(0.01, 1.0); ACG::GLState::depthRange(0.01, 1.0);
draw_faces(PER_VERTEX); 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() ) if ( ( _drawMode & DrawModes::SOLID_PHONG_SHADED ) && mesh_.has_vertex_normals() )
...@@ -671,9 +671,9 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) ...@@ -671,9 +671,9 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode)
enable_arrays(VERTEX_ARRAY | NORMAL_ARRAY); enable_arrays(VERTEX_ARRAY | NORMAL_ARRAY);
ACG::GLState::enable(GL_LIGHTING); ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_SMOOTH); ACG::GLState::shadeModel(GL_SMOOTH);
glDepthRange(0.01, 1.0); ACG::GLState::depthRange(0.01, 1.0);
draw_faces(PER_VERTEX); draw_faces(PER_VERTEX);
glDepthRange(0.0, 1.0); ACG::GLState::depthRange(0.0, 1.0);
//disable own Phong shader //disable own Phong shader
// program->disable(); // program->disable();
...@@ -686,9 +686,9 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode) ...@@ -686,9 +686,9 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode)
enable_arrays(VERTEX_ARRAY | NORMAL_ARRAY); enable_arrays(VERTEX_ARRAY | NORMAL_ARRAY);
ACG::GLState::enable(GL_LIGHTING); ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_SMOOTH); ACG::GLState::shadeModel(GL_SMOOTH);
glDepthRange(0.01, 1.0); ACG::GLState::depthRange(0.01, 1.0);
draw_faces(PER_VERTEX); draw_faces(PER_VERTEX);
glDepthRange(0.0, 1.0); ACG::GLState::depthRange(0.0, 1.0);
} }