]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texturecube.h
Final touches of OS X support
[libs/gl.git] / source / texturecube.h
index 0d23884f1458626b954f2a6badd871d38ff9026f..e775be1d31ec0ceb26d2fd47ee75597803caf969 100644 (file)
@@ -1,10 +1,12 @@
 #ifndef MSP_GL_TEXTURECUBE_H_
 #define MSP_GL_TEXTURECUBE_H_
 
+#include <msp/graphics/image.h>
 #include "datatype.h"
 #include "pixelformat.h"
 #include "texture.h"
 #include "vector.h"
+#include <msp/gl/extensions/arb_texture_cube_map.h>
 
 namespace Msp {
 namespace GL {
@@ -33,6 +35,17 @@ Requires OpenGL version 1.3.
 */
 class TextureCube: public Texture
 {
+public:
+       class Loader: public Msp::DataFile::DerivedObjectLoader<TextureCube, Texture::Loader>
+       {
+       public:
+               Loader(TextureCube &);
+       private:
+               void image_data(TextureCubeFace, const std::string &);
+               void raw_data(TextureCubeFace, const std::string &);
+               void storage(PixelFormat, unsigned);
+       };
+
 private:
        PixelFormat ifmt;
        unsigned size;
@@ -64,6 +77,8 @@ public:
                int x, int y, unsigned w, unsigned h,
                PixelFormat fmt, DataType type, const void *data);
 
+       void image(TextureCubeFace, const Graphics::Image &);
+
        unsigned get_size() const { return size; }
 private:
        unsigned get_level_size(unsigned);
@@ -86,6 +101,8 @@ public:
        Vector3 get_texel_direction(TextureCubeFace, unsigned, unsigned);
 };
 
+void operator>>(const LexicalConverter &, TextureCubeFace &);
+
 } // namespace GL
 } // namespace Msp