public:
/**
- * The RenderFlags describe how the objects are rendered using the depth buffer.
+ * The RenderFlags describe how the objects are rendered using the depth and stencil buffer.
+ *
+ * The flags which relate to GL_DEPTH_TEST and GL_STENCIL_TEST are called
+ * DEPTH_BUFFER_ENABLED and STENCIL_BUFFER_ENABLED to avoid any confusion.
+ * E.g. if GL_DEPTH_TEST is not enabled you can't write to the depth buffer, which can cause confusion.
+ *
*/
enum RenderFlags
{
- DEPTH_TEST = 0x01, ///< If depth testing should be used
- DEPTH_WRITE = 0x02, ///< If the depth buffer is writable
- DEPTH_CLEAR = 0x04, ///< If the depth buffer should first be cleared
- STENCIL_TEST = 0x08, ///< If stencil testing should be used
- STENCIL_WRITE = 0x10, ///< If the stencil buffer is writable
- STENCIL_CLEAR = 0x20 ///< If the stencil buffer should first be cleared
+ DEPTH_BUFFER_ENABLED = 1 << 0, ///< If depth buffer should be used for writing / test operations
+ DEPTH_WRITE = 1 << 1, ///< If the depth buffer is writable
+ DEPTH_CLEAR = 1 << 2, ///< If the depth buffer should first be cleared
+ STENCIL_BUFFER_ENABLED = 1 << 3, ///< If stencil buffer should be used for writing / test operation
+ STENCIL_WRITE = 1 << 4, ///< If the stencil buffer is writable
+ STENCIL_CLEAR = 1 << 5, ///< If the stencil buffer should first be cleared
+
};
/**