14 #ifndef OSG_GLBeginEndAdapter
15 #define OSG_GLBeginEndAdapter 1
17 #include <osg/ref_ptr>
19 #include <osg/Matrixd>
22 #define GL_TEXTURE0 0x84C0
44 APPLY_LOCAL_MATRICES_TO_MODELVIEW
57 void Translatef(GLfloat x, GLfloat y, GLfloat z) { Translated(x,y,z); }
58 void Scalef(GLfloat x, GLfloat y, GLfloat z) { Scaled(x,y,z); }
59 void Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) { Rotated(angle,x,y,z); }
65 void Vertex3f(GLfloat x, GLfloat y, GLfloat z);
66 void Vertex3fv(
const GLfloat* v) { Vertex3f(v[0], v[1], v[2]); }
71 void Color4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
73 _overallColorAssigned =
true;
74 _colorAssigned =
true;
75 _color.set(red,green,blue,alpha);
78 void Color3fv(
const GLfloat* c) { Color4f(c[0], c[1], c[2], 1); }
79 void Color4fv(
const GLfloat* c) { Color4f(c[0], c[1], c[2], c[3]); }
80 void Color4ubv(
const GLubyte* c) {
const float div = 1.0f/255.0f; Color4f(
float(c[0])*div,
float(c[1])*div,
float(c[2])*div,
float(c[3])*div); }
84 _overallNormalAssigned =
true;
85 _normalAssigned =
true;
89 void Normal3fv(
const GLfloat* n) { Normal3f(n[0], n[1], n[2]); }
103 void MultiTexCoord1f(GLenum target, GLfloat x) { MultiTexCoord4f(target, x, 0.0f, 0.0f, 1.0f); }
104 void MultiTexCoord1fv(GLenum target,
const GLfloat* tc) { MultiTexCoord4f(target, tc[0], 0.0f, 0.0f, 1.0f); }
106 void MultiTexCoord2f(GLenum target, GLfloat x, GLfloat y) { MultiTexCoord4f(target, x, y, 0.0f, 1.0f); }
107 void MultiTexCoord2fv(GLenum target,
const GLfloat* tc) { MultiTexCoord4f(target, tc[0],tc[1], 0.0f, 1.0f); }
109 void MultiTexCoord3f(GLenum target, GLfloat x, GLfloat y, GLfloat z) {MultiTexCoord4f(target, x, y, z, 1.0f); }
110 void MultiTexCoord3fv(GLenum target,
const GLfloat* tc) { MultiTexCoord4f(target, tc[0], tc[1], tc[2], 1.0f); }
112 void MultiTexCoord4f(GLenum target, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
113 void MultiTexCoord4fv(GLenum target,
const GLfloat* tc) { MultiTexCoord4f(target, tc[0], tc[1], tc[2], tc[3]); }
115 void VertexAttrib1f(GLuint unit, GLfloat x) { VertexAttrib4f(unit, x, 0.0f, 0.0f, 0.0f); }
116 void VertexAttrib1fv(GLuint unit,
const GLfloat* tc) { VertexAttrib4f(unit, tc[0], 0.0f, 0.0f, 0.0f); }
118 void VertexAttrib2f(GLuint unit, GLfloat x, GLfloat y) { VertexAttrib4f(unit, x, y, 0.0f, 0.0f); }
119 void VertexAttrib2fv(GLuint unit,
const GLfloat* tc) { VertexAttrib4f(unit, tc[0],tc[1], 0.0f, 0.0f); }
121 void VertexAttrib3f(GLuint unit, GLfloat x, GLfloat y, GLfloat z) {VertexAttrib4f(unit, x, y, z, 0.0f); }
122 void VertexAttrib3fv(GLuint unit,
const GLfloat* tc) { VertexAttrib4f(unit, tc[0], tc[1], tc[2], 0.0f); }
124 void VertexAttrib4f(GLuint unit, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
125 void VertexAttrib4fv(GLuint unit,
const GLfloat* tc) { VertexAttrib4f(unit, tc[0], tc[1], tc[2], tc[3]); }
127 void Begin(GLenum mode);
VertexList _vertexAttribList
void MultiTexCoord1f(GLenum target, GLfloat x)
VertexArrayList _vertexAttribsList
osg::ref_ptr< osg::Vec3Array > _vertices
void Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
void Normal3f(GLfloat x, GLfloat y, GLfloat z)
void MultiTexCoord3f(GLenum target, GLfloat x, GLfloat y, GLfloat z)
AssignedList _vertexAttribAssignedList
void Vertex3dv(GLdouble x, GLdouble y, GLdouble z)
osg::ref_ptr< osg::Vec3Array > _normals
MatrixMode setMatrixMode() const
void Translatef(GLfloat x, GLfloat y, GLfloat z)
void TexCoord4fv(const GLfloat *tc)
void Scalef(GLfloat x, GLfloat y, GLfloat z)
void MultiTexCoord2fv(GLenum target, const GLfloat *tc)
void VertexAttrib3f(GLuint unit, GLfloat x, GLfloat y, GLfloat z)
void TexCoord1f(GLfloat x)
void Color3fv(const GLfloat *c)
void MultiTexCoord2f(GLenum target, GLfloat x, GLfloat y)
void VertexAttrib1fv(GLuint unit, const GLfloat *tc)
osg::ref_ptr< osg::Vec4Array > _colors
AssignedList _texCoordAssignedList
void Color4ubv(const GLubyte *c)
bool _overallColorAssigned
bool _overallNormalAssigned
void TexCoord4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
void VertexAttrib4fv(GLuint unit, const GLfloat *tc)
void TexCoord2f(GLfloat x, GLfloat y)
void Color4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
void TexCoord2fv(const GLfloat *tc)
void MultiTexCoord3fv(GLenum target, const GLfloat *tc)
void TexCoord1fv(const GLfloat *tc)
const State * getState() const
void VertexAttrib3fv(GLuint unit, const GLfloat *tc)
std::vector< bool > AssignedList
void setMatrixMode(MatrixMode mode)
std::vector< osg::Vec4f > VertexList
void TexCoord3f(GLfloat x, GLfloat y, GLfloat z)
osg::Vec3f _overallNormal
void Color4fv(const GLfloat *c)
std::list< Matrixd > MatrixStack
void VertexAttrib1f(GLuint unit, GLfloat x)
void Vertex3fv(const GLfloat *v)
void VertexAttrib2fv(GLuint unit, const GLfloat *tc)
void MultiTexCoord1fv(GLenum target, const GLfloat *tc)
void Normal3fv(const GLfloat *n)
void MultiTexCoord4fv(GLenum target, const GLfloat *tc)
VertexArrayList _texCoordsList
void VertexAttrib2f(GLuint unit, GLfloat x, GLfloat y)
void setState(State *state)
void Vertex3dv(const GLdouble *v)
std::vector< osg::ref_ptr< Vec4Array > > VertexArrayList
void TexCoord3fv(const GLfloat *tc)