]> git.tdb.fi Git - libs/gl.git/blob - source/core/texture2dmultisample.h
Check the flat qualifier from the correct member
[libs/gl.git] / source / core / texture2dmultisample.h
1 #ifndef MSP_GL_TEXTURE2DMULTISAMPLE_H_
2 #define MSP_GL_TEXTURE2DMULTISAMPLE_H_
3
4 #include "texture2dmultisample_backend.h"
5
6 namespace Msp {
7 namespace GL {
8
9 /**
10 Two-dimensional multisample texture, consisting of a rectancular array of
11 texels with multiple samples each.
12
13 The contents of multisample textures can not be set through API.  Their primary
14 use is as Framebuffer attachments.
15
16 Multisample textures can't have mipmaps.
17 */
18 class Texture2DMultisample: public Texture2DMultisampleBackend
19 {
20         friend Texture2DMultisampleBackend;
21
22 private:
23         unsigned width = 0;
24         unsigned height = 0;
25         unsigned samples = 0;
26
27 public:
28         /** Sets storage dimensions, format and sample count and allocates memory
29         for the texture. */
30         void storage(PixelFormat, unsigned wd, unsigned ht, unsigned sm);
31
32         virtual void image(unsigned, const void *);
33         virtual void image(const Graphics::Image &, unsigned = 0);
34
35         unsigned get_width() const { return width; }
36         unsigned get_height() const { return height; }
37         unsigned get_samples() const { return samples; }
38 };
39
40 } // namespace GL
41 } // namespace Msp
42
43 #endif