X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexture1d.cpp;h=046fca6fa4eccbe49a5a5174ba498adefc1b892c;hb=437609f708f2918067ec64f6d02261d113b1cac0;hp=bcebca49565131eb738ba471af992cbe0e05c1a9;hpb=744dced516f11d072dc6176fdf2df7e464b9782e;p=libs%2Fgl.git diff --git a/source/texture1d.cpp b/source/texture1d.cpp index bcebca49..046fca6f 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) { @@ -30,7 +34,8 @@ void Texture1D::allocate(unsigned level) if(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