No, because of array/pointer "equivalence" - but good to call on it, because if you have a single unsigned int (representing an RGBA colour) you will need to use & on it.
In another piece of code, I have:Code :surfacevert *svert = NULL; glBindBuffer (GL_ARRAY_BUFFER, blahwhatever); glVertexAttribPointer (0, 3, GL_FLOAT, GL_FALSE, sizeof (surfacevert), svert->position); glVertexAttribPointer (1, 2, GL_FLOAT, GL_FALSE, sizeof (surfacevert), svert->texcoord0); glVertexAttribPointer (2, 3, GL_FLOAT, GL_FALSE, sizeof (surfacevert), svert->texcoord1);
Viewing in the debugger, we can see that svert->position is 0x00, svert->texcoord0 is 0x0c and svert->texcoord1 is 0x14, which correctly correspond to buffer offsets of 0, 12 and 20 for this vertex type.
Not 100% certain of the portability of this trick though - it works fine on Windows with MSVC and is great for decoupling your struct layout from your gl*Pointer calls, not to mention a darn sight nicer to read than the more usually seen BUFFER_OFFSET macro, but what about other platforms?




