From 5c5efea16856221ded2ad09d9ed4971e43b6e6bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 12 Jan 2013 14:51:56 +0100 Subject: [PATCH] Fixed CubeMapTexture*::invalidateSubImage(). The coordinates are 3D, not 2D. --- src/CubeMapTexture.h | 20 +++++++++++++++++--- src/CubeMapTextureArray.h | 18 +++++++++++++++--- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/src/CubeMapTexture.h b/src/CubeMapTexture.h index ae3d7a51b..b9dacaa8d 100644 --- a/src/CubeMapTexture.h +++ b/src/CubeMapTexture.h @@ -127,10 +127,24 @@ class CubeMapTexture: public AbstractTexture { return this; } - /** @copydoc Texture::invalidateSubImage() */ - inline void invalidateSubImage(GLint level, const Vector2i& offset, const Vector2i& size) { - DataHelper<2>::invalidateSub(this, level, offset, size); + #ifndef MAGNUM_TARGET_GLES + /** + * @brief Invalidate texture subimage + * @param level Mip level + * @param offset Offset into the texture + * @param size Size of invalidated data + * + * Z coordinate is equivalent to number of texture face, i.e. + * @ref Coordinate "Coordinate::PositiveX" is `0` and so on, in the + * same order as in the enum. + * @see invalidateImage(), @fn_gl{InvalidateTexSubImage} + * @requires_gl43 %Extension @extension{ARB,invalidate_subdata} + * @requires_gl Texture image invalidation is not available in OpenGL ES. + */ + inline void invalidateSubImage(GLint level, const Vector3i& offset, const Vector3i& size) { + DataHelper<3>::invalidateSub(this, level, offset, size); } + #endif /* Overloads to remove WTF-factor from method chaining order */ #ifndef DOXYGEN_GENERATING_OUTPUT diff --git a/src/CubeMapTextureArray.h b/src/CubeMapTextureArray.h index 480b3dbd1..80e42a171 100644 --- a/src/CubeMapTextureArray.h +++ b/src/CubeMapTextureArray.h @@ -152,9 +152,21 @@ class CubeMapTextureArray: public AbstractTexture { } #ifndef MAGNUM_TARGET_GLES - /** @copydoc Texture::invalidateSubImage() */ - inline void invalidateSubImage(GLint level, const Vector2i& offset, const Vector2i& size) { - DataHelper<2>::invalidateSub(this, level, offset, size); + /** + * @brief Invalidate texture subimage + * @param level Mip level + * @param offset Offset into the texture + * @param size Size of invalidated data + * + * Z coordinate is equivalent to layer * 6 + number of texture face, + * i.e. @ref Coordinate "Coordinate::PositiveX" is `0` and so on, in + * the same order as in the enum. + * @see invalidateImage(), @fn_gl{InvalidateTexSubImage} + * @requires_gl43 %Extension @extension{ARB,invalidate_subdata} + * @requires_gl Texture image invalidation is not available in OpenGL ES. + */ + inline void invalidateSubImage(GLint level, const Vector3i& offset, const Vector3i& size) { + DataHelper<3>::invalidateSub(this, level, offset, size); } #endif