X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Ftexture3d.h;h=d791633d3a306ef08607016efe4b956d850f43fa;hb=be6ffe96ecb4707599fe1a6f620c348760213d46;hp=7b88db50d36f6afed388d2cae9dd61685a5204ac;hpb=ada4b7614137221b64a00f31fde1498064e9fb19;p=libs%2Fgl.git diff --git a/source/core/texture3d.h b/source/core/texture3d.h index 7b88db50..d791633d 100644 --- a/source/core/texture3d.h +++ b/source/core/texture3d.h @@ -3,7 +3,7 @@ #include #include -#include "texture.h" +#include "texture3d_backend.h" namespace Msp { namespace GL { @@ -12,8 +12,10 @@ namespace GL { Three-dimensional texture. Consists of an array of texels in the shape of a right cuboid. Texture coordinates have a principal range of [0, 1]. */ -class Texture3D: public Texture +class Texture3D: public Texture3DBackend { + friend Texture3DBackend; + public: class Loader: public Msp::DataFile::DerivedObjectLoader { @@ -29,14 +31,14 @@ public: }; protected: - unsigned width; - unsigned height; - unsigned depth; - unsigned levels; + unsigned width = 0; + unsigned height = 0; + unsigned depth = 0; + unsigned levels = 0; - Texture3D(GLenum); + Texture3D(unsigned); public: - Texture3D(); + Texture3D() = default; /** Defines storage structure for the texture. If lv is zero, the number of mipmap levels is automatically determined from storage dimensions. @@ -62,8 +64,6 @@ public: storage. */ virtual void image(const Graphics::Image &, unsigned = 0); - using Texture::image; - unsigned get_width() const { return width; } unsigned get_height() const { return height; } unsigned get_depth() const { return depth; } @@ -73,7 +73,7 @@ protected: public: virtual AsyncLoader *load(IO::Seekable &, const Resources * = 0) { return 0; } - virtual std::uint64_t get_data_size() const; + virtual std::size_t get_data_size() const; virtual void unload() { } };