diff --git a/include/osg/Primitive b/include/osg/Primitive index ae5c2e807..2ee31b2e4 100644 --- a/include/osg/Primitive +++ b/include/osg/Primitive @@ -9,6 +9,63 @@ namespace osg { +#ifndef _MSC_VER + +typedef std::vector VectorSizei; +typedef std::vector VectorUByte; +typedef std::vector VectorUShort; +typedef std::vector VectorUInt; + +#else // _MSC_VER + +// work arounds for MS linker problems. +class VectorSizei: public std::vector { + typedef std::vector inherited; +public: + VectorSizei(): inherited() {} + explicit VectorSizei(size_type n): inherited(n) {} + VectorSizei(const VectorSizei ©): inherited(copy) {} + VectorSizei(value_type *beg_, value_type *end_): inherited(beg_, end_) {} + template + VectorSizei(InputIterator beg_, InputIterator end_): inherited(beg_, end_) {} +}; + +class VectorUByte: public std::vector { + typedef std::vector inherited; +public: + VectorUByte(): inherited() {} + explicit VectorUByte(size_type n): inherited(n) {} + VectorUByte(const VectorUByte ©): inherited(copy) {} + VectorUByte(value_type *beg_, value_type *end_): inherited(beg_, end_) {} + template + VectorUByte(InputIterator beg_, InputIterator end_): inherited(beg_, end_) {} +}; + +class VectorUShort: public std::vector { + typedef std::vector inherited; +public: + VectorUShort(): inherited() {} + explicit VectorUShort(size_type n): inherited(n) {} + VectorUShort(const VectorUShort ©): inherited(copy) {} + VectorUShort(value_type *beg_, value_type *end_): inherited(beg_, end_) {} + template + VectorUShort(InputIterator beg_, InputIterator end_): inherited(beg_, end_) {} +}; + +class VectorUInt: public std::vector { + typedef std::vector inherited; +public: + VectorUInt(): inherited() {} + explicit VectorUInt(size_type n): inherited(n) {} + VectorUInt(const VectorUInt ©): inherited(copy) {} + VectorUInt(value_type *beg_, value_type *end_): inherited(beg_, end_) {} + template + VectorUInt(InputIterator beg_, InputIterator end_): inherited(beg_, end_) {} +}; + +#endif + + class Primitive : public Object { public: @@ -114,7 +171,6 @@ class SG_EXPORT DrawArrays : public Primitive GLsizei _count; }; -typedef std::vector VectorSizei; class SG_EXPORT DrawArrayLengths : public Primitive, public VectorSizei { public: @@ -163,7 +219,6 @@ class SG_EXPORT DrawArrayLengths : public Primitive, public VectorSizei GLint _first; }; -typedef std::vector VectorUByte; class SG_EXPORT DrawElementsUByte : public Primitive, public VectorUByte { public: @@ -200,7 +255,6 @@ class SG_EXPORT DrawElementsUByte : public Primitive, public VectorUByte }; -typedef std::vector VectorUShort; class SG_EXPORT DrawElementsUShort : public Primitive, public VectorUShort { public: @@ -236,7 +290,6 @@ class SG_EXPORT DrawElementsUShort : public Primitive, public VectorUShort virtual void applyPrimitiveOperation(Drawable::PrimitiveFunctor& functor); }; -typedef std::vector VectorUInt; class SG_EXPORT DrawElementsUInt : public Primitive, public VectorUInt { public: diff --git a/src/osg/StateSet.cpp b/src/osg/StateSet.cpp index 7ec648210..f88233a10 100644 --- a/src/osg/StateSet.cpp +++ b/src/osg/StateSet.cpp @@ -522,7 +522,7 @@ const StateAttribute::GLModeValue StateSet::getTextureMode(unsigned int unit,con return StateAttribute::INHERIT; } -void StateSet::setTextureAttribute(unsigned int unit,StateAttribute *attribute, const StateAttribute::OverrideValue value=StateAttribute::OFF) +void StateSet::setTextureAttribute(unsigned int unit,StateAttribute *attribute, const StateAttribute::OverrideValue value) { if (attribute) { @@ -533,7 +533,7 @@ void StateSet::setTextureAttribute(unsigned int unit,StateAttribute *attribute, } -void StateSet::setTextureAttributeAndModes(unsigned int unit,StateAttribute *attribute, const StateAttribute::GLModeValue value=StateAttribute::ON) +void StateSet::setTextureAttributeAndModes(unsigned int unit,StateAttribute *attribute, const StateAttribute::GLModeValue value) { if (attribute) {