Added a getModeUsage() method that prevents any mode being automatically associated with these Texture types that are only usable using non fixed function pipeline.

This commit is contained in:
Robert Osfield
2014-01-24 12:01:37 +00:00
parent f0df819cbf
commit 15f44c8736
2 changed files with 6 additions and 0 deletions

View File

@@ -42,6 +42,9 @@ class OSG_EXPORT Texture2DArray : public Texture
virtual GLenum getTextureTarget() const { return GL_TEXTURE_2D_ARRAY_EXT; }
/** Texture2DArray is related to non fixed pipeline usage only so isn't appropriate to enable/disable.*/
virtual bool getModeUsage(StateAttribute::ModeUsage&) const { return false; }
/** Set the texture image for specified layer. */
virtual void setImage(unsigned int layer, Image* image);

View File

@@ -47,6 +47,9 @@ class OSG_EXPORT Texture2DMultisample : public Texture
return GL_TEXTURE_2D_MULTISAMPLE;
}
/** Texture2DMultisample is related to non fixed pipeline usage only so isn't appropriate to enable/disable.*/
virtual bool getModeUsage(StateAttribute::ModeUsage&) const { return false; }
/** Sets the texture width and height. If width or height are zero,
* calculate the respective value from the source image size. */
inline void setTextureSize(int width, int height) const