View Full Version : Help

04-10-2003, 02:40 PM
Im taking a opengl course and I am looking a good link on how to use Nvidia's VAR extension with vertices having texture coordinates. So far I have stored my vertices in a buffer but I dont know how to store the texture coordinates in the buffer, I would really appreaciate any help, thanks.

04-10-2003, 03:06 PM
Just put them after the vertex position.
Instead of:



var=SwglAllocateMemory(sizeof(float)*(3+2)*numVert );

04-11-2003, 04:41 AM
how would you point to them since they are in the same array as the pointer, i am used to

glTexCoordPointer( 2, GL_FLOAT, 0, texcoordarray );

how would i point it to the vertices in the VAR buffer, and would I store the vertices and their corresponding texture coordinates or would I seperate them in two groups, thanks for the help.

04-11-2003, 05:10 AM
Strange question. You'd use it the same way you're using standard vertex arrays. VAR just gives you a pointer in video memory for you to fill with vertices, nothing more. It's up to you to decide how you'll break up the memory in vertices.


04-11-2003, 08:36 AM
If your vertex format is

struct Vertex {
float x, y, z;
float s, t;

Then the "stride" value of calls to VertexPointer and TexCoordPointer should be sizeof(Vertex), not 0.