View Full Version : Separate coordinate arrays for glVertexPointer.

08-09-2008, 01:37 PM
Hi, I have a large number of arrays of shorts that I want to display as a graph, i.e.

short xCoord[LOTS] = // .. all my data. I have lots of these.

short yCoord[LOTS] = {1, 2, 3, 4, 5.....} // And this is fixed.

Is there a way to call glVertexPointer() (or something) so that I can display a line strip with these coordinates without having to interleave the arrays?

I'm guessing not (at least without writing a shader or something) but maybe I'm wrong.


08-09-2008, 04:22 PM
No, unless you use a simple vertex shader. So what is the problem about using shaders? Vertex shaders are supported on virtually every hardware you would want to support today...

08-10-2008, 01:17 PM
You can do that if you write a vertex shader and use two vertex streams. That's really quite simple, and the recommended way to do it.