From 6c12c71337e61dcda6b213bdde71baee1f87da2f Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 5 Apr 2007 16:12:10 +0000 Subject: [PATCH] Added constructor argument to ShadeModel --- include/osg/ShadeModel | 12 ++++++------ src/osg/ShadeModel.cpp | 4 ++-- src/osgWrappers/osg/BufferObject.cpp | 9 ++++----- src/osgWrappers/osg/ShadeModel.cpp | 8 +++++--- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/include/osg/ShadeModel b/include/osg/ShadeModel index 2807ea6b6..31f431f71 100644 --- a/include/osg/ShadeModel +++ b/include/osg/ShadeModel @@ -25,7 +25,12 @@ class OSG_EXPORT ShadeModel : public StateAttribute { public : - ShadeModel(); + enum Mode { + FLAT = GL_FLAT, + SMOOTH = GL_SMOOTH + }; + + ShadeModel(Mode mode=FLAT); /** Copy constructor using CopyOp to manage deep vs shallow copy.*/ ShadeModel(const ShadeModel& sm,const CopyOp& copyop=CopyOp::SHALLOW_COPY): @@ -48,11 +53,6 @@ class OSG_EXPORT ShadeModel : public StateAttribute return 0; // passed all the above comparison macros, must be equal. } - enum Mode { - FLAT = GL_FLAT, - SMOOTH = GL_SMOOTH - }; - inline void setMode(Mode mode) { _mode = mode; } inline Mode getMode() const { return _mode; } diff --git a/src/osg/ShadeModel.cpp b/src/osg/ShadeModel.cpp index de6751d89..71bcc6926 100644 --- a/src/osg/ShadeModel.cpp +++ b/src/osg/ShadeModel.cpp @@ -15,9 +15,9 @@ using namespace osg; -ShadeModel::ShadeModel() +ShadeModel::ShadeModel(Mode mode): + _mode(mode) { - _mode = SMOOTH; } diff --git a/src/osgWrappers/osg/BufferObject.cpp b/src/osgWrappers/osg/BufferObject.cpp index e785752ee..540cf2226 100644 --- a/src/osgWrappers/osg/BufferObject.cpp +++ b/src/osgWrappers/osg/BufferObject.cpp @@ -88,15 +88,14 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::BufferObject) __void__releaseBuffer__State_P1, "", ""); - I_Method3(void, flushDeletedBufferObjects, IN, unsigned int, contextID, IN, double, x, IN, double &, availableTime, - Properties::NON_VIRTUAL, - __void__flushDeletedBufferObjects__unsigned_int__double__double_R1, - "flush all the cached display list which need to be deleted in the OpenGL context related to contextID. ", - ""); I_StaticMethod2(void, deleteBufferObject, IN, unsigned int, contextID, IN, GLuint, globj, __void__deleteBufferObject__unsigned_int__GLuint_S, "Use deleteVertexBufferObject instead of glDeleteBuffers to allow OpenGL buffer objects to be cached until they can be deleted by the OpenGL context in which they were created, specified by contextID. ", ""); + I_StaticMethod3(void, flushDeletedBufferObjects, IN, unsigned int, contextID, IN, double, x, IN, double &, availableTime, + __void__flushDeletedBufferObjects__unsigned_int__double__double_R1_S, + "flush all the cached display list which need to be deleted in the OpenGL context related to contextID. ", + ""); I_StaticMethod2(osg::BufferObject::Extensions *, getExtensions, IN, unsigned int, contextID, IN, bool, createIfNotInitalized, __Extensions_P1__getExtensions__unsigned_int__bool_S, "Function to call to get the extension of a specified context. ", diff --git a/src/osgWrappers/osg/ShadeModel.cpp b/src/osgWrappers/osg/ShadeModel.cpp index e3bdd8d73..461716516 100644 --- a/src/osgWrappers/osg/ShadeModel.cpp +++ b/src/osgWrappers/osg/ShadeModel.cpp @@ -31,9 +31,11 @@ END_REFLECTOR BEGIN_OBJECT_REFLECTOR(osg::ShadeModel) I_BaseType(osg::StateAttribute); - I_Constructor0(____ShadeModel, - "", - ""); + I_ConstructorWithDefaults1(IN, osg::ShadeModel::Mode, mode, osg::ShadeModel::FLAT, + Properties::NON_EXPLICIT, + ____ShadeModel__Mode, + "", + ""); I_ConstructorWithDefaults2(IN, const osg::ShadeModel &, sm, , IN, const osg::CopyOp &, copyop, osg::CopyOp::SHALLOW_COPY, ____ShadeModel__C5_ShadeModel_R1__C5_CopyOp_R1, "Copy constructor using CopyOp to manage deep vs shallow copy. ",