]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/vertexformat.h
Use standard fixed-size integer types
[libs/gl.git] / source / core / vertexformat.h
index 68c3e4c9a38828f42cba32729dae126ee3f75187..85d525f9571e90d276cff19e9928c9bfb9d1cc3e 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef MSP_GL_VERTEXFORMAT_H_
 #define MSP_GL_VERTEXFORMAT_H_
 
-#include <msp/core/inttypes.h>
+#include <cstdint>
 #include <msp/strings/lexicalcast.h>
 #include "datatype.h"
 
@@ -75,8 +75,8 @@ class VertexFormat
 private:
        enum { MAX_ATTRIBUTES = 15 };
 
-       UInt8 count;
-       UInt16 attributes[MAX_ATTRIBUTES];
+       std::uint8_t count;
+       std::uint16_t attributes[MAX_ATTRIBUTES];
 
 public:
        VertexFormat();
@@ -89,8 +89,8 @@ public:
        bool operator!=(const VertexFormat &other) const { return !(*this==other); }
 
        bool empty() const { return !count; }
-       const UInt16 *begin() const { return attributes; }
-       const UInt16 *end() const { return attributes+count; }
+       const std::uint16_t *begin() const { return attributes; }
+       const std::uint16_t *end() const { return attributes+count; }
        unsigned stride() const;
        int offset(VertexAttribute) const;
 };
@@ -108,19 +108,19 @@ VertexAttribute make_indexed_attribute(VertexAttribute, unsigned);
 inline VertexAttribute operator,(VertexAttribute a, unsigned i)
 { return make_indexed_attribute(a, i); }
 
-inline unsigned get_attribute_semantic(UInt16 a)
+inline unsigned get_attribute_semantic(std::uint16_t a)
 { return a>>10; }
 
-inline DataType get_attribute_source_type(UInt16 a)
+inline DataType get_attribute_source_type(std::uint16_t a)
 { return static_cast<DataType>((a&0x70)>>4 | (a&0x180)<<1); }
 
-inline unsigned get_attribute_component_count(UInt16 a)
+inline unsigned get_attribute_component_count(std::uint16_t a)
 { return a&7; }
 
-inline unsigned get_attribute_size(UInt16 a)
+inline unsigned get_attribute_size(std::uint16_t a)
 { return get_attribute_component_count(a)*get_type_size(get_attribute_source_type(a)); }
 
-inline bool is_integer_attribute(UInt16 a)
+inline bool is_integer_attribute(std::uint16_t a)
 { return a&8; }
 
 void operator>>(const LexicalConverter &, VertexAttribute &);