10 #ifndef INCLUDED_ATOMSMATHGL_H
11 #define INCLUDED_ATOMSMATHGL_H
15 #include <AtomsMath/ImathFun.h>
16 #include <AtomsMath/ImathMatrix.h>
17 #include <AtomsMath/ImathNamespace.h>
18 #include <AtomsMath/ImathVec.h>
22 glVertex (
const ATOMSMATH_INTERNAL_NAMESPACE::V3f& v)
24 glVertex3f (v.x, v.y, v.z);
29 glVertex (
const ATOMSMATH_INTERNAL_NAMESPACE::V2f& v)
31 glVertex2f (v.x, v.y);
36 glNormal (
const ATOMSMATH_INTERNAL_NAMESPACE::V3f& n)
38 glNormal3f (n.x, n.y, n.z);
43 glColor (
const ATOMSMATH_INTERNAL_NAMESPACE::V3f& c)
45 glColor3f (c.x, c.y, c.z);
50 glTranslate (
const ATOMSMATH_INTERNAL_NAMESPACE::V3f& t)
52 glTranslatef (t.x, t.y, t.z);
57 glTexCoord (
const ATOMSMATH_INTERNAL_NAMESPACE::V2f& t)
59 glTexCoord2f (t.x, t.y);
66 glActiveTexture (GL_TEXTURE1);
67 glBindTexture (GL_TEXTURE_2D, 0);
68 glDisable (GL_TEXTURE_2D);
70 glActiveTexture (GL_TEXTURE0);
76 const float GL_FLOAT_MAX = 1.8e+19;
81 return !ATOMSMATH_INTERNAL_NAMESPACE::finitef (f) || f < -GL_FLOAT_MAX || f > GL_FLOAT_MAX;
88 throwBadMatrix (
const ATOMSMATH_INTERNAL_NAMESPACE::M44f& m)
90 #ifdef ATOMS_USE_EXCEPTIONS
91 if (badFloat (m[0][0]) || badFloat (m[0][1]) || badFloat (m[0][2]) || badFloat (m[0][3]) ||
92 badFloat (m[1][0]) || badFloat (m[1][1]) || badFloat (m[1][2]) || badFloat (m[1][3]) ||
93 badFloat (m[2][0]) || badFloat (m[2][1]) || badFloat (m[2][2]) || badFloat (m[2][3]) ||
94 badFloat (m[3][0]) || badFloat (m[3][1]) || badFloat (m[3][2]) || badFloat (m[3][3]))
95 throw std::invalid_argument (
"GL matrix overflow");
101 glMultMatrix (
const ATOMSMATH_INTERNAL_NAMESPACE::M44f& m)
104 glMultMatrixf ((GLfloat*) m[0]);
109 glMultMatrix (
const ATOMSMATH_INTERNAL_NAMESPACE::M44f* m)
112 glMultMatrixf ((GLfloat*) (*m)[0]);
117 glLoadMatrix (
const ATOMSMATH_INTERNAL_NAMESPACE::M44f& m)
120 glLoadMatrixf ((GLfloat*) m[0]);
125 glLoadMatrix (
const ATOMSMATH_INTERNAL_NAMESPACE::M44f* m)
128 glLoadMatrixf ((GLfloat*) (*m)[0]);
131 ATOMSMATH_INTERNAL_NAMESPACE_HEADER_ENTER
176 ATOMSMATH_INTERNAL_NAMESPACE_HEADER_EXIT
Definition: ImathGL.h:166
GLBegin(GLenum mode)
Call glBegin()
Definition: ImathGL.h:170
~GLBegin()
Call glEnd()
Definition: ImathGL.h:173
Definition: ImathGL.h:151
GLPushAttrib(GLbitfield mask)
call glPushAttrib()
Definition: ImathGL.h:154
~GLPushAttrib()
call glPopAttrib()
Definition: ImathGL.h:157
Definition: ImathGL.h:139