]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/texture3d.h
Use default member initializers for simple types
[libs/gl.git] / source / core / texture3d.h
index 3538f6bba82018b85edd68a69f6686c52e991460..4a166174fbf75fb30bb8800ca3a3017c1ef5b43f 100644 (file)
@@ -3,7 +3,7 @@
 
 #include <string>
 #include <msp/linal/vector.h>
-#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<Texture3D, Texture::Loader>
        {
@@ -29,15 +31,14 @@ public:
        };
 
 protected:
-       unsigned width;
-       unsigned height;
-       unsigned depth;
-       unsigned levels;
-       unsigned allocated;
+       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.
@@ -46,10 +47,6 @@ public:
        it can't be changed. */
        void storage(PixelFormat fmt, unsigned wd, unsigned ht, unsigned dp, unsigned lv = 0);
 
-       /** Allocates storage for the texture.  The contents are initially
-       undefined.  If storage has already been allocated, does nothing. */
-       void allocate(unsigned level);
-
        /** Updates the contents of the entire texture.  Storage must be defined
        beforehand.  The image data must have dimensions and format matching the
        defined storage. */