From 45c6bbb5777b13d12100e56301c344be27754478 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 15 Feb 2008 14:09:44 +0000 Subject: [PATCH] Changed constructors to take const pointers --- include/osg/PrimitiveSet | 20 ++++++++++---------- src/osgWrappers/osg/PrimitiveSet.cpp | 24 ++++++++++++------------ 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/include/osg/PrimitiveSet b/include/osg/PrimitiveSet index a103a0400..60e6bc0df 100644 --- a/include/osg/PrimitiveSet +++ b/include/osg/PrimitiveSet @@ -58,7 +58,7 @@ class VectorGLubyte: public std::vector public: VectorGLubyte(): vector_type() {} VectorGLubyte(const VectorGLubyte ©): vector_type(copy) {} - VectorGLubyte(GLubyte* beg, GLubyte* end): vector_type(beg, end) {} + VectorGLubyte(const GLubyte* beg, const GLubyte* end): vector_type(beg, end) {} explicit VectorGLubyte(unsigned int n): vector_type(n) {} }; @@ -68,7 +68,7 @@ class VectorGLushort: public std::vector public: VectorGLushort(): vector_type() {} VectorGLushort(const VectorGLushort ©): vector_type(copy) {} - VectorGLushort(GLushort* beg, GLushort* end): vector_type(beg, end) {} + VectorGLushort(const GLushort* beg, const GLushort* end): vector_type(beg, end) {} explicit VectorGLushort(unsigned int n): vector_type(n) {} }; @@ -78,7 +78,7 @@ class VectorGLuint: public std::vector public: VectorGLuint(): vector_type() {} VectorGLuint(const VectorGLuint ©): vector_type(copy) {} - VectorGLuint(GLuint* beg, GLuint* end): vector_type(beg, end) {} + VectorGLuint(const GLuint* beg, const GLuint* end): vector_type(beg, end) {} explicit VectorGLuint(unsigned int n): vector_type(n) {} }; @@ -516,15 +516,15 @@ class OSG_EXPORT DrawElementsUByte : public DrawElements, public VectorGLubyte DrawElementsUByte(GLenum mode=0): DrawElements(DrawElementsUBytePrimitiveType,mode) {} - DrawElementsUByte(const DrawElementsUByte& array,const CopyOp& copyop=CopyOp::SHALLOW_COPY): + DrawElementsUByte(const DrawElementsUByte& array, const CopyOp& copyop=CopyOp::SHALLOW_COPY): DrawElements(array,copyop), vector_type(array) {} - DrawElementsUByte(GLenum mode,unsigned int no,GLubyte* ptr) : + DrawElementsUByte(GLenum mode, unsigned int no, const GLubyte* ptr) : DrawElements(DrawElementsUBytePrimitiveType,mode), vector_type(ptr,ptr+no) {} - DrawElementsUByte(GLenum mode,unsigned int no) : + DrawElementsUByte(GLenum mode, unsigned int no) : DrawElements(DrawElementsUBytePrimitiveType,mode), vector_type(no) {} @@ -590,11 +590,11 @@ class OSG_EXPORT DrawElementsUShort : public DrawElements, public VectorGLushort DrawElements(array,copyop), vector_type(array) {} - DrawElementsUShort(GLenum mode,unsigned int no,GLushort* ptr) : + DrawElementsUShort(GLenum mode, unsigned int no, const GLushort* ptr) : DrawElements(DrawElementsUShortPrimitiveType,mode), vector_type(ptr,ptr+no) {} - DrawElementsUShort(GLenum mode,unsigned int no) : + DrawElementsUShort(GLenum mode, unsigned int no) : DrawElements(DrawElementsUShortPrimitiveType,mode), vector_type(no) {} @@ -664,11 +664,11 @@ class OSG_EXPORT DrawElementsUInt : public DrawElements, public VectorGLuint DrawElements(array,copyop), vector_type(array) {} - DrawElementsUInt(GLenum mode,unsigned int no,GLuint* ptr) : + DrawElementsUInt(GLenum mode, unsigned int no, const GLuint* ptr) : DrawElements(DrawElementsUIntPrimitiveType,mode), vector_type(ptr,ptr+no) {} - DrawElementsUInt(GLenum mode,unsigned int no) : + DrawElementsUInt(GLenum mode, unsigned int no) : DrawElements(DrawElementsUIntPrimitiveType,mode), vector_type(no) {} diff --git a/src/osgWrappers/osg/PrimitiveSet.cpp b/src/osgWrappers/osg/PrimitiveSet.cpp index f09fa2f93..6598e7e53 100644 --- a/src/osgWrappers/osg/PrimitiveSet.cpp +++ b/src/osgWrappers/osg/PrimitiveSet.cpp @@ -323,8 +323,8 @@ BEGIN_OBJECT_REFLECTOR(osg::DrawElementsUByte) ____DrawElementsUByte__C5_DrawElementsUByte_R1__C5_CopyOp_R1, "", ""); - I_Constructor3(IN, GLenum, mode, IN, unsigned int, no, IN, GLubyte *, ptr, - ____DrawElementsUByte__GLenum__unsigned_int__GLubyte_P1, + I_Constructor3(IN, GLenum, mode, IN, unsigned int, no, IN, const GLubyte *, ptr, + ____DrawElementsUByte__GLenum__unsigned_int__C5_GLubyte_P1, "", ""); I_Constructor2(IN, GLenum, mode, IN, unsigned int, no, @@ -429,8 +429,8 @@ BEGIN_OBJECT_REFLECTOR(osg::DrawElementsUInt) ____DrawElementsUInt__C5_DrawElementsUInt_R1__C5_CopyOp_R1, "", ""); - I_Constructor3(IN, GLenum, mode, IN, unsigned int, no, IN, GLuint *, ptr, - ____DrawElementsUInt__GLenum__unsigned_int__GLuint_P1, + I_Constructor3(IN, GLenum, mode, IN, unsigned int, no, IN, const GLuint *, ptr, + ____DrawElementsUInt__GLenum__unsigned_int__C5_GLuint_P1, "", ""); I_Constructor2(IN, GLenum, mode, IN, unsigned int, no, @@ -535,8 +535,8 @@ BEGIN_OBJECT_REFLECTOR(osg::DrawElementsUShort) ____DrawElementsUShort__C5_DrawElementsUShort_R1__C5_CopyOp_R1, "", ""); - I_Constructor3(IN, GLenum, mode, IN, unsigned int, no, IN, GLushort *, ptr, - ____DrawElementsUShort__GLenum__unsigned_int__GLushort_P1, + I_Constructor3(IN, GLenum, mode, IN, unsigned int, no, IN, const GLushort *, ptr, + ____DrawElementsUShort__GLenum__unsigned_int__C5_GLushort_P1, "", ""); I_Constructor2(IN, GLenum, mode, IN, unsigned int, no, @@ -1003,8 +1003,8 @@ BEGIN_OBJECT_REFLECTOR(osg::VectorGLubyte) ____VectorGLubyte__C5_VectorGLubyte_R1, "", ""); - I_Constructor2(IN, GLubyte *, beg, IN, GLubyte *, end, - ____VectorGLubyte__GLubyte_P1__GLubyte_P1, + I_Constructor2(IN, const GLubyte *, beg, IN, const GLubyte *, end, + ____VectorGLubyte__C5_GLubyte_P1__C5_GLubyte_P1, "", ""); I_Constructor1(IN, unsigned int, n, @@ -1025,8 +1025,8 @@ BEGIN_OBJECT_REFLECTOR(osg::VectorGLuint) ____VectorGLuint__C5_VectorGLuint_R1, "", ""); - I_Constructor2(IN, GLuint *, beg, IN, GLuint *, end, - ____VectorGLuint__GLuint_P1__GLuint_P1, + I_Constructor2(IN, const GLuint *, beg, IN, const GLuint *, end, + ____VectorGLuint__C5_GLuint_P1__C5_GLuint_P1, "", ""); I_Constructor1(IN, unsigned int, n, @@ -1047,8 +1047,8 @@ BEGIN_OBJECT_REFLECTOR(osg::VectorGLushort) ____VectorGLushort__C5_VectorGLushort_R1, "", ""); - I_Constructor2(IN, GLushort *, beg, IN, GLushort *, end, - ____VectorGLushort__GLushort_P1__GLushort_P1, + I_Constructor2(IN, const GLushort *, beg, IN, const GLushort *, end, + ____VectorGLushort__C5_GLushort_P1__C5_GLushort_P1, "", ""); I_Constructor1(IN, unsigned int, n,