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