]> git.tdb.fi Git - libs/gl.git/blob - source/core/texture2darray.h
Check the flat qualifier from the correct member
[libs/gl.git] / source / core / texture2darray.h
1 #ifndef MSP_GL_TEXTURE2DARRAY_H_
2 #define MSP_GL_TEXTURE2DARRAY_H_
3
4 #include "texture2darray_backend.h"
5
6 namespace Msp {
7 namespace GL {
8
9 /**
10 An array of two-dimensional textures.  It behaves much like a 3D texture, but
11 mipmapping and filtering is not applied on the third dimension.  When sampling
12 the texture, the third coordinate is not normalized and is rounded to the
13 nearest integer to select the layer.
14 */
15 class Texture2DArray: public Texture2DArrayBackend
16 {
17 public:
18         class Loader: public Msp::DataFile::DerivedObjectLoader<Texture2DArray, Texture3D::Loader>
19         {
20         public:
21                 Loader(Texture2DArray &);
22                 Loader(Texture2DArray &, Collection &);
23         private:
24                 void init();
25
26                 void external_image(unsigned, const std::string &);
27         };
28
29         /** Replaces contents of a single layer.  Allocated storage must exist.  The
30         image data is interpreted according to the storage format and must have
31         width and height matching the selected mipmap level. */
32         void layer_image(unsigned, unsigned, const void *);
33
34         void layer_image(unsigned, unsigned, const Graphics::Image &);
35
36         unsigned get_layers() const { return get_depth(); }
37 };
38
39 } // namespace GL
40 } // namespace Msp
41
42 #endif