I need to point int(which determines the byte offset) to const void*. The only solution that really works for me is c-style casts:
int offset = 6*sizeof(GLfloat);
glVertexAttribPointer(1,3,GL_FLOAT,GL_FALSE,0,(void*)offset);
I want to get rid of c-style cast, but I will not find a working solution. I tried
static_cast<void*>(&offset)
and it compiles, but this may not be the right solution (the whole conclusion is different from this approach). What is the right solution here?
Documentation linkglVertexAttribPointer : Link
source
share