My idea is to use boost mpl to define vertex formats with type sequences, generating code objects for vertex access and rendering, so the only runtime decision made is following the function pointer to the generated implementation of submitVertexList in the VertexDef class v-table.
So that way you can define your vertex format like so:
Recursive instantiation of an inline member function using a selector class can be used to hard code the submitVertexList function in compile time. VertexDef inherits AbstractVertexDef, so the resulting type is an interface for doing vertex format specific things to a list of vertices with that type. You could then supply your own type for vertex data:
And that would be interpreted correctly by the above VertexDef. It is also possible that an output vertex type be generated by VertexDef instantiation, like VertexDef::VertexType.
Of course, the issue with generating an actual VertexType class from the VertexDef template in boost is that it would require messier meta than it would in C++11 which supports variadic templates.
Would you be interested in looking it over if I wrote such a modification? I'd place it in an experimental code branch of my own.
My idea is to use boost mpl to define vertex formats with type sequences, generating code objects for vertex access and rendering, so the only runtime decision made is following the function pointer to the generated implementation of submitVertexList in the VertexDef class v-table.
So that way you can define your vertex format like so:
Recursive instantiation of an inline member function using a selector class can be used to hard code the submitVertexList function in compile time. VertexDef inherits AbstractVertexDef, so the resulting type is an interface for doing vertex format specific things to a list of vertices with that type. You could then supply your own type for vertex data:
And that would be interpreted correctly by the above VertexDef. It is also possible that an output vertex type be generated by VertexDef instantiation, like VertexDef::VertexType.
Of course, the issue with generating an actual VertexType class from the VertexDef template in boost is that it would require messier meta than it would in C++11 which supports variadic templates.
Would you be interested in looking it over if I wrote such a modification? I'd place it in an experimental code branch of my own.