]> git.tdb.fi Git - libs/gl.git/commitdiff
Initialize Texture's format to an invalid value
authorMikko Rasa <tdb@tdb.fi>
Sun, 19 Sep 2021 10:33:18 +0000 (13:33 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 19 Sep 2021 10:35:22 +0000 (13:35 +0300)
This makes it possible to determine if a texture has storage defined or
not.

source/core/pixelformat.h
source/core/texture.cpp

index 5a5302cd648fbe0a47f3d44e1450d2187b7a1a72..2f6038459bb7b345d610a1875cfa9e91a5cce38f 100644 (file)
@@ -54,6 +54,7 @@ inadvisable for programs to rely on it.
 */
 enum PixelFormat
 {
+       NO_PIXELFORMAT = 0,
        R8 = 0x4100|RED,
        R16F = 0x3200|RED,
        R32F = 0x3400|RED,
index e607792c9dc6f50103c2bd30d195343d107976b3..877e4d10c38f6ab60d64fd7166e4e56d5d1f2674 100644 (file)
@@ -26,8 +26,8 @@ Texture *Texture::scratch_binding = 0;
 Texture::Texture(GLenum t, ResourceManager *m):
        id(0),
        target(t),
-       format(RGB8),
-       storage_fmt(RGB8),
+       format(NO_PIXELFORMAT),
+       storage_fmt(format),
        swizzle(NO_SWIZZLE),
        use_srgb_format(false),
        auto_gen_mipmap(false)