Commit 2a562a9f authored by Jan Möbius's avatar Jan Möbius

Update to use global glstate class

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@12357 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 99577069
......@@ -110,8 +110,8 @@ public:
/** Per reference number blending values
@param _reference stencil reference for blending
@param _src sfactor parameter for glBlendFunc function
@param _dst dfactor parameter for glBlendFunc function
@param _src sfactor parameter for ACG::GLState::blendFunc function
@param _dst dfactor parameter for ACG::GLState::blendFunc function
@param _color color used for blending
@return should blending be berformed for this reference
*/
......@@ -119,8 +119,8 @@ public:
/** Per reference bit blending values
@param _refbit stencil reference bit for blending
@param _src sfactor parameter for glBlendFunc function
@param _dst dfactor parameter for glBlendFunc function
@param _src sfactor parameter for ACG::GLState::blendFunc function
@param _dst dfactor parameter for ACG::GLState::blendFunc function
@param _color color used for blending
@return should blending be berformed for this reference
*/
......
......@@ -161,14 +161,14 @@ void CursorPainter::paintCursor (ACG::GLState *_state)
glPushAttrib (GL_ALL_ATTRIB_BITS);
ACG::GLState::disable(GL_DEPTH_TEST);
ACG::GLState::disable (GL_DEPTH_TEST);
ACG::GLState::disable(GL_LIGHTING);
ACG::GLState::enable(GL_BLEND);
ACG::GLState::blendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
// bind texture
glEnable (GL_TEXTURE_2D);
ACG::GLState::enable (GL_TEXTURE_2D);
ACG::GLState::bindTexture (GL_TEXTURE_2D, texture_);
glColor4f (1.0, 1.0, 1.0, 1.0);
......@@ -300,12 +300,12 @@ void CursorPainter::cursorToTexture()
index += 4;
}
glEnable (GL_TEXTURE_2D);
ACG::GLState::enable (GL_TEXTURE_2D);
ACG::GLState::bindTexture (GL_TEXTURE_2D, texture_);
glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, 32, 32, 0,
GL_RGBA, GL_UNSIGNED_BYTE, buf);
ACG::GLState::bindTexture (GL_TEXTURE_2D, 0);
ACG::GLState::disable(GL_TEXTURE_2D);
ACG::GLState::disable (GL_TEXTURE_2D);
hasCursor_ = true;
}
......
......@@ -506,7 +506,7 @@ void glViewer::normalsMode(NormalsMode _mode)
switch(normalsMode_ = _mode)
{
case DONT_TOUCH_NORMALS:
glDisable(GL_NORMALIZE);
ACG::GLState::disable(GL_NORMALIZE);
break;
case NORMALIZE_NORMALS:
......@@ -618,7 +618,7 @@ void glViewer::drawScene_mono()
if (oM)
{
glClear (GL_STENCIL_BUFFER_BIT);
glEnable (GL_STENCIL_TEST);
ACG::GLState::enable (GL_STENCIL_TEST);
glStencilOp (GL_KEEP, GL_KEEP, GL_ZERO);
glStencilFunc (GL_ALWAYS, 0, ~0);
......@@ -664,9 +664,9 @@ void glViewer::drawScene_mono()
glPushAttrib(GL_ALL_ATTRIB_BITS);
ACG::GLState::enable(GL_BLEND);
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);
int vp_l, vp_b, vp_w, vp_h;
glstate_->get_viewport (vp_l, vp_b, vp_w, vp_h);
......@@ -720,7 +720,7 @@ void glViewer::drawScene_mono()
glPopMatrix ();
glPopAttrib ();
glDisable (GL_STENCIL_TEST);
ACG::GLState::disable (GL_STENCIL_TEST);
}
......@@ -852,7 +852,7 @@ void glViewer::initializeGL()
// OpenGL state
ACG::GLState::enable(GL_DEPTH_TEST);
ACG::GLState::enable(GL_LIGHTING);
glDisable(GL_DITHER);
ACG::GLState::disable(GL_DITHER);
ACG::GLState::shadeModel( GL_FLAT );
......@@ -914,7 +914,7 @@ void glViewer::paintGL()
ACG::GLState::enable(GL_DEPTH_TEST);
ACG::GLState::enable(GL_LIGHTING);
glDisable(GL_DITHER);
ACG::GLState::disable(GL_DITHER);
ACG::GLState::shadeModel( GL_FLAT );
glMatrixMode(GL_PROJECTION);
......@@ -1895,9 +1895,9 @@ void glViewer::applyProperties() {
glFrontFace( GL_CW );
if ( properties_.backFaceCulling() )
ACG::GLState::enable(GL_CULL_FACE );
ACG::GLState::enable( GL_CULL_FACE );
else
glDisable( GL_CULL_FACE );
ACG::GLState::disable( GL_CULL_FACE );
}
......
......@@ -176,9 +176,9 @@ int glViewer::pickColor( ACG::SceneGraph::PickTarget _pickTarget,
glMultMatrixd(projection.get_raw_data());
glMatrixMode(GL_MODELVIEW);
glLoadMatrixd(modelview.get_raw_data());
glDisable(GL_LIGHTING);
glDisable(GL_BLEND);
glEnable(GL_DEPTH_TEST);
ACG::GLState::disable(GL_LIGHTING);
ACG::GLState::disable(GL_BLEND);
ACG::GLState::enable(GL_DEPTH_TEST);
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
properties_.glState().pick_init (true);
......@@ -191,7 +191,7 @@ int glViewer::pickColor( ACG::SceneGraph::PickTarget _pickTarget,
glLoadMatrixd(projection.get_raw_data());
glMatrixMode( GL_MODELVIEW );
glLoadMatrixd(modelview.get_raw_data());
glEnable(GL_LIGHTING);
ACG::GLState::enable(GL_LIGHTING);
properties_.glState().set_clear_color (clear_color);
......@@ -439,8 +439,8 @@ bool glViewer::pickGL( ACG::SceneGraph::PickTarget _pickTarget,
glMultMatrixd(projection.get_raw_data());
glMatrixMode(GL_MODELVIEW);
glLoadMatrixd(modelview.get_raw_data());
glDisable(GL_LIGHTING);
glDisable(GL_BLEND);
ACG::GLState::disable(GL_LIGHTING);
ACG::GLState::disable(GL_BLEND);
glClear(GL_DEPTH_BUFFER_BIT);
properties_.glState().pick_init (false);
......@@ -454,8 +454,8 @@ bool glViewer::pickGL( ACG::SceneGraph::PickTarget _pickTarget,
glLoadMatrixd(projection.get_raw_data());
glMatrixMode( GL_MODELVIEW );
glLoadMatrixd(modelview.get_raw_data());
glEnable(GL_LIGHTING);
glEnable(GL_BLEND);
ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::enable(GL_BLEND);
// process hit record
if ( hits > 0 )
......@@ -571,9 +571,9 @@ bool glViewer::pick_region( ACG::SceneGraph::PickTarget _pickTarg
glMultMatrixd(projection.get_raw_data());
glMatrixMode(GL_MODELVIEW);
glLoadMatrixd(modelview.get_raw_data());
glDisable(GL_LIGHTING);
glDisable(GL_BLEND);
glEnable(GL_DEPTH_TEST);
ACG::GLState::disable(GL_LIGHTING);
ACG::GLState::disable(GL_BLEND);
ACG::GLState::enable(GL_DEPTH_TEST);
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
properties_.glState().pick_init (true);
......@@ -586,8 +586,8 @@ bool glViewer::pick_region( ACG::SceneGraph::PickTarget _pickTarg
glLoadMatrixd(projection.get_raw_data());
glMatrixMode( GL_MODELVIEW );
glLoadMatrixd(modelview.get_raw_data());
glEnable(GL_LIGHTING);
glEnable(GL_BLEND);
ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::enable(GL_BLEND);
properties_.glState().set_clear_color (clear_color);
......@@ -713,9 +713,9 @@ bool glViewer::pick_region( ACG::SceneGraph::PickTarget _pickTarg
glMultMatrixd(projection.get_raw_data());
glMatrixMode(GL_MODELVIEW);
glLoadMatrixd(modelview.get_raw_data());
glDisable(GL_LIGHTING);
glDisable(GL_BLEND);
glEnable(GL_DEPTH_TEST);
ACG::GLState::disable(GL_LIGHTING);
ACG::GLState::disable(GL_BLEND);
ACG::GLState::enable(GL_DEPTH_TEST);
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
properties_.glState().pick_init (true);
......@@ -728,8 +728,8 @@ bool glViewer::pick_region( ACG::SceneGraph::PickTarget _pickTarg
glLoadMatrixd(projection.get_raw_data());
glMatrixMode( GL_MODELVIEW );
glLoadMatrixd(modelview.get_raw_data());
glEnable(GL_LIGHTING);
glEnable(GL_BLEND);
ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::enable(GL_BLEND);
properties_.glState().set_clear_color (clear_color);
......@@ -886,9 +886,9 @@ bool glViewer::pick_region( ACG::SceneGraph::PickTarget _pickTarg
glMultMatrixd(projection.get_raw_data());
glMatrixMode(GL_MODELVIEW);
glLoadMatrixd(modelview.get_raw_data());
glDisable(GL_LIGHTING);
glDisable(GL_BLEND);
glEnable(GL_DEPTH_TEST);
ACG::GLState::disable(GL_LIGHTING);
ACG::GLState::disable(GL_BLEND);
ACG::GLState::enable(GL_DEPTH_TEST);
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
properties_.glState().pick_init (true);
......@@ -901,8 +901,8 @@ bool glViewer::pick_region( ACG::SceneGraph::PickTarget _pickTarg
glLoadMatrixd(projection.get_raw_data());
glMatrixMode( GL_MODELVIEW );
glLoadMatrixd(modelview.get_raw_data());
glEnable(GL_LIGHTING);
glEnable(GL_BLEND);
ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::enable(GL_BLEND);
properties_.glState().set_clear_color (clear_color);
......@@ -1060,9 +1060,9 @@ bool glViewer::pick_region( ACG::SceneGraph::PickTarget _pickTarg
glMultMatrixd(projection.get_raw_data());
glMatrixMode(GL_MODELVIEW);
glLoadMatrixd(modelview.get_raw_data());
glDisable(GL_LIGHTING);
glDisable(GL_BLEND);
glEnable(GL_DEPTH_TEST);
ACG::GLState::disable(GL_LIGHTING);
ACG::GLState::disable(GL_BLEND);
ACG::GLState::enable(GL_DEPTH_TEST);
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
properties_.glState().pick_init (true);
......@@ -1075,8 +1075,8 @@ bool glViewer::pick_region( ACG::SceneGraph::PickTarget _pickTarg
glLoadMatrixd(projection.get_raw_data());
glMatrixMode( GL_MODELVIEW );
glLoadMatrixd(modelview.get_raw_data());
glEnable(GL_LIGHTING);
glEnable(GL_BLEND);
ACG::GLState::enable(GL_LIGHTING);
ACG::GLState::enable(GL_BLEND);
properties_.glState().set_clear_color (clear_color);
......
......@@ -356,15 +356,15 @@ glViewer::drawScene_customAnaglyphStereo()
glCopyTexSubImage2D (GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0, vp_l, vp_b, vp_w, vp_h);
ACG::GLState::bindTexture (GL_TEXTURE_RECTANGLE_ARB, 0);
glActiveTexture (GL_TEXTURE0);
ACG::GLState::activeTexture (GL_TEXTURE0);
ACG::GLState::bindTexture (GL_TEXTURE_RECTANGLE_ARB, agTexture_[0]);
glEnable (GL_TEXTURE_RECTANGLE_ARB);
ACG::GLState::enable (GL_TEXTURE_RECTANGLE_ARB);
glActiveTexture (GL_TEXTURE1);
ACG::GLState::activeTexture (GL_TEXTURE1);
ACG::GLState::bindTexture (GL_TEXTURE_RECTANGLE_ARB, agTexture_[1]);
glEnable (GL_TEXTURE_RECTANGLE_ARB);
ACG::GLState::enable (GL_TEXTURE_RECTANGLE_ARB);
glEnable (GL_FRAGMENT_PROGRAM_ARB);
ACG::GLState::enable (GL_FRAGMENT_PROGRAM_ARB);
glBindProgramARB (GL_FRAGMENT_PROGRAM_ARB, agProgram_);
glProgramEnvParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 0, le[0], le[3], le[6], 0.0);
......@@ -381,7 +381,7 @@ glViewer::drawScene_customAnaglyphStereo()
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
ACG::GLState::disable(GL_DEPTH_TEST);
ACG::GLState::disable (GL_DEPTH_TEST);
glBegin (GL_QUADS);
glMultiTexCoord2f (GL_TEXTURE0, 0, vp_h);
......@@ -398,18 +398,18 @@ glViewer::drawScene_customAnaglyphStereo()
glVertex2i(vp_w, 0);
glEnd ();
glEnable (GL_DEPTH_TEST);
ACG::GLState::enable (GL_DEPTH_TEST);
glBindProgramARB (GL_FRAGMENT_PROGRAM_ARB, 0);
ACG::GLState::disable(GL_FRAGMENT_PROGRAM_ARB);
ACG::GLState::disable (GL_FRAGMENT_PROGRAM_ARB);
glActiveTexture (GL_TEXTURE1);
ACG::GLState::activeTexture (GL_TEXTURE1);
ACG::GLState::bindTexture (GL_TEXTURE_RECTANGLE_ARB, 0);
ACG::GLState::disable(GL_TEXTURE_RECTANGLE_ARB);
ACG::GLState::disable (GL_TEXTURE_RECTANGLE_ARB);
glActiveTexture (GL_TEXTURE0);
ACG::GLState::activeTexture (GL_TEXTURE0);
ACG::GLState::bindTexture (GL_TEXTURE_RECTANGLE_ARB, 0);
ACG::GLState::disable(GL_TEXTURE_RECTANGLE_ARB);
ACG::GLState::disable (GL_TEXTURE_RECTANGLE_ARB);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment