-
-OPENGL_GENERIC_FUNC(void, LoadMatrix, P);
-OPENGL_GENERIC_FUNC(void, LoadMatrix, M);
-OPENGL_GENERIC_FUNC(void, MultMatrix, P);
-OPENGL_GENERIC_FUNC(void, MultMatrix, M);
-
-OPENGL_GENERIC_FUNC(void, Scale, S3);
-OPENGL_GENERIC_FUNC(void, Scale, V3);
-OPENGL_GENERIC_FUNC(void, Rotate, S4);
-OPENGL_GENERIC_FUNC(void, Rotate, V4);
-OPENGL_GENERIC_FUNC(void, Translate, S3);
-OPENGL_GENERIC_FUNC(void, Translate, V3);
-
-OPENGL_ORDINAL_FUNC(void, Color, 3);
-OPENGL_ORDINAL_FUNC(void, Color, 4);
-
-OPENGL_ORDINAL_FUNC(void, Vertex, 2);
-OPENGL_ORDINAL_FUNC(void, Vertex, 3);
-OPENGL_ORDINAL_FUNC(void, Vertex, 4);
-
-OPENGL_ORDINAL_FUNC(void, TexCoord, 2);
-OPENGL_ORDINAL_FUNC(void, TexCoord, 3);
-OPENGL_ORDINAL_FUNC(void, TexCoord, 4);
-
-OPENGL_GENERIC_FUNC(void, Rect, S4);
-OPENGL_GENERIC_FUNC(void, Rect, V4);
-
-
-#if USE_DOUBLE_PRECISION
-inline void glGetScalar(GLenum a, GLscalar* b) { glGetDoublev(a, b); }
+OPENGL_GENERIC_FUNC(void, LoadMatrix, P);
+OPENGL_GENERIC_FUNC(void, LoadMatrix, M);
+OPENGL_GENERIC_FUNC(void, MultMatrix, P);
+OPENGL_GENERIC_FUNC(void, MultMatrix, M);
+
+OPENGL_GENERIC_FUNC(void, Scale, S3);
+OPENGL_GENERIC_FUNC(void, Scale, V3);
+OPENGL_GENERIC_FUNC(void, Rotate, S4);
+OPENGL_GENERIC_FUNC(void, Rotate, V4);
+OPENGL_GENERIC_FUNC(void, Translate, S3);
+OPENGL_GENERIC_FUNC(void, Translate, V3);
+
+OPENGL_ORDINAL_FUNC(void, Color, 3);
+OPENGL_ORDINAL_FUNC(void, Color, 4);
+
+OPENGL_ORDINAL_FUNC(void, Vertex, 2);
+OPENGL_ORDINAL_FUNC(void, Vertex, 3);
+OPENGL_ORDINAL_FUNC(void, Vertex, 4);
+
+OPENGL_ORDINAL_FUNC(void, TexCoord, 2);
+OPENGL_ORDINAL_FUNC(void, TexCoord, 3);
+OPENGL_ORDINAL_FUNC(void, TexCoord, 4);
+
+OPENGL_GENERIC_FUNC(void, Rect, S4);
+OPENGL_GENERIC_FUNC(void, Rect, V4);
+
+inline void glMaterial(GLenum face, GLenum pname, moof::scalar s)
+{
+ glMaterialf(face, pname, float(s));
+}
+
+inline void glMaterial(GLenum face, GLenum pname, const moof::vector4& v)
+{
+#if ENABLE_DOUBLE_PRECISION
+ float f[] = {v[0], v[1], v[2], v[3]};
+ glMaterialfv(face, pname, f);
+#else
+ glMaterialfv(face, pname, v.data());
+#endif
+}
+
+inline void glVertexPointer(const std::vector<moof::vector3>& v)
+{
+ glVertexPointer(3, GL_SCALAR, 0, v[0].data());
+}
+inline void glTexCoordPointer(const std::vector<moof::vector2>& v)
+{
+ glTexCoordPointer(2, GL_SCALAR, 0, v[0].data());
+}
+
+inline void glDrawElements(GLenum type, const std::vector<GLuint>& v)
+{
+ glDrawElements(type, v.size(), GL_UNSIGNED_INT, &v[0]);
+}
+
+inline void glGetScalar(GLenum a, GLscalar* b)
+{
+#if ENABLE_DOUBLE_PRECISION
+ glGetDoublev(a, b);