]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture1d.cpp
Copy ProgramData::uniform_slots in copy constructor and operator=
[libs/gl.git] / source / texture1d.cpp
index bcebca49565131eb738ba471af992cbe0e05c1a9..a0876aced2d57f987d06f45660de8d8f9f456078 100644 (file)
@@ -1,3 +1,4 @@
+#include <msp/gl/extensions/msp_texture1d.h>
 #include "bindable.h"
 #include "error.h"
 #include "texture1d.h"
@@ -9,9 +10,12 @@ namespace GL {
 
 Texture1D::Texture1D():
        Texture(GL_TEXTURE_1D),
+       ifmt(RGB),
        width(0),
        allocated(0)
-{ }
+{
+       static Require _req(MSP_texture1D);
+}
 
 void Texture1D::storage(PixelFormat fmt, unsigned wd)
 {
@@ -56,5 +60,10 @@ unsigned Texture1D::get_level_size(unsigned level)
        return width>>level;
 }
 
+UInt64 Texture1D::get_data_size() const
+{
+       return id ? width*get_pixel_size(ifmt) : 0;
+}
+
 } // namespace GL
 } // namespace Msp