]> git.tdb.fi Git - libs/gl.git/blob - source/texture1d.h
Implement automatic unloading when a total size limit is exceeded
[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 public:
30         virtual AsyncLoader *load(IO::Seekable &) { return 0; }
31         virtual UInt64 get_data_size() const;
32         virtual void unload() { }
33 };
34
35 } // namespace GL
36 } // namespace Msp
37
38 #endif