title: Want to add color to a rectangle which i draw using openGL function
body: <p>I have to know how to add color to the rectangle drawn with the below method (which i took from a sample here).. Its by setting the openGL color to some color. But i dont know how to do it. Some help would be appreciated.</p>
  
  <pre><code>-(void) ccDrawFilledRect
  {
  
  HelloWorld *gs = [(swipeAppDelegate*)[[UIApplication sharedApplication] delegate]  gameScene];
  CGPoint poli[]= {gs.StartPoint,CGPointMake(gs.StartPoint.x,gs.EndPoint.y),gs.EndPoint,CGPointMake(gs.EndPoint.x,gs.StartPoint.y)};
  
  glDisable(GL_TEXTURE_2D);
  glDisableClientState(GL_TEXTURE_COORD_ARRAY);
  glDisableClientState(GL_COLOR_ARRAY);
  
  glVertexPointer(2, GL_FLOAT, 0, poli);
  glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
  NSLog(@"openGL rectangles drawn !!");
  
  // restore default state
  glEnableClientState(GL_COLOR_ARRAY);
  glEnableClientState(GL_TEXTURE_COORD_ARRAY);
  glEnable(GL_TEXTURE_2D);
  }
  </code></pre>