Skip to content

Instantly share code, notes, and snippets.

@flagoworld
Created December 8, 2012 20:17
Show Gist options
  • Save flagoworld/4241746 to your computer and use it in GitHub Desktop.
Save flagoworld/4241746 to your computer and use it in GitHub Desktop.
float coords[16]=
{
(float)rect.x,(float)rect.y,u1,v1,
(float)rect.x+rect.w,(float)rect.y,u2,v1,
(float)rect.x+rect.w,(float)rect.y+rect.h,u2,v2,
(float)rect.x,(float)rect.y+rect.h,u1,v2
};
glVertexPointer(2,GL_FLOAT,sizeof(float)*4,(void *)&coords[0]);
glTexCoordPointer(2,GL_FLOAT,sizeof(float)*4,(void *)&coords[2]);
glDrawArrays(GL_QUADS,0,4);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment