3 This file is part of libmspgl
4 Copyright © 2007, 2009-2010 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #ifndef MSP_GL_VERTEXFORMAT_H_
9 #define MSP_GL_VERTEXFORMAT_H_
40 VertexFormat(VertexComponent);
41 VertexFormat(const VertexFormat &);
42 VertexFormat &operator=(const VertexFormat &);
45 bool empty() const { return !data || !data[0]; }
46 const unsigned char *begin() const { return data ? data+1 : 0; }
47 const unsigned char *end() const { return data ? data+1+data[0] : 0; }
48 unsigned stride() const;
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 inline unsigned get_stride(const VertexFormat &f)
60 { return f.stride(); }
62 std::istream &operator>>(std::istream &, VertexFormat &);