Browse Source

Fixed CubeMapTexture*::invalidateSubImage().

The coordinates are 3D, not 2D.
pull/7/head
Vladimír Vondruš 14 years ago
parent
commit
5c5efea168
  1. 20
      src/CubeMapTexture.h
  2. 18
      src/CubeMapTextureArray.h

20
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

18
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

Loading…
Cancel
Save