Imath
<navlinks>
<page>

# GL Functions

Functions that wrap OpenGL calls to accept Imath vectors and matrices.

    #include <Imath/ImathGL.h>

Example:

    #include <Imath/ImathGL.h>

    void
    gl_example()
    {
        Imath::M44f M;
        glPushMatrix (M);

        Imath::V3f v (0.0f, 1.0f, 2.0f);
        glVertex (v);
    }

inline void glVertex(const Imath::V2f &v)

  Call glVertex2f.

inline void glVertex(const Imath::V3f &v)

  Call glVertex3f.

inline void glNormal(const Imath::V3f &n)

  Call glNormal3f.

inline void glColor(const Imath::V3f &c)

  Call glColor3f.

inline void glTranslate(const Imath::V3f &t)

  Call glTranslatef.

inline void glTexCoord(const Imath::V2f &t)

  Call glTexCoord2f.

inline void throwBadMatrix(const Imath::M44f &m)

  Throw an exception if m is not a valid matrix for GL.

inline void glMultMatrix(const Imath::M44f &m)

  Call glMultmatrixf. Throw an exception if m is not a valid matrix for GL.

inline void glMultMatrix(const Imath::M44f *m)

  Call glMultmatrixf. Throw an exception if m is not a valid matrix for GL.

inline void glLoadMatrix(const Imath::M44f &m)

  Call glLoadmatrixf. Throw an exception if m is not a valid matrix for GL.

inline void glLoadMatrix(const Imath::M44f *m)

  Call glLoadmatrixf. Throw an exception if m is not a valid matrix for GL.

class GLPushMatrix

  A class object that pushes/pops the GL matrix.

  This object assists with proper cleanup of the state when exceptions are thrown.

  Public Functions

  inline GLPushMatrix()
  inline ~GLPushMatrix()

class GLPushAttrib

  A class object that pushes/pops the current GL attribute state.

  This object assists with proper cleanup of the state when exceptions are thrown.

  Public Functions

  inline GLPushAttrib(GLbitfield mask)

    call glPushAttrib()

  inline ~GLPushAttrib()

    call glPopAttrib()

class GLBegin

  A class object that wraps glBegin/glEnd.

  The constructor calls glBegin(). The destructor calls glEnd().

  Public Functions

  inline GLBegin(GLenum mode)

    Call glBegin().

  inline ~GLBegin()

    Call glEnd().

</page>