I need to cast an int
(which specifies a byte offset) to a const void*
. The only solution that really works for me are c-style casts:
int offset = 6*sizeof(GLfloat);
glVertexAttribPointer(1,3,GL_FLOAT,GL_FALSE,0,(void*)offset);
I want to get rid of the c-style cast, but I dont't find a working solution. I tried
static_cast<void*>(&offset)
and it compiles, but that cannot be the right solution (whole output is different with this approach). What is here the right solution?
Link to documentation of glVertexAttribPointer
: Link