]> git.tdb.fi Git - libs/gl.git/blob - source/texture1d.h
Improve formatting of an empty loop body
[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 levels;
27         unsigned allocated;
28
29 public:
30         Texture1D();
31
32         void storage(PixelFormat, unsigned, unsigned = 0);
33         void allocate(unsigned);
34         void image(unsigned, PixelFormat, DataType, const void *);
35         void sub_image(unsigned, int, unsigned, PixelFormat, DataType, const void *);
36         virtual void image(const Graphics::Image &, bool = false);
37         unsigned get_width() const { return width; }
38
39 private:
40         unsigned get_n_levels() const;
41         unsigned get_level_size(unsigned) const;
42
43 public:
44         virtual AsyncLoader *load(IO::Seekable &, const Resources * = 0) { return 0; }
45         virtual UInt64 get_data_size() const;
46         virtual void unload() { }
47 };
48
49 } // namespace GL
50 } // namespace Msp
51
52 #endif