X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fvertexformat.h;h=fba206e4386e978674a2d5e6bbc7cc33c9d2119e;hb=4cd245dafe6a7ee5c93edca5aee2d146f1155309;hp=d5835013b53a925584bbfa8055a663f1f1382ed4;hpb=190a7e11237351f6b730c28f7b16f183e8adc69c;p=libs%2Fgl.git diff --git a/source/core/vertexformat.h b/source/core/vertexformat.h index d5835013..fba206e4 100644 --- a/source/core/vertexformat.h +++ b/source/core/vertexformat.h @@ -61,6 +61,10 @@ enum VertexAttribute: std::uint16_t GENERIC_I2 = 0x28CA, GENERIC_I3 = 0x28CB, GENERIC_I4 = 0x28CC, + PADDING1 = 0xF811, + PADDING2 = 0xF812, + PADDING3 = 0xF813, + PADDING4 = 0xF814, RAW_ATTRIB1 = 0xFDC1, RAW_ATTRIB2 = 0xFDC2, RAW_ATTRIB3 = 0xFDC3, @@ -76,9 +80,10 @@ Describes the attributes of a vertex. Up to 15 attributes are allowed. */ class VertexFormat { -private: - enum { MAX_ATTRIBUTES = 15 }; +public: + static constexpr unsigned MAX_ATTRIBUTES = 15; +private: std::uint8_t count = 0; VertexAttribute attributes[MAX_ATTRIBUTES]; @@ -133,6 +138,9 @@ inline unsigned get_attribute_size(VertexAttribute a) inline bool is_integer_attribute(VertexAttribute a) { return a&8; } +inline bool is_padding(VertexAttribute a) +{ return get_attribute_semantic(a)==get_attribute_semantic(PADDING1); } + void operator>>(const LexicalConverter &, VertexAttribute &); } // namespace GL