X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexture1d.cpp;h=accd0e0c06c76a4bfe0b91f828cc840c5becff49;hb=dfc784f7acd3132e5fcb9c43c0bda638df3b52f2;hp=bcebca49565131eb738ba471af992cbe0e05c1a9;hpb=744dced516f11d072dc6176fdf2df7e464b9782e;p=libs%2Fgl.git diff --git a/source/texture1d.cpp b/source/texture1d.cpp index bcebca49..accd0e0c 100644 --- a/source/texture1d.cpp +++ b/source/texture1d.cpp @@ -1,3 +1,4 @@ +#include #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) { @@ -46,6 +50,7 @@ void Texture1D::image(unsigned level, PixelFormat fmt, DataType type, const void allocated |= 1<>=1, ++level) ; allocated |= (1<>level; } +UInt64 Texture1D::get_data_size() const +{ + return id ? width*get_pixel_size(ifmt) : 0; +} + } // namespace GL } // namespace Msp