I’m rendering an interleaved vbo using the following code which works fine.
glVertexPointer(3, GL_FLOAT, sizeof(InterleavedVertexData), (GLvoid*)((char*)0));
glNormalPointer(GL_FLOAT, sizeof(InterleavedVertexData), (GLvoid*)((char*)0+3*sizeof(GLfloat)));
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(InterleavedVertexData), (GLvoid*)((char*)0+6*sizeof(GL_UNSIGNED_BYTE)));
When I change glColorPointer’s pointer paramater to use GLubyte i don’t see anything rendered on the screen? I’m defining colour as GLubyte in my struct also.
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(InterleavedVertexData), (GLvoid*)((char*)0+6*sizeof(GLubyte)));
GLubyteis a type.GL_UNSIGNED_BYTEis an integer constant which is often used to indicate that you will pass aGLubytein a pointer.sizeof(GLubyte)is always 1 by definition. Takingsizeof(GL_UNSIGNED_BYTE)will typically return 4 or 8, because it’s an integer constant, and has the size of whatever your system’s integer size is.