From 292be66ecccb2168188bcf8793786effe02b4d53 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 13 Mar 2008 19:44:10 +0000 Subject: [PATCH] Removed gl and glu prefixes from SceneGraphBuilder methods to avoid problems under Solaris --- CMakeLists.txt | 4 +- include/osg/Version | 4 +- include/osgUtil/SceneGraphBuilder | 118 ++++++------ src/osgUtil/SceneGraphBuilder.cpp | 154 +++++++-------- src/osgWrappers/osgUtil/SceneGraphBuilder.cpp | 180 +++++++++--------- 5 files changed, 230 insertions(+), 230 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e8541114..f79808ad8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,8 +16,8 @@ PROJECT(OpenSceneGraph) SET(OPENSCENEGRAPH_MAJOR_VERSION 2) SET(OPENSCENEGRAPH_MINOR_VERSION 3) -SET(OPENSCENEGRAPH_PATCH_VERSION 4) -SET(OPENSCENEGRAPH_SOVERSION 30) +SET(OPENSCENEGRAPH_PATCH_VERSION 5) +SET(OPENSCENEGRAPH_SOVERSION 31) SET(OPENSCENEGRAPH_VERSION ${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}) diff --git a/include/osg/Version b/include/osg/Version index 717a4575d..9a627ac6b 100644 --- a/include/osg/Version +++ b/include/osg/Version @@ -21,8 +21,8 @@ extern "C" { #define OPENSCENEGRAPH_MAJOR_VERSION 2 #define OPENSCENEGRAPH_MINOR_VERSION 3 -#define OPENSCENEGRAPH_PATCH_VERSION 4 -#define OPENSCENEGRAPH_SOVERSION 30 +#define OPENSCENEGRAPH_PATCH_VERSION 5 +#define OPENSCENEGRAPH_SOVERSION 31 /** * osgGetVersion() returns the library version number. diff --git a/include/osgUtil/SceneGraphBuilder b/include/osgUtil/SceneGraphBuilder index 49b009ab8..d191ba1ca 100644 --- a/include/osgUtil/SceneGraphBuilder +++ b/include/osgUtil/SceneGraphBuilder @@ -34,83 +34,83 @@ class OSGUTIL_EXPORT SceneGraphBuilder // // OpenGL 1.0 style building methods // - void glPushMatrix(); - void glPopMatrix(); - void glLoadIdentity(); - void glLoadMatrixd(const GLdouble* m); - void glMultMatrixd(const GLdouble* m); - void glTranslated(GLdouble x, GLdouble y, GLdouble z); - void glScaled(GLdouble x, GLdouble y, GLdouble z); - void glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z); + void PushMatrix(); + void PopMatrix(); + void LoadIdentity(); + void LoadMatrixd(const GLdouble* m); + void MultMatrixd(const GLdouble* m); + void Translated(GLdouble x, GLdouble y, GLdouble z); + void Scaled(GLdouble x, GLdouble y, GLdouble z); + void Rotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z); - void glBlendFunc(GLenum srcFactor, GLenum dstFactor); - void glCullFace(GLenum mode); - void glDepthFunc(GLenum mode); - void glFrontFace(GLenum mode); - void glLineStipple(GLint factor, GLushort pattern); - void glLineWidth(GLfloat lineWidth); - void glPointSize(GLfloat pointSize); - void glPolygonMode(GLenum face, GLenum mode); - void glPolygonOffset(GLfloat factor, GLfloat units); - void glPolygonStipple(const GLubyte* mask); - void glShadeModel(GLenum mode); + void BlendFunc(GLenum srcFactor, GLenum dstFactor); + void CullFace(GLenum mode); + void DepthFunc(GLenum mode); + void FrontFace(GLenum mode); + void LineStipple(GLint factor, GLushort pattern); + void LineWidth(GLfloat lineWidth); + void PointSize(GLfloat pointSize); + void PolygonMode(GLenum face, GLenum mode); + void PolygonOffset(GLfloat factor, GLfloat units); + void PolygonStipple(const GLubyte* mask); + void ShadeModel(GLenum mode); - void glEnable(GLenum mode); - void glDisable(GLenum mode); + void Enable(GLenum mode); + void Disable(GLenum mode); - void glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); - void glColor4fv(GLfloat* c) { glColor4f(c[0], c[1], c[2], c[3]); } + void Color4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); + void Color4fv(GLfloat* c) { Color4f(c[0], c[1], c[2], c[3]); } - void glVertex3f(GLfloat x, GLfloat y, GLfloat z); - void glVertex3fv(GLfloat* v) { glVertex3f(v[0], v[1], v[2]); } + void Vertex3f(GLfloat x, GLfloat y, GLfloat z); + void Vertex3fv(GLfloat* v) { Vertex3f(v[0], v[1], v[2]); } - void glNormal3f(GLfloat x, GLfloat y, GLfloat z); - void glNormal3fv(GLfloat* n) { glNormal3f(n[0], n[1], n[2]); } + void Normal3f(GLfloat x, GLfloat y, GLfloat z); + void Normal3fv(GLfloat* n) { Normal3f(n[0], n[1], n[2]); } - void glTexCoord1f(GLfloat x); - void glTexCoord1fv(GLfloat* tc) { glTexCoord1f(tc[0]); } + void TexCoord1f(GLfloat x); + void TexCoord1fv(GLfloat* tc) { TexCoord1f(tc[0]); } - void glTexCoord2f(GLfloat x, GLfloat y); - void glTexCoord2fv(GLfloat* tc) { glTexCoord2f(tc[0],tc[1]); } + void TexCoord2f(GLfloat x, GLfloat y); + void TexCoord2fv(GLfloat* tc) { TexCoord2f(tc[0],tc[1]); } - void glTexCoord3f(GLfloat x, GLfloat y, GLfloat z); - void glTexCoord3fv(GLfloat* tc) { glTexCoord3f(tc[0], tc[1], tc[2]); } + void TexCoord3f(GLfloat x, GLfloat y, GLfloat z); + void TexCoord3fv(GLfloat* tc) { TexCoord3f(tc[0], tc[1], tc[2]); } - void glTexCoord4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w); - void glTexCoord4fv(GLfloat* tc) { glTexCoord4f(tc[0], tc[1], tc[2], tc[3]); } + void TexCoord4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w); + void TexCoord4fv(GLfloat* tc) { TexCoord4f(tc[0], tc[1], tc[2], tc[3]); } - void glBegin(GLenum mode); - void glEnd(); + void Begin(GLenum mode); + void End(); // // glu style building methods // - void gluQuadricDrawStyle(GLenum aDrawStyle); - void gluQuadricNormals(GLenum aNormals); - void gluQuadricOrientation(GLenum aOrientation); - void gluQuadricTexture(GLboolean aTexture); + void QuadricDrawStyle(GLenum aDrawStyle); + void QuadricNormals(GLenum aNormals); + void QuadricOrientation(GLenum aOrientation); + void QuadricTexture(GLboolean aTexture); - void gluCylinder(GLfloat aBase, - GLfloat aTop, - GLfloat aHeight, - GLint aSlices, - GLint aStacks); + void Cylinder(GLfloat base, + GLfloat top, + GLfloat height, + GLint slices, + GLint stacks); - void gluDisk(GLfloat aInner, - GLfloat aOuter, - GLint aSlices, - GLint aLoops); + void Disk(GLfloat inner, + GLfloat outer, + GLint slices, + GLint loops); - void gluPartialDisk(GLfloat aInner, - GLfloat aOuter, - GLint aSlices, - GLint aLoops, - GLfloat aStart, - GLfloat aSweep); + void PartialDisk(GLfloat inner, + GLfloat outer, + GLint slices, + GLint loops, + GLfloat start, + GLfloat sweep); - void gluSphere(GLfloat aRadius, - GLint aSlices, - GLint aStacks); + void Sphere(GLfloat radius, + GLint slices, + GLint stacks); // diff --git a/src/osgUtil/SceneGraphBuilder.cpp b/src/osgUtil/SceneGraphBuilder.cpp index c64d75870..1f02845dd 100644 --- a/src/osgUtil/SceneGraphBuilder.cpp +++ b/src/osgUtil/SceneGraphBuilder.cpp @@ -46,20 +46,20 @@ SceneGraphBuilder::SceneGraphBuilder(): // // OpenGL 1.0 building methods // -void SceneGraphBuilder::glPushMatrix() +void SceneGraphBuilder::PushMatrix() { if (_matrixStack.empty()) _matrixStack.push_back(osg::Matrixd()); else _matrixStack.push_back(_matrixStack.back()); } -void SceneGraphBuilder::glPopMatrix() +void SceneGraphBuilder::PopMatrix() { if (!_matrixStack.empty()) _matrixStack.pop_back(); matrixChanged(); } -void SceneGraphBuilder::glLoadIdentity() +void SceneGraphBuilder::LoadIdentity() { if (_matrixStack.empty()) _matrixStack.push_back(osg::Matrixd()); _matrixStack.back().makeIdentity(); @@ -67,7 +67,7 @@ void SceneGraphBuilder::glLoadIdentity() matrixChanged(); } -void SceneGraphBuilder::glLoadMatrixd(const GLdouble* m) +void SceneGraphBuilder::LoadMatrixd(const GLdouble* m) { if (_matrixStack.empty()) _matrixStack.push_back(osg::Matrixd()); _matrixStack.back().set(m); @@ -75,7 +75,7 @@ void SceneGraphBuilder::glLoadMatrixd(const GLdouble* m) matrixChanged(); } -void SceneGraphBuilder::glMultMatrixd(const GLdouble* m) +void SceneGraphBuilder::MultMatrixd(const GLdouble* m) { if (_matrixStack.empty()) _matrixStack.push_back(osg::Matrixd()); _matrixStack.back().preMult(osg::Matrixd(m)); @@ -83,7 +83,7 @@ void SceneGraphBuilder::glMultMatrixd(const GLdouble* m) matrixChanged(); } -void SceneGraphBuilder::glTranslated(GLdouble x, GLdouble y, GLdouble z) +void SceneGraphBuilder::Translated(GLdouble x, GLdouble y, GLdouble z) { if (_matrixStack.empty()) _matrixStack.push_back(osg::Matrixd()); _matrixStack.back().preMult(osg::Matrixd::translate(x,y,z)); @@ -91,7 +91,7 @@ void SceneGraphBuilder::glTranslated(GLdouble x, GLdouble y, GLdouble z) matrixChanged(); } -void SceneGraphBuilder::glScaled(GLdouble x, GLdouble y, GLdouble z) +void SceneGraphBuilder::Scaled(GLdouble x, GLdouble y, GLdouble z) { if (_matrixStack.empty()) _matrixStack.push_back(osg::Matrixd()); _matrixStack.back().preMult(osg::Matrixd::scale(x,y,z)); @@ -99,7 +99,7 @@ void SceneGraphBuilder::glScaled(GLdouble x, GLdouble y, GLdouble z) matrixChanged(); } -void SceneGraphBuilder::glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z) +void SceneGraphBuilder::Rotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z) { if (_matrixStack.empty()) _matrixStack.push_back(osg::Matrixd()); _matrixStack.back().preMult(osg::Matrixd::rotate(osg::inDegrees(angle),x,y,z)); @@ -107,107 +107,107 @@ void SceneGraphBuilder::glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdoub matrixChanged(); } -void SceneGraphBuilder::glBlendFunc(GLenum srcFactor, GLenum dstFactor) +void SceneGraphBuilder::BlendFunc(GLenum srcFactor, GLenum dstFactor) { addAttribute(new osg::BlendFunc(srcFactor, dstFactor)); } -void SceneGraphBuilder::glCullFace(GLenum mode) +void SceneGraphBuilder::CullFace(GLenum mode) { addAttribute(new osg::CullFace(osg::CullFace::Mode(mode))); } -void SceneGraphBuilder::glDepthFunc(GLenum mode) +void SceneGraphBuilder::DepthFunc(GLenum mode) { addAttribute(new osg::Depth(osg::Depth::Function(mode))); } -void SceneGraphBuilder::glFrontFace(GLenum mode) +void SceneGraphBuilder::FrontFace(GLenum mode) { addAttribute(new osg::FrontFace(osg::FrontFace::Mode(mode))); } -void SceneGraphBuilder::glLineStipple(GLint factor, GLushort pattern) +void SceneGraphBuilder::LineStipple(GLint factor, GLushort pattern) { addAttribute(new osg::LineStipple(factor, pattern)); } -void SceneGraphBuilder::glLineWidth(GLfloat lineWidth) +void SceneGraphBuilder::LineWidth(GLfloat lineWidth) { addAttribute(new osg::LineWidth(lineWidth)); } -void SceneGraphBuilder::glPointSize(GLfloat pointSize) +void SceneGraphBuilder::PointSize(GLfloat pointSize) { addAttribute(new osg::Point(pointSize)); } -void SceneGraphBuilder::glPolygonMode(GLenum face, GLenum mode) +void SceneGraphBuilder::PolygonMode(GLenum face, GLenum mode) { addAttribute(new osg::PolygonMode(osg::PolygonMode::Face(face),osg::PolygonMode::Mode(mode))); } -void SceneGraphBuilder::glPolygonOffset(GLfloat factor, GLfloat units) +void SceneGraphBuilder::PolygonOffset(GLfloat factor, GLfloat units) { addAttribute(new osg::PolygonOffset(factor,units)); } -void SceneGraphBuilder::glPolygonStipple(const GLubyte* mask) +void SceneGraphBuilder::PolygonStipple(const GLubyte* mask) { addAttribute(new osg::PolygonStipple(mask)); } -void SceneGraphBuilder::glShadeModel(GLenum mode) +void SceneGraphBuilder::ShadeModel(GLenum mode) { addAttribute(new osg::ShadeModel(osg::ShadeModel::Mode(mode))); } -void SceneGraphBuilder::glEnable(GLenum mode) +void SceneGraphBuilder::Enable(GLenum mode) { addMode(mode, true); } -void SceneGraphBuilder::glDisable(GLenum mode) +void SceneGraphBuilder::Disable(GLenum mode) { addMode(mode, false); } -void SceneGraphBuilder::glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) +void SceneGraphBuilder::Color4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) { _normalSet = true; _color.set(red,green,blue,alpha); } -void SceneGraphBuilder::glNormal3f(GLfloat x, GLfloat y, GLfloat z) +void SceneGraphBuilder::Normal3f(GLfloat x, GLfloat y, GLfloat z) { _normalSet = true; _normal.set(x,y,z); } -void SceneGraphBuilder::glTexCoord1f(GLfloat x) +void SceneGraphBuilder::TexCoord1f(GLfloat x) { _maxNumTexCoordComponents = 1; _texCoord.set(x,0.0f,0.0f,1.0f); } -void SceneGraphBuilder::glTexCoord2f(GLfloat x, GLfloat y) +void SceneGraphBuilder::TexCoord2f(GLfloat x, GLfloat y) { _maxNumTexCoordComponents = 2; _texCoord.set(x,y,0.0f,1.0f); } -void SceneGraphBuilder::glTexCoord3f(GLfloat x, GLfloat y, GLfloat z) +void SceneGraphBuilder::TexCoord3f(GLfloat x, GLfloat y, GLfloat z) { _maxNumTexCoordComponents = 3; _texCoord.set(x,y,z,1.0); } -void SceneGraphBuilder::glTexCoord4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) +void SceneGraphBuilder::TexCoord4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) { _maxNumTexCoordComponents = 4; _texCoord.set(x,y,z,w); } -void SceneGraphBuilder::glVertex3f(GLfloat x, GLfloat y, GLfloat z) +void SceneGraphBuilder::Vertex3f(GLfloat x, GLfloat y, GLfloat z) { osg::Vec3 vertex(x,y,z); @@ -219,7 +219,7 @@ void SceneGraphBuilder::glVertex3f(GLfloat x, GLfloat y, GLfloat z) if (_texCoords.valid()) _texCoords->push_back(_texCoord); } -void SceneGraphBuilder::glBegin(GLenum mode) +void SceneGraphBuilder::Begin(GLenum mode) { // reset geometry _primitiveMode = mode; @@ -236,7 +236,7 @@ void SceneGraphBuilder::glBegin(GLenum mode) } -void SceneGraphBuilder::glEnd() +void SceneGraphBuilder::End() { allocateGeometry(); @@ -316,114 +316,114 @@ void SceneGraphBuilder::glEnd() // // GLU style building methods // -void SceneGraphBuilder::gluQuadricDrawStyle(GLenum aDrawStyle) +void SceneGraphBuilder::QuadricDrawStyle(GLenum aDrawStyle) { _quadricState._drawStyle = aDrawStyle; } -void SceneGraphBuilder::gluQuadricNormals(GLenum aNormals) +void SceneGraphBuilder::QuadricNormals(GLenum aNormals) { _quadricState._normals = aNormals; } -void SceneGraphBuilder::gluQuadricOrientation(GLenum aOrientation) +void SceneGraphBuilder::QuadricOrientation(GLenum aOrientation) { _quadricState._orientation = aOrientation; } -void SceneGraphBuilder::gluQuadricTexture(GLboolean aTexture) +void SceneGraphBuilder::QuadricTexture(GLboolean aTexture) { _quadricState._texture = aTexture; } -void SceneGraphBuilder::gluCylinder(GLfloat aBase, +void SceneGraphBuilder::Cylinder(GLfloat aBase, GLfloat aTop, GLfloat aHeight, GLint aSlices, GLint aStacks) { - osg::notify(osg::NOTICE)<<"SceneGraphBuilder::gluCylinder("<