How to cast int to const GLvoid*?
In my cross platform OpenGL application I want to draw using vertex buffer objects. However I run into problems invoking glDrawRangeElements. glDrawRangeElements(GL_TRIANGLES, start, start + count, count, GL_UNSIGNED_INT, static_cast<GLvoid *> (start * sizeof(unsigned int))); The compiler (CLang on Mac OS X) does not like the last argument "error: cannot cast from type 'unsigned long' to pointer type 'GLvoid *' (aka 'void *')". OpenGL API defines the type of last arguments as const GLvoid * and expects a pointer when this api is used with vertex arrays. However I understand that when vertex