]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/frameformat.h
Move all OpenGL-specific code to a separate directory
[libs/gl.git] / source / core / frameformat.h
index c67586a9dd435353c5511f67967e23bd57d4ec6a..90132092444488415a447b2840d03ad48c5fb58a 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef MSP_GL_FRAMEFORMAT_H_
 #define MSP_GL_FRAMEFORMAT_H_
 
-#include <msp/core/inttypes.h>
+#include <cstdint>
 #include "pixelformat.h"
 
 namespace Msp {
@@ -20,7 +20,7 @@ nnnn nn_f _sss _ccc
 This information is presented for internal documentation purposes only; it is
 inadvisable for programs to rely on it.
 */
-enum FrameAttachment
+enum FrameAttachment: std::uint16_t
 {
        COLOR_ATTACHMENT = 0x0014,
        DEPTH_ATTACHMENT = 0xF941,
@@ -36,9 +36,9 @@ class FrameFormat
 private:
        enum { MAX_ATTACHMENTS = 7 };
 
-       UInt8 count;
-       UInt8 samples;
-       UInt16 attachments[MAX_ATTACHMENTS];
+       std::uint8_t count;
+       std::uint8_t samples;
+       FrameAttachment attachments[MAX_ATTACHMENTS];
 
 public:
        FrameFormat();
@@ -53,8 +53,8 @@ public:
 
        unsigned size() const { return count; }
        bool empty() const { return !count; }
-       const UInt16 *begin() const { return attachments; }
-       const UInt16 *end() const { return attachments+count; }
+       const FrameAttachment *begin() const { return attachments; }
+       const FrameAttachment *end() const { return attachments+count; }
        int index(FrameAttachment) const;
 };
 
@@ -71,14 +71,14 @@ FrameAttachment make_indexed_attachment(FrameAttachment, unsigned);
 inline FrameAttachment operator,(FrameAttachment fa, unsigned i)
 { return make_indexed_attachment(fa, i); }
 
-inline unsigned get_attach_point(UInt16 fa)
+inline unsigned get_attach_point(FrameAttachment fa)
 { return fa>>10; }
 
-PixelFormat get_attachment_pixelformat(UInt16);
-
-GLenum get_gl_attachment(FrameAttachment);
+PixelFormat get_attachment_pixelformat(FrameAttachment);
 
 } // namespace GL
 } // namespace Msp
 
+#include "frameformat_backend.h"
+
 #endif