From 899a704eb7712d3a2715cb9a768408751019b4c9 Mon Sep 17 00:00:00 2001 From: Julien Valentin Date: Sat, 5 Aug 2017 18:03:27 +0200 Subject: [PATCH] update IndirectCommandArrays interfaces and default impl to use DrawElements like semantic --- include/osg/PrimitiveSetIndirect | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/include/osg/PrimitiveSetIndirect b/include/osg/PrimitiveSetIndirect index 96a7c070f..2ce5c1d8d 100644 --- a/include/osg/PrimitiveSetIndirect +++ b/include/osg/PrimitiveSetIndirect @@ -40,7 +40,8 @@ public: virtual unsigned int getElementSize() const = 0; virtual unsigned int getNumElements() const = 0; - virtual void resize(const unsigned int) = 0; + virtual void reserveElements(const unsigned int) = 0; + virtual void resizeElements(const unsigned int) = 0; }; class OSG_EXPORT IndirectCommandDrawElements: public BufferData @@ -61,7 +62,8 @@ public: virtual unsigned int getElementSize()const = 0; virtual unsigned int getNumElements() const = 0; - virtual void resize(const unsigned int) = 0; + virtual void reserveElements(const unsigned int) = 0; + virtual void resizeElements(const unsigned int) = 0; }; @@ -92,7 +94,8 @@ public: virtual const GLvoid* getDataPointer() const { return empty()?0:&front(); } virtual unsigned int getElementSize()const { return 16u; }; virtual unsigned int getNumElements() const { return static_cast(size()); } - virtual void resize(const unsigned int n) {resize(n);} + virtual void reserveElements(const unsigned int n) {reserve(n);} + virtual void resizeElements(const unsigned int n) {resize(n);} virtual unsigned int & count(const unsigned int&index) { return at(index).count; } virtual unsigned int & instanceCount(const unsigned int&index) { return at(index).instanceCount; } @@ -130,7 +133,8 @@ public: virtual const GLvoid* getDataPointer() const { return empty()?0:&front(); } virtual unsigned int getNumElements() const { return static_cast(size()); } virtual unsigned int getElementSize()const { return 20u; }; - virtual void resize(const unsigned int n) {resize(n);} + virtual void reserveElements(const unsigned int n) {reserve(n);} + virtual void resizeElements(const unsigned int n) {resize(n);} virtual unsigned int & count(const unsigned int&index) { return at(index).count; } virtual unsigned int & instanceCount(const unsigned int&index) { return at(index).instanceCount; }