Commit 7aab9db5 authored by Jan Möbius's avatar Jan Möbius

Christopher: ACG changes to use the GLState directly

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@12340 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 152c019d
......@@ -109,6 +109,7 @@ GLState::GLState(bool _updateGL)
blending_(false),
msSinceLastRedraw_ (1)
{
if (stateStack_.size() == 0)
{
stateStack_.push_back(GLStateContext());
......@@ -1737,6 +1738,7 @@ void GLState::bindTexture(GLenum _target, GLuint _buffer)
int activeTex = getActiveTextureIndex();
int texTargetIdx = getTextureTargetIndex(_target);
assert(texTargetIdx >= 0);
if (!glTextureTargetLock_[activeTex][texTargetIdx])
......@@ -2031,7 +2033,9 @@ void GLState::popAttrib()
{
activeTexture(GL_TEXTURE0 + i);
for (int t = 0; t < 5; ++t)
//TODO, changed 5 to 4 for end variable t as targets has only four elements
// check if this is correct
for (int t = 0; t < 4; ++t)
bindTexture(targets[t], stateStack_.back().glTextureTargetState_[i][t]);
}
......
......@@ -503,7 +503,12 @@ public:
/// get active GL texture
inline static GLenum getActiveTexture() {return stateStack_.back().activeTexture_;}
/// get active texture as zero based index
inline static int getActiveTextureIndex() {return getActiveTexture() - GL_TEXTURE0;}
inline static int getActiveTextureIndex() {
if (getActiveTexture() == 0)
return 0;
else
return getActiveTexture() - GL_TEXTURE0;
}
/// replaces glBindTexture, supports locking
static void bindTexture(GLenum _target, GLuint _buffer);
......
......@@ -191,7 +191,7 @@ public:
{
if(!valid) gen();
activate();
glBindTexture(target, texture);
ACG::GLState::bindTexture(target, texture);
}
void activate()
......@@ -226,13 +226,13 @@ public:
void enable()
{
activate();
glEnable(target);
ACG::GLState::enable(target);
}
void disable()
{
activate();
glDisable(target);
ACG::GLState::disable(target);
}
void del()
......
......@@ -52,6 +52,7 @@
#include "stipple_alpha.hh"
#include "gl.hh"
#include <GL/GLState.hh>
//== NAMESPACES ===============================================================
......@@ -62,7 +63,7 @@ namespace ACG {
const GLubyte stippleMask[17][128] =
{
/* NOTE: 0% opaqueness is faster to set and probably faster to render with:
glDisable(GL_POLYGON_STIPPLE);
ACG::GLState::disable(GL_POLYGON_STIPPLE);
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); */
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
......@@ -337,7 +338,7 @@ const GLubyte stippleMask[17][128] =
0xff, 0xff, 0xff, 0xff, 0x77, 0x77, 0x77, 0x77},
/* NOTE: 100% opaqueness is faster to set and probably faster to render with:
glDisable(GL_POLYGON_STIPPLE); */
ACG::GLState::disable(GL_POLYGON_STIPPLE); */
{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
......@@ -367,14 +368,14 @@ void stipple_alpha(float _alpha)
{
if (_alpha < 0.0) _alpha = 0.0;
glEnable(GL_POLYGON_STIPPLE);
ACG::GLState::enable(GL_POLYGON_STIPPLE);
glPolygonStipple(stippleMask[ (unsigned int)(_alpha * 16.0 + 0.5)]);
}
// opaque
else
{
glDisable(GL_POLYGON_STIPPLE);
ACG::GLState::disable(GL_POLYGON_STIPPLE);
}
}
......
......@@ -89,8 +89,8 @@ GlutExaminer::init()
void
GlutExaminer::draw()
{
glEnable(GL_LIGHTING);
glShadeModel(GL_SMOOTH);
ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_SMOOTH);
glutSolidTeapot(0.5);
}
......
......@@ -119,10 +119,10 @@ GlutViewer::init()
// OpenGL state
glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHTING);
glDisable(GL_DITHER);
glShadeModel(GL_FLAT);
ACG::GLState::enable(GL_DEPTH_TEST);
ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::disable(GL_DITHER);
ACG::GLState::shadeModel(GL_FLAT);
glFrontFace(GL_CCW);
......@@ -138,7 +138,7 @@ GlutViewer::init()
glLightfv(GL_LIGHT##i, GL_POSITION, pos); \
glLightfv(GL_LIGHT##i, GL_DIFFUSE, col); \
glLightfv(GL_LIGHT##i, GL_SPECULAR, col); \
glEnable(GL_LIGHT##i); \
ACG::GLState::enable(GL_LIGHT##i); \
}
SET_LIGHT(0, 0.0, 0.0, 1.0);
......
......@@ -736,9 +736,9 @@ void QtBaseViewer::backFaceCulling(bool _b)
makeCurrent();
if (funcMenu_==0) updatePopupMenu();
if ( (backFaceCulling_ = _b) )
glEnable( GL_CULL_FACE );
ACG::GLState::enable( GL_CULL_FACE );
else
glDisable( GL_CULL_FACE );
ACG::GLState::disable( GL_CULL_FACE );
action_["BackfaceCulling"]->setChecked( backFaceCulling_ );
updateGL();
......@@ -775,11 +775,11 @@ void QtBaseViewer::normalsMode(NormalsMode _mode)
switch(normalsMode_ = _mode)
{
case DONT_TOUCH_NORMALS:
glDisable(GL_NORMALIZE);
ACG::GLState::disable(GL_NORMALIZE);
break;
case NORMALIZE_NORMALS:
glEnable(GL_NORMALIZE);
ACG::GLState::enable(GL_NORMALIZE);
break;
}
......@@ -883,7 +883,7 @@ void QtBaseViewer::drawScene_mono()
// prepare GL state
makeCurrent();
glDisable(GL_LIGHTING);
ACG::GLState::disable(GL_LIGHTING);
glClear(GL_DEPTH_BUFFER_BIT);
glInitNames();
glPushName((GLuint) 0);
......@@ -892,7 +892,7 @@ void QtBaseViewer::drawScene_mono()
SceneGraph::PickAction action(*glstate_, pickRendererMode_, curDrawMode_);
SceneGraph::traverse(sceneGraphRoot_, action);
glEnable(GL_LIGHTING);
ACG::GLState::enable(GL_LIGHTING);
}
}
}
......@@ -930,7 +930,7 @@ QtBaseViewer::drawScene_stereo()
glFrustum(l+offset2, r+offset2, b, t, near_, far_);
glTranslatef(-offset, 0.0, 0.0);
glMatrixMode(GL_MODELVIEW);
glDrawBuffer(GL_BACK_LEFT);
ACG::GLState::drawBuffer(GL_BACK_LEFT);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
drawScene_mono();
......@@ -941,10 +941,10 @@ QtBaseViewer::drawScene_stereo()
glFrustum(l-offset2, r-offset2, b, t, near_, far_);
glTranslatef(offset, 0.0, 0.0);
glMatrixMode(GL_MODELVIEW);
glDrawBuffer(GL_BACK_RIGHT);
ACG::GLState::drawBuffer(GL_BACK_RIGHT);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
drawScene_mono();
glDrawBuffer(GL_BACK);
ACG::GLState::drawBuffer(GL_BACK);
}
......@@ -1148,10 +1148,10 @@ void QtBaseViewer::initializeGL()
glstate_->initialize();
// OpenGL state
glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHTING);
glDisable(GL_DITHER);
glShadeModel( GL_FLAT );
ACG::GLState::enable(GL_DEPTH_TEST);
ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::disable(GL_DITHER);
ACG::GLState::shadeModel( GL_FLAT );
projectionMode( projectionMode_ );
......@@ -1219,7 +1219,7 @@ void QtBaseViewer::update_lights()
glLightfv(GL_LIGHT##i, GL_POSITION, pos); \
glLightfv(GL_LIGHT##i, GL_DIFFUSE, col); \
glLightfv(GL_LIGHT##i, GL_SPECULAR, col); \
glEnable(GL_LIGHT##i); \
ACG::GLState::enable(GL_LIGHT##i); \
}
SET_LIGHT(0, 0.0, 0.0, 1.0);
......@@ -1297,10 +1297,10 @@ void QtBaseViewer::paintGL()
glPushAttrib (GL_ALL_ATTRIB_BITS);
glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHTING);
glDisable(GL_DITHER);
glShadeModel( GL_FLAT );
ACG::GLState::enable(GL_DEPTH_TEST);
ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::disable(GL_DITHER);
ACG::GLState::shadeModel( GL_FLAT );
glMatrixMode(GL_PROJECTION);
glPushMatrix();
......
......@@ -107,7 +107,7 @@ bool QtBaseViewer::pick( SceneGraph::PickTarget _pickTarget,
glMultMatrixd(projection.get_raw_data());
glMatrixMode(GL_MODELVIEW);
glLoadMatrixd(modelview.get_raw_data());
glDisable(GL_LIGHTING);
ACG::GLState::disable(GL_LIGHTING);
glClear(GL_DEPTH_BUFFER_BIT);
glstate_->pick_init (false);
......@@ -121,7 +121,7 @@ bool QtBaseViewer::pick( SceneGraph::PickTarget _pickTarget,
glLoadMatrixd(projection.get_raw_data());
glMatrixMode( GL_MODELVIEW );
glLoadMatrixd(modelview.get_raw_data());
glEnable(GL_LIGHTING);
ACG::GLState::enable(GL_LIGHTING);
// process hit record
......
......@@ -109,7 +109,7 @@ QtBaseViewer::setStereoMode(bool _b)
statusbar_->showMessage("Stereo disabled");
stereoButton_->setIcon( QPixmap(monoIcon) );
makeCurrent();
glDrawBuffer(GL_BACK);
ACG::GLState::drawBuffer(GL_BACK);
}
updateGL();
......
......@@ -116,7 +116,7 @@ slotMouseEvent(QMouseEvent* _event)
unsigned int width = glstate_.viewport_width();
unsigned int height = glstate_.viewport_height();
glDrawBuffer( GL_FRONT );
ACG::GLState::drawBuffer( GL_FRONT );
glMatrixMode(GL_PROJECTION);
glPushMatrix();
......@@ -127,9 +127,9 @@ slotMouseEvent(QMouseEvent* _event)
glPushMatrix();
glLoadIdentity();
glDisable(GL_DEPTH_TEST);
glDisable(GL_LIGHTING);
glDisable(GL_DITHER);
ACG::GLState::disable(GL_DEPTH_TEST);
ACG::GLState::disable(GL_LIGHTING);
ACG::GLState::disable(GL_DITHER);
glLineWidth(2.0);
glColor3ub(0, 255, 10);
......@@ -180,7 +180,7 @@ slotMouseEvent(QMouseEvent* _event)
// draw rubber band
else
{
glEnable(GL_COLOR_LOGIC_OP);
ACG::GLState::enable(GL_COLOR_LOGIC_OP);
glLogicOp(GL_XOR);
glBegin(GL_LINES);
glVertex(last_point_);
......@@ -188,7 +188,7 @@ slotMouseEvent(QMouseEvent* _event)
glVertex(last_point_);
glVertex(p);
glEnd();
glDisable(GL_COLOR_LOGIC_OP);
ACG::GLState::disable(GL_COLOR_LOGIC_OP);
rubberband_point_ = p;
}
}
......@@ -232,12 +232,12 @@ slotMouseEvent(QMouseEvent* _event)
// restore GL settings
glDrawBuffer(GL_BACK);
ACG::GLState::drawBuffer(GL_BACK);
glReadBuffer(GL_BACK);
glLineWidth(glstate_.line_width());
glColor4fv(glstate_.base_color().data());
glEnable(GL_DEPTH_TEST);
ACG::GLState::enable(GL_DEPTH_TEST);
glMatrixMode(GL_PROJECTION );
glPopMatrix();
......
......@@ -92,7 +92,7 @@ draw(GLState& /* _state */ , const DrawModes::DrawMode& _drawMode)
{
glPushAttrib (GL_ENABLE_BIT);
glDisable(GL_LIGHTING);
ACG::GLState::disable(GL_LIGHTING);
glBegin(GL_LINES);
......
......@@ -90,7 +90,7 @@ CartesianClippingNode::enter( GLState & _state, const DrawModes::DrawMode& /* _d
}
glClipPlane( GL_CLIP_PLANE0, xy_plane );
glEnable( GL_CLIP_PLANE0 );
ACG::GLState::enable( GL_CLIP_PLANE0 );
}
if ( is_enabled( YZ_PLANE ) )
......@@ -112,7 +112,7 @@ CartesianClippingNode::enter( GLState & _state, const DrawModes::DrawMode& /* _d
}
glClipPlane( GL_CLIP_PLANE1, yz_plane );
glEnable( GL_CLIP_PLANE1 );
ACG::GLState::enable( GL_CLIP_PLANE1 );
}
if ( is_enabled( XZ_PLANE ) )
......@@ -134,7 +134,7 @@ CartesianClippingNode::enter( GLState & _state, const DrawModes::DrawMode& /* _d
}
glClipPlane( GL_CLIP_PLANE2, xz_plane );
glEnable( GL_CLIP_PLANE2 );
ACG::GLState::enable( GL_CLIP_PLANE2 );
}
......@@ -148,9 +148,9 @@ CartesianClippingNode::enter( GLState & _state, const DrawModes::DrawMode& /* _d
void
CartesianClippingNode::leave( GLState & /* _state */ , const DrawModes::DrawMode& /* _drawmode */ )
{
glDisable( GL_CLIP_PLANE0 );
glDisable( GL_CLIP_PLANE1 );
glDisable( GL_CLIP_PLANE2 );
ACG::GLState::disable( GL_CLIP_PLANE0 );
ACG::GLState::disable( GL_CLIP_PLANE1 );
ACG::GLState::disable( GL_CLIP_PLANE2 );
}
......
......@@ -139,7 +139,7 @@ void ClippingNode::enter(GLState& /* _state */ , const DrawModes::DrawMode& /* _
if (slice_width_ == 0.0)
{
glClipPlane(GL_CLIP_PLANE0, offset_plane0_);
glEnable(GL_CLIP_PLANE0);
ACG::GLState::enable(GL_CLIP_PLANE0);
}
......@@ -147,9 +147,9 @@ void ClippingNode::enter(GLState& /* _state */ , const DrawModes::DrawMode& /* _
else
{
glClipPlane(GL_CLIP_PLANE0, offset_plane0_);
glEnable(GL_CLIP_PLANE0);
ACG::GLState::enable(GL_CLIP_PLANE0);
glClipPlane(GL_CLIP_PLANE1, offset_plane1_);
glEnable(GL_CLIP_PLANE1);
ACG::GLState::enable(GL_CLIP_PLANE1);
}
}
......@@ -159,9 +159,9 @@ void ClippingNode::enter(GLState& /* _state */ , const DrawModes::DrawMode& /* _
void ClippingNode::leave(GLState& /* _state */ , const DrawModes::DrawMode& /* _drawmode */ )
{
glDisable(GL_CLIP_PLANE0);
ACG::GLState::disable(GL_CLIP_PLANE0);
if (slice_width_ > 0.0)
glDisable(GL_CLIP_PLANE1);
ACG::GLState::disable(GL_CLIP_PLANE1);
}
......
......@@ -109,8 +109,8 @@ CoordFrameNode::draw(GLState& /* _state */ , const DrawModes::DrawMode& /* _draw
{
// draw bounding box
glDisable(GL_LIGHTING);
glShadeModel(GL_FLAT);
ACG::GLState::disable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_FLAT);
glBegin(GL_LINE_LOOP);
glVertex3f(bb_min_[0], bb_min_[1], bb_min_[2]);
......
......@@ -221,10 +221,10 @@ draw(GLState& _state , const DrawModes::DrawMode& /*_drawMode*/)
Vec4f lastBaseColor = _state.base_color();
glPushAttrib( GL_LIGHTING_BIT ); // STACK_ATTRIBUTES <- LIGHTING_ATTRIBUTE
glEnable(GL_LIGHTING);
ACG::GLState::enable(GL_LIGHTING);
glColorMaterial ( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE ) ;
glEnable(GL_COLOR_MATERIAL);
glShadeModel(GL_SMOOTH);
ACG::GLState::enable(GL_COLOR_MATERIAL);
ACG::GLState::shadeModel(GL_SMOOTH);
// Init state - changes when mode_ != POSITION
Vec3d pos3D(0.0,0.0,0.0);
......@@ -272,26 +272,26 @@ draw(GLState& _state , const DrawModes::DrawMode& /*_drawMode*/)
// clear the depth buffer behind the coordsys
glDepthRange (1.0, 1.0);
glDepthFunc (GL_ALWAYS);
ACG::GLState::depthFunc (GL_ALWAYS);
drawCoordsys(_state);
glDepthRange (0.0, 1.0);
glDepthFunc (GL_LESS);
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);
glDepthFunc (GL_ALWAYS);
ACG::GLState::depthFunc (GL_ALWAYS);
glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE);
// Koordinatensystem zeichnen
drawCoordsys(_state);
glDepthRange (0.0, 1.0);
glDepthFunc (prev_depth);
ACG::GLState::depthFunc (prev_depth);
glColorMask (colorMask[0], colorMask[1], colorMask[2], colorMask[3]);
// Projection reload
......@@ -310,21 +310,21 @@ draw(GLState& _state , const DrawModes::DrawMode& /*_drawMode*/)
// clear depth buffer in coordsys region
glDepthRange (1.0, 1.0);
glDepthFunc (GL_ALWAYS);
ACG::GLState::depthFunc (GL_ALWAYS);
// Koordinatensystem zeichnen
drawCoordsys(_state);
// draw coordsys in normal mode
glDepthRange (0.0, 1.0);
glDepthFunc (GL_LESS);
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);
glDepthFunc (GL_ALWAYS);
ACG::GLState::depthFunc (GL_ALWAYS);
glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE);
// Koordinatensystem zeichnen
......@@ -332,7 +332,7 @@ draw(GLState& _state , const DrawModes::DrawMode& /*_drawMode*/)
// reset to default
glDepthRange (0.0, 1.0);
glDepthFunc (prev_depth);
ACG::GLState::depthFunc (prev_depth);
glColorMask (colorMask[0], colorMask[1], colorMask[2], colorMask[3]);
}
......@@ -453,21 +453,21 @@ CoordsysNode::pick(GLState& _state, PickTarget _target)
{
// clear depth buffer in coordsys region
glDepthRange (1.0, 1.0);
glDepthFunc (GL_ALWAYS);
ACG::GLState::depthFunc (GL_ALWAYS);
// Koordinatensystem zeichnen
drawCoordsys(_state);
// draw coordsys in normal mode
glDepthRange (0.0, 1.0);
glDepthFunc (GL_LESS);
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);
glDepthFunc (GL_ALWAYS);
ACG::GLState::depthFunc (GL_ALWAYS);
glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE);
// Koordinatensystem zeichnen
......@@ -475,7 +475,7 @@ CoordsysNode::pick(GLState& _state, PickTarget _target)
// reset to default
glDepthRange (0.0, 1.0);
glDepthFunc (prev_depth);
ACG::GLState::depthFunc (prev_depth);
glColorMask (GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
}
......@@ -523,21 +523,21 @@ CoordsysNode::pick(GLState& _state, PickTarget _target)
{
// clear depth buffer in coordsys region
glDepthRange (1.0, 1.0);
glDepthFunc (GL_ALWAYS);
ACG::GLState::depthFunc (GL_ALWAYS);
// Koordinatensystem zeichnen
drawCoordsys(_state);
// draw coordsys in normal mode
glDepthRange (0.0, 1.0);
glDepthFunc (GL_LESS);
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);
glDepthFunc (GL_ALWAYS);
ACG::GLState::depthFunc (GL_ALWAYS);
glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE);
// Koordinatensystem zeichnen
......@@ -545,7 +545,7 @@ CoordsysNode::pick(GLState& _state, PickTarget _target)
// reset to default
glDepthRange (0.0, 1.0);
glDepthFunc (prev_depth);
ACG::GLState::depthFunc (prev_depth);
glColorMask (GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
}
}
......@@ -597,7 +597,7 @@ void CoordsysNode::clearPickArea(GLState& _state, bool _draw, GLfloat _depth)
_state.push_modelview_matrix();
_state.reset_modelview();
glDepthFunc (GL_ALWAYS);
ACG::GLState::depthFunc (GL_ALWAYS);
glDepthRange (_depth, _depth);
_state.translate (center[0], center[1], -0.5);
......@@ -609,7 +609,7 @@ void CoordsysNode::clearPickArea(GLState& _state, bool _draw, GLfloat _depth)
// 10% more to ensure everything is in
gluDisk( quadric, 0, radius * 1.1, 10, 10 );
glDepthFunc (prev_depth);
ACG::GLState::depthFunc (prev_depth);
_state.pop_modelview_matrix();
_state.pop_projection_matrix();
......
......@@ -94,9 +94,9 @@ void EnvMapNode::enter(GLState& _state, const DrawModes::DrawMode& _drawmode)
TextureNode::enter(_state, _drawmode);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glEnable(GL_TEXTURE_2D);
ACG::GLState::enable(GL_TEXTURE_GEN_S);
ACG::GLState::enable(GL_TEXTURE_GEN_T);
ACG::GLState::enable(GL_TEXTURE_2D);
} else
TextureNode::enter( _state, _drawmode);
}
......@@ -110,9 +110,9 @@ void EnvMapNode::leave(GLState& _state, const DrawModes::DrawMode& _drawmode)
if (_drawmode==DrawModes::SOLID_ENV_MAPPED)
{
TextureNode::leave(_state, _drawmode);
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
glDisable(GL_TEXTURE_2D);
ACG::GLState::disable(GL_TEXTURE_GEN_S);
ACG::GLState::disable(GL_TEXTURE_GEN_T);
ACG::GLState::disable(GL_TEXTURE_2D);
} else
TextureNode::leave( _state, _drawmode);
}
......
......@@ -148,8 +148,8 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode)
if (_drawMode & DrawModes::POINTS)
{
glDisable(GL_LIGHTING);
glShadeModel(GL_FLAT);
ACG::GLState::disable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_FLAT);
glPolygonMode(GL_FRONT_AND_BACK, GL_POINT);
draw_obj(i);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
......@@ -158,8 +158,8 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode)
if (_drawMode & DrawModes::WIREFRAME)
{
glDisable(GL_LIGHTING);
glShadeModel(GL_FLAT);
ACG::GLState::disable(GL_LIGHTING);
ACG::GLState::shadeModel(GL_FLAT);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
draw_obj(i);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
......@@ -167,8 +167,8 @@ draw(GLState& _state, const DrawModes::DrawMode& _drawMode)
if (_drawMode & DrawModes::SOLID_FACES_COLORED)
{