]> git.tdb.fi Git - libs/gl.git/blob - source/texture1d.h
Fix an incorrect negation
[libs/gl.git] / source / texture1d.h
1 #ifndef MSP_GL_TEXTURE1D_H_
2 #define MSP_GL_TEXTURE1D_H_
3
4 #include "texture.h"
5
6 namespace Msp {
7 namespace GL {
8
9 class Texture1D: public Texture
10 {
11 public:
12         class Loader: public DataFile::DerivedObjectLoader<Texture1D, Texture::Loader>
13         {
14         public:
15                 Loader(Texture1D &);
16                 Loader(Texture1D &, Collection &);
17         private:
18                 void init();
19
20                 void raw_data(const std::string &);
21                 void storage(PixelFormat, unsigned);
22         };
23
24 private:
25         unsigned width;
26         unsigned allocated;
27
28 public:
29         Texture1D();
30
31         void storage(PixelFormat, unsigned);
32         void allocate(unsigned);
33         void image(unsigned, PixelFormat, DataType, const void *);
34         void sub_image(unsigned, int, unsigned, PixelFormat, DataType, const void *);
35         virtual void image(const Graphics::Image &, bool = false);
36         unsigned get_width() const { return width; }
37
38 private:
39         unsigned get_n_levels() const;
40         unsigned get_level_size(unsigned) const;
41
42 public:
43         virtual AsyncLoader *load(IO::Seekable &, const Resources * = 0) { return 0; }
44         virtual UInt64 get_data_size() const;
45         virtual void unload() { }
46 };
47
48 } // namespace GL
49 } // namespace Msp
50
51 #endif