]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/vertexformat.h
Remove deprecated things related to vertex formats and arrays
[libs/gl.git] / source / core / vertexformat.h
index 3317a015d1ce195f0793fca816159a415a6f0b7c..4c485b0423b9568a89b07b5ba164586b94dfa1fc 100644 (file)
@@ -1,38 +1,52 @@
 #ifndef MSP_GL_VERTEXFORMAT_H_
 #define MSP_GL_VERTEXFORMAT_H_
 
-#include <msp/core/attributes.h>
 #include <msp/strings/lexicalcast.h>
 
 namespace Msp {
 namespace GL {
 
-/** A single vertex component.  Symbolic names are provided for commonly used
-attributes.  These are aliased with with generic attributes, so be careful when
-picking your attribute indices. */
+/** A single vertex attribute.  Commonly used attributes are named by their
+semantical meaning in the standard shaders.  Texture coordinates and generic
+attributes can additionally be given an index.  There are four texture
+coordinate attributes available.  The number of available generic attributes
+depends on implementation limits, but is at least five.
+
+RAW_ATTRIB is handled in a special way; creating an indexed attribute based on
+it uses the index as raw attribute number.  Only use it if you know what you
+are doing. */
 enum VertexAttribute
 {
        VERTEX2 = 1,
        VERTEX3,
        VERTEX4,
-       NORMAL3 = 10,
-       COLOR4_UBYTE = 12,
-       COLOR3_FLOAT = 14,
+       COLOR4_UBYTE = 8,
+       COLOR3_FLOAT = 10,
        COLOR4_FLOAT,
-       TANGENT3 = 18,
-       BINORMAL3 = 22,
-       TEXCOORD1 = 32,
+       NORMAL3 = 18,
+       TANGENT3 = 26,
+       GROUP1 = 32,
+       GROUP2,
+       GROUP3,
+       GROUP4,
+       WEIGHT1 = 40,
+       WEIGHT2,
+       WEIGHT3,
+       WEIGHT4,
+       TEXCOORD1 = 48,
        TEXCOORD2,
        TEXCOORD3,
        TEXCOORD4,
-       ATTRIB1 = 64,
-       ATTRIB2,
-       ATTRIB3,
-       ATTRIB4
+       GENERIC1 = 80,
+       GENERIC2,
+       GENERIC3,
+       GENERIC4,
+       RAW_ATTRIB1 = 248,
+       RAW_ATTRIB2,
+       RAW_ATTRIB3,
+       RAW_ATTRIB4
 };
 
-DEPRECATED typedef VertexAttribute VertexComponent;
-
 class VertexFormat
 {
 private:
@@ -60,29 +74,17 @@ public:
 inline VertexFormat operator,(VertexAttribute a1, VertexAttribute a2)
 { return (VertexFormat(a1), a2); }
 
-inline VertexFormat operator,(VertexAttribute a, unsigned i)
-{ return (VertexFormat(a), i); }
-
 VertexAttribute make_indexed_attribute(VertexAttribute, unsigned);
 
-DEPRECATED inline VertexAttribute make_indexed_component(VertexAttribute a, unsigned i)
+inline VertexAttribute operator,(VertexAttribute a, unsigned i)
 { return make_indexed_attribute(a, i); }
 
 inline unsigned get_attribute_semantic(unsigned char a)
-{ return a>>2; }
+{ return a>>3; }
 
 inline unsigned get_attribute_size(unsigned char a)
 { return (a&3)+1; }
 
-DEPRECATED inline unsigned get_component_type(unsigned char c)
-{ return get_attribute_semantic(c); }
-
-DEPRECATED inline unsigned get_component_size(unsigned char c)
-{ return get_attribute_size(c); }
-
-DEPRECATED inline unsigned get_stride(const VertexFormat &f)
-{ return f.stride(); }
-
 void operator>>(const LexicalConverter &, VertexAttribute &);
 
 } // namespace GL