Skip to content

Commit

Permalink
Trade: add TextureType::Texture1DArray, Texture2DArray and CubeMapArray.
Browse files Browse the repository at this point in the history
  • Loading branch information
mosra committed Jul 24, 2021
1 parent 046b955 commit 4c4b259
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
5 changes: 5 additions & 0 deletions doc/changelog.dox
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,11 @@ See also:
@ref Trade::PhongMaterialData::commonTextureCoordinates() exposing a
common texture coordinate set as a complement to a per-texture property
added in 2020.06
- Added @ref Trade::TextureType::Texture1DArray,
@relativeref{Trade::TextureType,Texture2DArray} and
@relativeref{Trade::TextureType,CubeMapArray} in order to be able to
distinguish what's the intended texture use, e.g. whether it's a 3D texture
with filtering along Z or if it's a 2D array with discrete slices.
- @ref magnum-imageconverter "magnum-imageconverter" has a new `--in-place`
option for converting images in-place

Expand Down
3 changes: 3 additions & 0 deletions src/Magnum/Trade/TextureData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ Debug& operator<<(Debug& debug, const TextureType value) {
/* LCOV_EXCL_START */
#define _c(value) case TextureType::value: return debug << "::" #value;
_c(Texture1D)
_c(Texture1DArray)
_c(Texture2D)
_c(Texture2DArray)
_c(Texture3D)
_c(CubeMap)
_c(CubeMapArray)
#undef _c
/* LCOV_EXCL_STOP */
}
Expand Down
23 changes: 23 additions & 0 deletions src/Magnum/Trade/TextureData.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,26 @@ enum class TextureType: UnsignedByte {
*/
Texture1D,

/**
* One-dimensional texture array. The @ref TextureData::image() ID
* corresponds to an image from @ref AbstractImporter::image2D().
* @m_since_latest
*/
Texture1DArray,

/**
* Two-dimensional texture. The @ref TextureData::image() ID corresponds to
* an image from @ref AbstractImporter::image2D().
*/
Texture2D,

/**
* Two-dimensional texture array. The @ref TextureData::image() ID
* corresponds to an image from @ref AbstractImporter::image3D().
* @m_since_latest
*/
Texture2DArray,

/**
* Three-dimensional texture. The @ref TextureData::image() ID corresponds
* to an image from @ref AbstractImporter::image3D().
Expand All @@ -73,6 +87,15 @@ enum class TextureType: UnsignedByte {
*/
CubeMap,

/**
* Cube map texture array. The @ref TextureData::image() ID
* corresponds to an image from @ref AbstractImporter::image3D(), which is
* assumed to have the layer count divisible by 6, each set in order +X,
* -X, +Y, -Y, +Z, -Z.
* @m_since_latest
*/
CubeMapArray,

#ifdef MAGNUM_BUILD_DEPRECATED
/**
* Cube map texture.
Expand Down

0 comments on commit 4c4b259

Please sign in to comment.