3 This file is part of libmspgl
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #ifndef MSP_GL_VERTEXFORMAT_H_
9 #define MSP_GL_VERTEXFORMAT_H_
41 VertexFormat(VertexComponent);
42 VertexFormat(const VertexFormat &);
43 VertexFormat &operator=(const VertexFormat &);
46 bool empty() const { return !data || !data[0]; }
47 const unsigned char *begin() const { return data ? data+1 : 0; }
48 const unsigned char *end() const { return data ? data+1+data[0] : 0; }
51 VertexFormat operator,(const VertexFormat &f, VertexComponent c);
52 inline VertexFormat operator,(VertexComponent c1, VertexComponent c2)
53 { return (VertexFormat(c1), c2); }
55 VertexFormat operator,(const VertexFormat &f, unsigned i);
56 inline VertexFormat operator,(VertexComponent c, unsigned i)
57 { return (VertexFormat(c), i); }
59 uint get_stride(const VertexFormat &);
60 std::istream &operator>>(std::istream &, VertexFormat &);