Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#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. Posted Image

#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. Posted Image

#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