]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/depthtest.h
Check the flat qualifier from the correct member
[libs/gl.git] / source / core / depthtest.h
index d79f06e8d292f4bc39660dd03016dd9d9d0d6694..76602269a137848fc7a3b5cc6f84199c28d6358e 100644 (file)
@@ -22,14 +22,22 @@ struct DepthTest
                void compare(Predicate);
        };
 
-       bool enabled;
-       Predicate compare;
-       bool write;
+       bool enabled = false;
+       Predicate compare = LESS;
+       bool write = true;
 
-       DepthTest();
+       DepthTest() = default;
        DepthTest(Predicate, bool = true);
+
+       bool operator==(const DepthTest &) const;
+       bool operator!=(const DepthTest &d) const { return !operator==(d); }
 };
 
+inline bool DepthTest::operator==(const DepthTest &other) const
+{
+       return enabled==other.enabled && compare==other.compare && write==other.write;
+}
+
 } // namespace GL
 } // namespace Msp