]> git.tdb.fi Git - libs/gl.git/blob - source/texture1d.h
Add basic support for 1D textures
[libs/gl.git] / source / texture1d.h
1 #ifndef MSP_GL_TEXTURE1D_H_
2 #define MSP_GL_TEXTURE1D_H_
3
4 #include "datatype.h"
5 #include "pixelformat.h"
6 #include "texture.h"
7
8 namespace Msp {
9 namespace GL {
10
11 class Texture1D: public Texture
12 {
13 private:
14         PixelFormat ifmt;
15         unsigned width;
16         unsigned allocated;
17
18 public:
19         Texture1D();
20
21         void storage(PixelFormat, unsigned);
22         void allocate(unsigned);
23         void image(unsigned, PixelFormat, DataType, const void *);
24         unsigned get_width() const { return width; }
25
26 private:
27         unsigned get_level_size(unsigned);
28 };
29
30 } // namespace GL
31 } // namespace Msp
32
33 #endif