title: how to specify point sprite texture coordinates in OpenGL ES 1.1?
body: <p>I'm writing a particle system that uses point sprites in OpenGL ES 1.1 on iOS.  Everything works great until I try to texture the point sprites... when I render, each sprite is colored by the top left pixel of the texture I'm loading (rather than displaying the image).  I've tried different images and different sizes and always get the same result.</p>
  
  <p>setup code (taken from GLPaint example):</p>
  
  <pre><code>CGImageRef      brushImage;
  CGContextRef    brushContext;
  size_t          width, height;
  GLubyte         *brushData;
  brushImage = [UIImage imageNamed:@"Particle.png"].CGImage;
  width = CGImageGetWidth(brushImage);
  height = CGImageGetHeight(brushImage);
  if(brushImage) {
      brushData = (GLubyte *) calloc(width * height * 4, sizeof(GLubyte));
      brushContext = CGBitmapContextCreate(brushData, width, width, 8, width * 4, CGImageGetColorSpace(brushImage), kCGImageAlphaPremultipliedLast);
      CGContextDrawImage(brushContext, CGRectMake(0, 0.0, (CGFloat)width, (CGFloat)height), brushImage);
      CGContextRelease(brushContext);
      glGenTextures(1, &amp;brushTexture);
      glBindTexture(GL_TEXTURE_2D, brushTexture);
      glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
      glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, brushData);
      free(brushData);
  }
  </code></pre>
  
  <p>and the render code:</p>
  
  <pre><code>glLoadIdentity();
  glEnable(GL_BLEND);
  
  glTranslatef(0.0f,0.0f,0.0f);
  glClearColor(0.0, 0.0, 0.0, 1.0f);
  
  glClear(GL_COLOR_BUFFER_BIT );  
  glEnableClientState(GL_POINT_SPRITE_OES);   
  glEnableClientState(GL_POINT_SIZE_ARRAY_OES);
  glEnable(GL_TEXTURE_2D);
  glBindTexture(GL_TEXTURE_2D, brushTexture);
  
  glTexEnvf(GL_POINT_SPRITE_OES, GL_COORD_REPLACE_OES, GL_TRUE);
  
  glEnableClientState(GL_VERTEX_ARRAY);
  glEnableClientState(GL_COLOR_ARRAY);    
  // took this out as incorrect call glEnableClientState(GL_POINT_SMOOTH);
  
  glVertexPointer(2, GL_FLOAT, sizeof(ColoredVertexData2D), &amp;vertexData[0].vertex);
  glColorPointer(4, GL_FLOAT, sizeof(ColoredVertexData2D), &amp;vertexData[0].color);
  glPointSizePointerOES(GL_FLOAT,sizeof(ColoredVertexData2D),&amp;vertexData[0].size) 
  
  glDrawArrays(GL_POINTS, 0,1000);
  </code></pre>
  
  <p>when texturing point sprites,  do you have to specify texture coordinates, and if so, how?</p>