• Create Account

### #ActualSuperVGA

Posted 30 October 2012 - 05:26 AM

void drawPoints()
{
...
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glVertexPointer(4, GL_DOUBLE, 4*sizeof(double), pos);
glTexCoordPointer(4, GL_DOUBLE, 4*sizeof(double), pos);


glVertexPointer

This is given the pos array, which should hold the vertices of all the drawn primitives.

glTexCoordPointer

This should be given an array of uv coordinates (typically described by 2 components rather than 4), 1 for each vertex passed to the GPU.

You're passing the "pos" array to both, I don't think you should be doing that.

Upon fixing that, look into VBOs - That's what it looks like you're trying to use. I use VBOs for drawing multiple polygons at once, it's pretty fast.

### #2SuperVGA

Posted 30 October 2012 - 05:24 AM

glVertexPointer

This is given the pos array, which should hold the vertices of all the drawn primitives.

glTexCoordPointer

This should be given an array of uv coordinates (typically described by 2 components rather than 4), 1 for each vertex passed to the GPU.

You're passing the "pos" array to both, I don't think you should be doing that.

Upon fixing that, look into display lists, VBOs or perhaps VAOs. I use VBOs for drawing multiple polygons at once, it's pretty fast.

### #1SuperVGA

Posted 30 October 2012 - 05:24 AM

glVertexPointer

This is given the pos array, which should hold the vertices of all the drawn primitives.

glTexCoordPointer

This should be given an array of uv coordinates (typically described by 2 components rather than 4)), 1 for each vertex passed to the GPU.

You're passing the pos array to both, I don't think you should be doing that.

Upon fixing that, look into display lists, VBOs or perhaps VAOs. I use VBOs for drawing multiple polygons at once, it's pretty fast.

PARTNERS