Hello,
I am working on OpenGL and would like to know how to change the starting position parameter of a memoryblock.
The interleaved array has a set of repeating data, 3 bytes for position (1,1,-1), 3 bytes for colour (0.18,0.31,0.30), and repeats for position and colour. Here is an example:
MyMBCube is an array with this interleaved data
(1,1,-1, 0.18, 0.31, 0.30, -1,1,-1, 0.44, 0.86, 0.26, ... etc.)
The first line of OpenGL glVertexPointer code works well, which reads 3-bytes at a time, is a double value, and repeats every 48 bits. The glColorPointer must begin reading the MemoryBlock at an offset byte position 3 because of the interleaved data. I jokingly put MyMBCube(3) to show that the passed parameter of the MyMBCube would start at position 3 and not at position zero.
OpenGL.glVertexPointer(3, OpenGL.GL_DOUBLE, 48, MyMBCube) //load the data
OpenGL.glColorPointer(3, OpenGL.GL_DOUBLE, 48, MyMBCube(3))
I can copy MyMBCube data into another array and pass the modified memoryblock, but then this defeats the purpose of saving memory and increased performance as two memoryblocks will be pushed to the videocard for writing, one for position and the other for colour. This memoryblock data is being sent at about 60 times per second.
How do I pass the memoryblock parameter to begin at position 3 when the glColorPointer parameter requires a memoryblock type?
Thanks