add a virtual getBufferData to Texture

This commit is contained in:
Julien Valentin
2018-01-21 01:23:38 +01:00
parent 9cc2bab737
commit 0aa8008f0a
2 changed files with 6 additions and 3 deletions

View File

@@ -730,6 +730,8 @@ class OSG_EXPORT Texture : public osg::StateAttribute
void setShadowAmbient(float shadow_ambient) { _shadow_ambient = shadow_ambient; }
float getShadowAmbient() const { return _shadow_ambient; }
/** Gets the texture BufferData */
virtual const BufferData* getBufferData() const { return getImage(0); }
/** Sets the texture image for the specified face. */
virtual void setImage(unsigned int face, Image* image) = 0;
@@ -739,6 +741,7 @@ class OSG_EXPORT Texture : public osg::StateAttribute
/** Gets the texture image for the specified face. */
virtual Image* getImage(unsigned int face) = 0;
/** Gets the const texture image for specified face. */
virtual const Image* getImage(unsigned int face) const = 0;

View File

@@ -84,11 +84,11 @@ class OSG_EXPORT TextureBuffer : public Texture
/** Bind the texture buffer.*/
virtual void apply(State& state) const;
/** Set setBufferData attached */
/** Set BufferData attached */
void setBufferData(BufferData *bo);
/** Set setBufferData attached */
const BufferData * getBufferData()const {return _bufferData.get();}
/** Get BufferData attached */
virtual const BufferData * getBufferData() const { return _bufferData.get(); }
protected :
virtual ~TextureBuffer();