]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture1d.h
Add basic support for 1D textures
[libs/gl.git] / source / texture1d.h
diff --git a/source/texture1d.h b/source/texture1d.h
new file mode 100644 (file)
index 0000000..9957eeb
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef MSP_GL_TEXTURE1D_H_
+#define MSP_GL_TEXTURE1D_H_
+
+#include "datatype.h"
+#include "pixelformat.h"
+#include "texture.h"
+
+namespace Msp {
+namespace GL {
+
+class Texture1D: public Texture
+{
+private:
+       PixelFormat ifmt;
+       unsigned width;
+       unsigned allocated;
+
+public:
+       Texture1D();
+
+       void storage(PixelFormat, unsigned);
+       void allocate(unsigned);
+       void image(unsigned, PixelFormat, DataType, const void *);
+       unsigned get_width() const { return width; }
+
+private:
+       unsigned get_level_size(unsigned);
+};
+
+} // namespace GL
+} // namespace Msp
+
+#endif