diff --git a/src/Texture.h b/src/Texture.h index a1560f28c..f78098c17 100644 --- a/src/Texture.h +++ b/src/Texture.h @@ -63,7 +63,10 @@ template class Texture: public AbstractTexture { * * Creates one OpenGL texture. */ - inline Texture(GLint layer = 0, Target target = DataHelper::target()): AbstractTexture(layer, static_cast(target)), target(target) {} + inline Texture(GLint layer = 0, Target target = DataHelper::target()): AbstractTexture(layer, static_cast(target)), _target(target) {} + + /** @brief %Texture target */ + inline Target target() const { return _target; } /** * @brief Set wrapping @@ -75,7 +78,7 @@ template class Texture: public AbstractTexture { */ inline void setWrapping(const Math::Vector& wrapping) { bind(); - DataHelper::setWrapping(target, wrapping); + DataHelper::setWrapping(_target, wrapping); } /** @@ -91,7 +94,7 @@ template class Texture: public AbstractTexture { */ template inline void setData(GLint mipLevel, InternalFormat internalFormat, const Math::Vector& _dimensions, ColorFormat colorFormat, const T* data) { bind(); - DataHelper::set(target, mipLevel, internalFormat, _dimensions, colorFormat, TypeTraits::TextureType>::glType(), data); + DataHelper::set(_target, mipLevel, internalFormat, _dimensions, colorFormat, TypeTraits::TextureType>::glType(), data); } /** @@ -106,7 +109,7 @@ template class Texture: public AbstractTexture { */ template inline void setData(GLint mipLevel, InternalFormat internalFormat, T* image) { bind(); - DataHelper::set(target, mipLevel, internalFormat, image); + DataHelper::set(_target, mipLevel, internalFormat, image); } /** @@ -123,7 +126,7 @@ template class Texture: public AbstractTexture { */ template inline void setSubData(GLint mipLevel, const Math::Vector& offset, const Math::Vector& _dimensions, ColorFormat colorFormat, const T* data) { bind(); - DataHelper::setSub(target, mipLevel, offset, _dimensions, colorFormat, TypeTraits::TextureType>::glType(), data); + DataHelper::setSub(_target, mipLevel, offset, _dimensions, colorFormat, TypeTraits::TextureType>::glType(), data); } /** @@ -138,11 +141,11 @@ template class Texture: public AbstractTexture { */ template inline void setSubData(GLint mipLevel, const Math::Vector& offset, T* image) { bind(); - DataHelper::setSub(target, mipLevel, offset, image); + DataHelper::setSub(_target, mipLevel, offset, image); } private: - Target target; + Target _target; }; /** @brief One-dimensional texture */