Following another question from me, here is a specific example where I want to avoid offsetof
.
For using with glVertexAttribPointer
, I have to use offsetof
for the last parameter.
glVertexAttribPointer(GLKVertexAttribColor, 4, GL_FLOAT, GL_FALSE, sizeof(Vertex),
(const GLvoid *) offsetof(Vertex, _color));
Vertex is a class. Is there a way I can avoid using this one? I tried with pointer to members, but no luck.
Cannot compile in the following
glVertexAttribPointer(GLKVertexAttribColor, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex),
(const GLvoid *)&Vertex::_color);