| 0.8.0 API documentation

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

texture_cube_array.hpp
Go to the documentation of this file.
1
4 #pragma once
5
6 #include "texture_cube.hpp"
7
8 namespace gli
9 {
11 class texture_cube_array : public texture
12 {
13 public:
14 typedef extent2d extent_type;
15
16 public:
18 texture_cube_array();
19
21 explicit texture_cube_array(
22 format_type Format,
23 extent_type const& Extent,
24 size_type Layers,
25 size_type Levels,
26 swizzles_type const& Swizzles = swizzles_type(SWIZZLE_RED, SWIZZLE_GREEN, SWIZZLE_BLUE, SWIZZLE_ALPHA));
27
29 explicit texture_cube_array(
30 format_type Format,
31 extent_type const& Extent,
32 size_type Layers,
33 swizzles_type const& Swizzles = swizzles_type(SWIZZLE_RED, SWIZZLE_GREEN, SWIZZLE_BLUE, SWIZZLE_ALPHA));
34
36 explicit texture_cube_array(
37 texture const& Texture);
38
40 explicit texture_cube_array(
41 texture const& Texture,
42 format_type Format,
43 size_type BaseLayer, size_type MaxLayer,
44 size_type BaseFace, size_type MaxFace,
45 size_type BaseLevel, size_type MaxLevel,
46 swizzles_type const& Swizzles = swizzles_type(SWIZZLE_RED, SWIZZLE_GREEN, SWIZZLE_BLUE, SWIZZLE_ALPHA));
47
49 explicit texture_cube_array(
50 texture_cube_array const& Texture,
51 size_type BaseLayer, size_type MaxLayer,
52 size_type BaseFace, size_type MaxFace,
53 size_type BaseLevel, size_type MaxLevel);
54
56 texture_cube operator[](size_type Layer) const;
57
59 extent_type extent(size_type Level = 0) const;
60
62 template <typename genType>
63 genType load(extent_type const & TexelCoord, size_type Layer, texture_cube_array::size_type Face, size_type Level) const;
64
66 template <typename genType>
67 void store(extent_type const & TexelCoord, size_type Layer, size_type Face, size_type Level, genType const & Texel);
68
70 void clear();
71
74 template <typename genType>
75 void clear(genType const & Texel);
76
78 template <typename genType>
79 void clear(size_type Layer, size_type Face, size_type Level, genType const & Texel);
80
81 private:
82 struct cache
83 {
84 std::uint8_t* Data;
85 extent_type Extent;
86 # ifndef NDEBUG
87 size_type Size;
88 # endif
89 };
90
91 void build_cache();
92 size_type index_cache(size_type Layer, size_type Face, size_type Level) const;
93
94 std::vector<cache> Caches;
95 };
96 }//namespace gli
97
98 #include "./core/texture_cube_array.inl"
99
gli::texture_cube_array::clear
void clear()
Clear the entire texture storage with zeros.
gli::texture
Genetic texture class. It can support any target.
Definition: texture.hpp:12
gli::texture_cube_array::texture_cube_array
texture_cube_array()
Create an empty texture cube array.
gli
Namespace where all the classes and functions provided by GLI are exposed.
Definition: comparison.hpp:15
gli::texture_cube_array::extent
extent_type extent(size_type Level=0) const
Return the dimensions of a texture instance: width and height where both should be equal...
gli::texture_cube_array
Cube map array texture.
Definition: texture_cube_array.hpp:11
gli::format
format
Texture data format.
Definition: format.hpp:12
gli::texture_cube_array::load
genType load(extent_type const &TexelCoord, size_type Layer, texture_cube_array::size_type Face, size_type Level) const
Fetch a texel from a texture. The texture format must be uncompressed.
gli::texture_cube_array::operator[]
texture_cube operator[](size_type Layer) const
Create a view of the texture identified by Layer in the texture array.
gli::texture_cube
Cube map texture.
Definition: texture_cube.hpp:11
gli::texture_cube_array::store
void store(extent_type const &TexelCoord, size_type Layer, size_type Face, size_type Level, genType const &Texel)
Write a texel to a texture. The texture format must be uncompressed.
texture_cube.hpp
Include to use cube map textures.