TAPs 0.7.7.3
TAPsOpenGLFns.hpp File Reference
#include "TAPsOpenGLEnumList.hpp"
#include "../Core/TAPsLib.hpp"
#include "wx/wx.h"
#include "TAPsOpenGLFns.cpp"
Include dependency graph for TAPsOpenGLFns.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define CHECK_GL_ERROR()   GFnCheckGLError( __FILE__, __LINE__ )
#define CHECK_GL_ERROR_MESSAGE(s)   GFnCheckGLError( s )
#define CHECK_FRAMEBUFFER_STATUS()   GFnCheckFrameBufferStatus()

Functions

BEGIN_NAMESPACE_TAPs__OpenGL__Fn
void 
GFnCheckGLError (char *file, int line, int *glErrCode=NULL)
void GFnCheckGLError (char *customMessage, int *glErrCode=NULL)
void GFnCheckFrameBufferStatus ()
void InitializeLight (GLenum light, GLfloat a0=1.0, GLfloat a1=1.0, GLfloat a2=1.0, GLfloat a3=1.0, GLfloat d0=1.0, GLfloat d1=1.0, GLfloat d2=1.0, GLfloat d3=1.0, GLfloat s0=1.0, GLfloat s1=1.0, GLfloat s2=1.0, GLfloat s3=1.0, GLfloat p0=0.0, GLfloat p1=0.0, GLfloat p2=10.0, GLfloat p3=1.0)
void SetLightAmbient (GLenum light, GLfloat r, GLfloat g, GLfloat b, GLfloat a)
void SetLightDiffuse (GLenum light, GLfloat r, GLfloat g, GLfloat b, GLfloat a)
void SetLightSpecular (GLenum light, GLfloat r, GLfloat g, GLfloat b, GLfloat a)
void SetLightPosition (GLenum light, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
void SetLightAttenuation (GLenum light, GLfloat constant, GLfloat linear, GLfloat quadratic)
void SetLightSpotCutoff (GLenum light, GLfloat halfAngle)
void SetLightSpotDirection (GLenum light, GLfloat x, GLfloat y, GLfloat z)
void SetLightSpotExponent (GLenum light, GLfloat exp)
void EnableLight (GLenum light)
void DisableLight (GLenum light)
void EnableLightingWithTwoSide (bool twoSide=true)
void EnableLightingWithOneSide (bool oneSide=true)
void EnableLighting ()
void DisableLighting ()
void ToggleLighting ()
void EnableDepthTest ()
void DisableDepthTest ()
void ToggleDepthTest ()
void SetFrontFaceCCW (bool=true)
void SetFrontFaceCW (bool=true)
void ToggleFrontFaceOriantation ()
void EnableCullFace ()
void DisableCullFace ()
void ToggleCullFace ()
void SetDrawingMode (GLenum face, GLenum mode)
void SwitchDrawingMode ()
void SwitchDrawFaceMode ()
void SwitchCullFaceMode ()
template<typename T >
Matrix4x4< T > CalShadowProjectionMatrix (Vector4< T > const &lightPos, Vector4< T > const &planeEqn)
GLuint GetGLFontDisplayList ()
void GenerateScreenText (Enum::GLUT=Enum::BITMAP_9_BY_15)
void DrawGLText (char const *const str)
void DrawGLText (std::string str)
void DrawGLText (char const *const str, GLfloat x, GLfloat y, GLfloat z=0.0f)
void DrawGLText (std::string str, GLfloat x, GLfloat y, GLfloat z=0.0f)
void DrawGLText (char const *const str, GLfloat const pos[])
void DrawGLText (std::string str, GLfloat const pos[])
void Draw3DLine (const GLfloat x1, const GLfloat y1, const GLfloat z1, const GLfloat x2, const GLfloat y2, const GLfloat z2)
void Draw3DLine (GLfloat const *const p1, GLfloat const *const p2)
void Draw3DLine (const Vector3< GLint > P1, const Vector3< GLint > P2)
void Draw3DLine (const Vector3< GLfloat > P1, const Vector3< GLfloat > P2)
void Draw3DLine (const Vector3< GLdouble > P1, const Vector3< GLdouble > P2)
GLUquadricObj * NewGLUQuardic ()
void DeleteGLUQuardic (GLUquadricObj *qObj)
void ErrorCallBack (GLenum errorCode)

Define Documentation

#define CHECK_FRAMEBUFFER_STATUS ( )    GFnCheckFrameBufferStatus()

Definition at line 76 of file TAPsOpenGLFns.hpp.

#define CHECK_GL_ERROR ( )    GFnCheckGLError( __FILE__, __LINE__ )

Definition at line 37 of file TAPsOpenGLFns.hpp.

#define CHECK_GL_ERROR_MESSAGE (   s)    GFnCheckGLError( s )

Definition at line 56 of file TAPsOpenGLFns.hpp.


Function Documentation

template<typename T >
Matrix4x4<T> CalShadowProjectionMatrix ( Vector4< T > const &  lightPos,
Vector4< T > const &  planeEqn 
)

Definition at line 337 of file STAPsGLFns.cpp.

{
    T dot = planeEqn*lightPos;
    return Matrix4x4<T> ( 
            dot - lightPos[0]*planeEqn[0],
            dot - lightPos[0]*planeEqn[1],
            dot - lightPos[0]*planeEqn[2],
            dot - lightPos[0]*planeEqn[3],
            dot - lightPos[1]*planeEqn[0],
            dot - lightPos[1]*planeEqn[1],
            dot - lightPos[1]*planeEqn[2],
            dot - lightPos[1]*planeEqn[3],
            dot - lightPos[2]*planeEqn[0],
            dot - lightPos[2]*planeEqn[1],
            dot - lightPos[2]*planeEqn[2],
            dot - lightPos[2]*planeEqn[3],
            dot - lightPos[3]*planeEqn[0],
            dot - lightPos[3]*planeEqn[1],
            dot - lightPos[3]*planeEqn[2],
            dot - lightPos[3]*planeEqn[3]
        );
}
void DeleteGLUQuardic ( GLUquadricObj *  qObj)

Definition at line 656 of file TAPsOpenGLFns.cpp.

{
    gluDeleteQuadric( qObj );
}
void DisableCullFace ( ) [inline]

Definition at line 222 of file STAPsGLFns.cpp.

{   glDisable( GL_CULL_FACE );  }
void DisableDepthTest ( ) [inline]

Definition at line 325 of file TAPsOpenGLFns.cpp.

{   glDisable( GL_DEPTH_TEST ); }
void DisableLight ( GLenum  light) [inline]

Definition at line 283 of file TAPsOpenGLFns.cpp.

{
    glDisable( light );
}
void DisableLighting ( ) [inline]

Definition at line 312 of file TAPsOpenGLFns.cpp.

{   glDisable( GL_LIGHTING );   }
void Draw3DLine ( const GLfloat  x1,
const GLfloat  y1,
const GLfloat  z1,
const GLfloat  x2,
const GLfloat  y2,
const GLfloat  z2 
)
void Draw3DLine ( GLfloat const *const  p1,
GLfloat const *const  p2 
)

Definition at line 607 of file TAPsOpenGLFns.cpp.

{
    glBegin( GL_LINES );
    glVertex3fv( p1 );
    glVertex3fv( p2 );
    glEnd();
}
void Draw3DLine ( const Vector3< GLint >  P1,
const Vector3< GLint >  P2 
)

Definition at line 614 of file TAPsOpenGLFns.cpp.

{
    glBegin( GL_LINES );
    glVertex3i( P1[0], P1[1], P1[2] );
    glVertex3i( P2[0], P2[1], P2[2] );
    glEnd();
}
void Draw3DLine ( const Vector3< GLfloat >  P1,
const Vector3< GLfloat >  P2 
)

Definition at line 621 of file TAPsOpenGLFns.cpp.

{
    glBegin( GL_LINES );
    glVertex3f( P1[0], P1[1], P1[2] );
    glVertex3f( P2[0], P2[1], P2[2] );
    glEnd();
}
void Draw3DLine ( const Vector3< GLdouble >  P1,
const Vector3< GLdouble >  P2 
)

Definition at line 628 of file TAPsOpenGLFns.cpp.

{
    glBegin( GL_LINES );
    glVertex3d( P1[0], P1[1], P1[2] );
    glVertex3d( P2[0], P2[1], P2[2] );
    glEnd();
}
void DrawGLText ( char const *const  str) [inline]

Definition at line 291 of file TAPsOpenGLFns.hpp.

References BITMAP_9_BY_15, GenerateScreenText(), and GetGLFontDisplayList().

Referenced by OpenGLVolPresPolygonalModel< T >::DisplayGLText(), OpenGLPNTriangleVolPresModel< T >::DisplayGLText(), ExtendedOpenGLPNTriangleVolPresModel< T >::DisplayGLText(), DrawGLText(), and OpenGLCtrl::DrawText().

    {
        //std::cout << "DrawGLText\n";

        if ( GetGLFontDisplayList() == 0 ) {
            GenerateScreenText( Enum::BITMAP_9_BY_15 );
        }
        glListBase( GetGLFontDisplayList() );
        glCallLists( static_cast<GLsizei>(strlen(str)) , GL_BYTE, str );
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void DrawGLText ( std::string  str) [inline]

Definition at line 301 of file TAPsOpenGLFns.hpp.

References DrawGLText().

    { DrawGLText( str.c_str() ); }

Here is the call graph for this function:

void DrawGLText ( char const *const  str,
GLfloat  x,
GLfloat  y,
GLfloat  z = 0.0f 
) [inline]

Definition at line 305 of file TAPsOpenGLFns.hpp.

References DrawGLText().

    {
        glRasterPos3f( x, y, z );
        DrawGLText( str );
    }

Here is the call graph for this function:

void DrawGLText ( std::string  str,
GLfloat  x,
GLfloat  y,
GLfloat  z = 0.0f 
) [inline]

Definition at line 310 of file TAPsOpenGLFns.hpp.

References DrawGLText().

    { DrawGLText( str.c_str(), x, y, z ); }

Here is the call graph for this function:

void DrawGLText ( std::string  str,
GLfloat const  pos[] 
) [inline]

Definition at line 316 of file TAPsOpenGLFns.hpp.

References DrawGLText().

    { DrawGLText( str.c_str(), pos ); }

Here is the call graph for this function:

void DrawGLText ( char const *const  str,
GLfloat const  pos[] 
) [inline]

Definition at line 314 of file TAPsOpenGLFns.hpp.

References DrawGLText().

    {   DrawGLText( str, pos[0], pos[1], pos[2] );  }

Here is the call graph for this function:

void EnableCullFace ( ) [inline]

Definition at line 219 of file STAPsGLFns.cpp.

{   glEnable( GL_CULL_FACE );   }
void EnableDepthTest ( ) [inline]

Definition at line 322 of file TAPsOpenGLFns.cpp.

{   glEnable( GL_DEPTH_TEST );  }
void EnableLight ( GLenum  light) [inline]

Definition at line 277 of file TAPsOpenGLFns.cpp.

{
    glEnable( light );
}
void EnableLighting ( ) [inline]

Definition at line 309 of file TAPsOpenGLFns.cpp.

{   glEnable( GL_LIGHTING );    }
void EnableLightingWithOneSide ( bool  oneSide = true) [inline]

Definition at line 303 of file TAPsOpenGLFns.cpp.

References EnableLightingWithTwoSide().

{
    EnableLightingWithTwoSide( !oneSide );
}

Here is the call graph for this function:

void EnableLightingWithTwoSide ( bool  twoSide = true)

Definition at line 290 of file TAPsOpenGLFns.cpp.

Referenced by EnableLightingWithOneSide().

{
    // Set lighting for one side or two sides.
    if ( twoSide )  glLightModeli( GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE );
    else            glLightModeli( GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE );
    // Start Using GL Light(s)
    glShadeModel( GL_SMOOTH );
    glEnable( GL_LIGHTING );
    glEnable( GL_DEPTH_TEST );
}

Here is the caller graph for this function:

void ErrorCallBack ( GLenum  errorCode)

Definition at line 660 of file TAPsOpenGLFns.cpp.

{
    const GLubyte *errStr = gluErrorString( errCode );
    std::cerr << "Quadric Error: " << errStr << "!" << std::endl;
    exit(1);
}
void GenerateScreenText ( Enum::GLUT  = Enum::BITMAP_9_BY_15)

Definition at line 519 of file TAPsOpenGLFns.cpp.

References BITMAP_8_BY_13, BITMAP_9_BY_15, BITMAP_HELVETICA_10, BITMAP_HELVETICA_12, BITMAP_HELVETICA_18, BITMAP_TIMES_ROMAN_10, BITMAP_TIMES_ROMAN_24, and g_uiGLFontDisplayList.

Referenced by DrawGLText().

{
    //std::cout << "GenerateScreenText\n";

    if ( g_uiGLFontDisplayList == 0 ) {
        void * ptr = NULL;
        switch (textStyle) {
            case Enum::BITMAP_9_BY_15:
                ptr = GLUT_BITMAP_9_BY_15;
                break;
            case Enum::BITMAP_8_BY_13:
                ptr = GLUT_BITMAP_8_BY_13;
                break;
            case Enum::BITMAP_TIMES_ROMAN_10:
                ptr = GLUT_BITMAP_TIMES_ROMAN_10;
                break;
            case Enum::BITMAP_TIMES_ROMAN_24:
                ptr = GLUT_BITMAP_TIMES_ROMAN_24;
                break;
            case Enum::BITMAP_HELVETICA_10:
                ptr = GLUT_BITMAP_HELVETICA_10;
                break;
            case Enum::BITMAP_HELVETICA_12:
                ptr = GLUT_BITMAP_HELVETICA_12;
                break;
            case Enum::BITMAP_HELVETICA_18:
                ptr = GLUT_BITMAP_HELVETICA_18;
                break;
            default:
                ptr = GLUT_BITMAP_9_BY_15;
        }
        int baseSize = 256;
        //int base = glGenLists( baseSize );    // font list base
        g_uiGLFontDisplayList = glGenLists( baseSize ); // font list base
        // generate fonts
        for ( int i = 0; i < 256; ++i ) {
            //glNewList(base+i, GL_COMPILE);
            glNewList(g_uiGLFontDisplayList+i, GL_COMPILE);
            glutBitmapCharacter(ptr, i);
            glEndList();
        }
        //glListBase(base);
    }
}

Here is the caller graph for this function:

GLuint GetGLFontDisplayList ( )

Definition at line 27 of file TAPsOpenGLFns.cpp.

References g_uiGLFontDisplayList.

Referenced by DrawGLText().

Here is the caller graph for this function:

void GFnCheckFrameBufferStatus ( )

Use TAPs::OpenGL::Fn::CHECK_GL_ERROR() which is a macro for GFnCheckGLError( __FILE__, __LINE__ ) to printout GL errors that are accumulated due to OpenGL commands.

This function is a no-op function if the TAPs_DEBUG_MODE preprocessor symbol is not defined.

Definition at line 178 of file STAPsGLFns.cpp.

{}
void GFnCheckGLError ( char *  customMessage,
int *  glErrCode 
)

Use TAPs::OpenGL::Fn::CHECK_GL_ERROR_MESSAGE( char * customMessage ) which is a macro for GFnCheckGLError( s ) to printout GL errors that are accumulated due to OpenGL commands.

<customMessage> is a string that can be used to indicate the location or message where the error check occurs.

This function is a no-op function if the TAPs_DEBUG_MODE preprocessor symbol is not defined.

Definition at line 79 of file STAPsGLFns.cpp.

    {
        GLenum glErr = glGetError();
        int errCode = 0;
        while ( glErr != GL_NO_ERROR ) {
        #ifdef TAPs_USE_WXWIDGETS
            wxLogError( wxT( "%s --> GL Error #%d (%s)!" ), 
                        customMessage, glErr, gluErrorString(glErr) );
        #else
            std::cerr
                << customMessage << " --> GL Error #" << glErr 
                << " (" << gluErrorString(glErr) << ")!" << std::endl;
        #endif
            errCode = 1;
            glErr = glGetError();
        }
        if ( glErrCode )    *glErrCode = errCode;
    }
BEGIN_NAMESPACE_TAPs__OpenGL__Fn void GFnCheckGLError ( char *  file,
int  line,
int *  glErrCode 
)

Use TAPs::OpenGL::Fn::CHECK_GL_ERROR() which is a macro for GFnCheckGLError( __FILE__, __LINE__ ) to printout GL errors that are accumulated due to OpenGL commands.

This function is a no-op function if the TAPs_DEBUG_MODE preprocessor symbol is not defined.

Definition at line 43 of file STAPsGLFns.cpp.

    {
        GLenum glErr = glGetError();
        int errCode = 0;
        while ( glErr != GL_NO_ERROR ) {
        #ifdef TAPs_USE_WXWIDGETS
            wxLogError( wxT( "GL Error #%d (%s) in file %s at line#%d" ), 
                        glErr, gluErrorString(glErr), file, line );
        #else
            std::cout
                << "GL Error #" << glErr << " (" << gluErrorString(glErr) << ") "
                << "in file " << file << " at line#" << line << std::endl;
        #endif
            errCode = 1;
            glErr = glGetError();
        }
        if ( glErrCode )    *glErrCode = errCode;
    }
void InitializeLight ( GLenum  light,
GLfloat  a0 = 1.0,
GLfloat  a1 = 1.0,
GLfloat  a2 = 1.0,
GLfloat  a3 = 1.0,
GLfloat  d0 = 1.0,
GLfloat  d1 = 1.0,
GLfloat  d2 = 1.0,
GLfloat  d3 = 1.0,
GLfloat  s0 = 1.0,
GLfloat  s1 = 1.0,
GLfloat  s2 = 1.0,
GLfloat  s3 = 1.0,
GLfloat  p0 = 0.0,
GLfloat  p1 = 0.0,
GLfloat  p2 = 10.0,
GLfloat  p3 = 1.0 
)

Definition at line 192 of file TAPsOpenGLFns.cpp.

Referenced by OpenGLViewManager< T >::Setup().

{
    // Light Attributes
    GLfloat light_ambient[]  = { a0, a1, a2, a3 };
    GLfloat light_diffuse[]  = { d0, d1, d2, d3 };
    GLfloat light_specular[] = { s0, s1, s2, s3 };
    GLfloat light_position[] = { p0, p1, p2, p3 };

    // Setup Light
    glLightfv( light, GL_AMBIENT, light_ambient );
    glLightfv( light, GL_DIFFUSE, light_diffuse );
    glLightfv( light, GL_SPECULAR, light_specular );
    glLightfv( light, GL_POSITION, light_position );

    // Enable Light
    glEnable( light );
}

Here is the caller graph for this function:

GLUquadricObj* NewGLUQuardic ( )

Definition at line 642 of file TAPsOpenGLFns.cpp.

{
    GLUquadricObj * qObj = gluNewQuadric();
#ifdef TAPs_DEBUG_ENABLE
    if ( !qObj ) {
        std::cerr << "Warning: GLUquadricObj cannot be created!\n";
        return qObj;
    }
#endif
    //gluQuadricCallback( qObj, GLU_ERROR, ErrorCallBack);
    gluQuadricDrawStyle( qObj, GLU_FILL );  // smooth shaded
    gluQuadricNormals( qObj, GLU_SMOOTH );
    return qObj;
}
void SetDrawingMode ( GLenum  face,
GLenum  mode 
) [inline]

Definition at line 240 of file STAPsGLFns.cpp.

{
    glPolygonMode( face, mode );
    glCullFace( face );
    glEnable( GL_CULL_FACE );
}
void SetFrontFaceCCW ( bool  = true) [inline]

Definition at line 195 of file STAPsGLFns.cpp.

Referenced by SetFrontFaceCW().

{
    if ( b )    glFrontFace( GL_CCW );
    else        glFrontFace( GL_CW );
}

Here is the caller graph for this function:

void SetFrontFaceCW ( bool  = true) [inline]

Definition at line 202 of file STAPsGLFns.cpp.

References SetFrontFaceCCW().

{
    SetFrontFaceCCW( !b );
}

Here is the call graph for this function:

void SetLightAmbient ( GLenum  light,
GLfloat  r,
GLfloat  g,
GLfloat  b,
GLfloat  a 
) [inline]

Definition at line 216 of file TAPsOpenGLFns.cpp.

References Physics_SI::K::g.

{
    GLfloat v[] = { r, g, b, a };
    glLightfv( light, GL_AMBIENT, v ); 
}
void SetLightAttenuation ( GLenum  light,
GLfloat  constant,
GLfloat  linear,
GLfloat  quadratic 
) [inline]

Definition at line 244 of file TAPsOpenGLFns.cpp.

{
    glLightf( light, GL_CONSTANT_ATTENUATION, constant );
    glLightf( light, GL_LINEAR_ATTENUATION, linear );
    glLightf( light, GL_QUADRATIC_ATTENUATION, quadratic );
}
void SetLightDiffuse ( GLenum  light,
GLfloat  r,
GLfloat  g,
GLfloat  b,
GLfloat  a 
) [inline]

Definition at line 223 of file TAPsOpenGLFns.cpp.

References Physics_SI::K::g.

{
    GLfloat v[] = { r, g, b, a };
    glLightfv( light, GL_DIFFUSE, v ); 
}
void SetLightPosition ( GLenum  light,
GLfloat  x,
GLfloat  y,
GLfloat  z,
GLfloat  w 
) [inline]

Definition at line 237 of file TAPsOpenGLFns.cpp.

{
    GLfloat v[] = { x, y, z, w };
    glLightfv( light, GL_POSITION, v ); 
}
void SetLightSpecular ( GLenum  light,
GLfloat  r,
GLfloat  g,
GLfloat  b,
GLfloat  a 
) [inline]

Definition at line 230 of file TAPsOpenGLFns.cpp.

References Physics_SI::K::g.

{
    GLfloat v[] = { r, g, b, a };
    glLightfv( light, GL_SPECULAR, v ); 
}
void SetLightSpotCutoff ( GLenum  light,
GLfloat  halfAngle 
) [inline]

Definition at line 256 of file TAPsOpenGLFns.cpp.

{
    glLightf( light, GL_SPOT_CUTOFF, halfAngle ); 
}
void SetLightSpotDirection ( GLenum  light,
GLfloat  x,
GLfloat  y,
GLfloat  z 
) [inline]

Definition at line 263 of file TAPsOpenGLFns.cpp.

{
    GLfloat v[] = { x, y, z };
    glLightfv( light, GL_SPOT_DIRECTION, v ); 
}
void SetLightSpotExponent ( GLenum  light,
GLfloat  exp 
) [inline]

Definition at line 271 of file TAPsOpenGLFns.cpp.

{
    glLightf( light, GL_SPOT_EXPONENT, exp ); 
}
void SwitchCullFaceMode ( )

Definition at line 301 of file STAPsGLFns.cpp.

{
    GLint cullFace;
    glGetIntegerv( GL_CULL_FACE_MODE, &cullFace );
    switch ( cullFace ) {
        case GL_FRONT:
            cullFace = GL_BACK;
            break;
        case GL_BACK:
            cullFace = GL_FRONT_AND_BACK;
            break;
        case GL_FRONT_AND_BACK:
            cullFace = GL_FRONT;
            break;
    }
    glCullFace( cullFace );

//  if      ( GL_BACK  == g_eCullFace ) g_eCullFace = GL_FRONT;
//  else if ( GL_FRONT == g_eCullFace ) g_eCullFace = GL_FRONT_AND_BACK;
//  else                                g_eCullFace = GL_BACK;
//  glCullFace( g_eCullFace );
}
void SwitchDrawFaceMode ( )

Definition at line 275 of file STAPsGLFns.cpp.

{
    GLint DrawFaceAndMode[2];
    glGetIntegerv( GL_POLYGON_MODE, DrawFaceAndMode );
    switch ( DrawFaceAndMode[0] ) {
        case GL_FRONT:
            DrawFaceAndMode[0] = GL_BACK;
            break;
        case GL_BACK:
            DrawFaceAndMode[0] = GL_FRONT_AND_BACK;
            break;
        case GL_FRONT_AND_BACK:
            DrawFaceAndMode[0] = GL_FRONT;
            break;
    }
    glPolygonMode( DrawFaceAndMode[0], DrawFaceAndMode[1] );

//  if      ( GL_FRONT == g_eCullFace ) g_eCullFace = GL_BACK;
//  else if ( GL_BACK  == g_eCullFace ) g_eCullFace = GL_FRONT_AND_BACK;
//  else                                g_eCullFace = GL_FRONT;
//  glPolygonMode( g_eDrawFace, g_eDrawMode );
}
void SwitchDrawingMode ( )

Definition at line 250 of file STAPsGLFns.cpp.

{
    GLint DrawFaceAndMode[2];
    glGetIntegerv( GL_POLYGON_MODE, DrawFaceAndMode );
    switch ( DrawFaceAndMode[1] ) {
        case GL_POINT:
            DrawFaceAndMode[1] = GL_LINE;
            break;
        case GL_LINE:
            DrawFaceAndMode[1] = GL_FILL;
            break;
        case GL_FILL:
            DrawFaceAndMode[1] = GL_POINT;
            break;
    }
    glPolygonMode( DrawFaceAndMode[0], DrawFaceAndMode[1] );

    //++g_eDrawMode;
    //if ( g_eDrawMode > GL_FILL ) g_eDrawMode = GL_POINT;
    //glPolygonMode( g_eDrawFace, g_eDrawMode );
}
void ToggleCullFace ( ) [inline]

Definition at line 225 of file STAPsGLFns.cpp.

{
    if ( glIsEnabled( GL_CULL_FACE ) )  glDisable( GL_CULL_FACE );
    else                                glEnable ( GL_CULL_FACE );
}
void ToggleDepthTest ( ) [inline]

Definition at line 328 of file TAPsOpenGLFns.cpp.

{
    if ( glIsEnabled( GL_DEPTH_TEST ) ) glDisable( GL_DEPTH_TEST );
    else                                glEnable ( GL_DEPTH_TEST );
}
void ToggleFrontFaceOriantation ( ) [inline]

Definition at line 208 of file STAPsGLFns.cpp.

{
    GLint value;
    glGetIntegerv( GL_FRONT_FACE, &value );
    if ( GL_CCW == value )
        glEnable( GL_CW );
    else
        glEnable( GL_CCW );
}
void ToggleLighting ( ) [inline]

Definition at line 315 of file TAPsOpenGLFns.cpp.

{
    if ( glIsEnabled( GL_LIGHTING ) )   glDisable( GL_LIGHTING );
    else                                glEnable ( GL_LIGHTING );
}
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines