]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/frameformat.h
Check the flat qualifier from the correct member
[libs/gl.git] / source / core / frameformat.h
index 90132092444488415a447b2840d03ad48c5fb58a..669261ff6f49582b5e663d2d8fee756e3c329408 100644 (file)
@@ -8,17 +8,20 @@ namespace Msp {
 namespace GL {
 
 /**
-Describes a single attachment of a framebuffer.  The values are bitfields laid
-as follows:
+Describes a single attachment of a framebuffer, including the type and index
+of the attachment point and the format of the attached texture.
 
-nnnn nn_f _sss _ccc
-      │ │    │    └╴Number of components
+The values are bitfields laid as follows:
+
+nnnn nn_f _sss rccc
+      │ │    │ │  └╴Number of components
+      │ │    │ └───╴Reverse order flag
       │ │    └─────╴Size of one component
       │ └──────────╴Floating-point flag
       └────────────╴Attachment index
 
 This information is presented for internal documentation purposes only; it is
-inadvisable for programs to rely on it.
+inadvisable for applications to rely on it.
 */
 enum FrameAttachment: std::uint16_t
 {
@@ -33,15 +36,16 @@ attachments (currently up to seven) as well as a sample count.
 */
 class FrameFormat
 {
-private:
-       enum { MAX_ATTACHMENTS = 7 };
+public:
+       static constexpr unsigned MAX_ATTACHMENTS = 7;
 
-       std::uint8_t count;
-       std::uint8_t samples;
+private:
+       std::uint8_t count = 0;
+       std::uint8_t samples = 0;
        FrameAttachment attachments[MAX_ATTACHMENTS];
 
 public:
-       FrameFormat();
+       FrameFormat() = default;
        FrameFormat(FrameAttachment);
 
        FrameFormat operator,(FrameAttachment) const;