#include #include #include #include template< typename T, typename Value, std::size_t offset, typename... Members > void vertex_setup( GLTraits::Members, Members...>, GLint location = 0 ) { GLTraits::Value::vertex_attrib_pointer(location, offset, sizeof(T)); vertex_setup( GLTraits::Members{}, location + GLTraits::Value::columns ); } template void vertex_setup(GLTraits::Members, GLint) {} int main() { struct Vertex { glm::vec3 position; glm::vec2 tex_coord; glm::mat3 tbn; glm::ivec4 bone_indices; glm::vec4 bone_weights; GLubyte flags; GLdouble unaligned; }; vertex_setup(GLTraits::members()); }