Drawing shapes opengl es

Posts: 39
Joined: 2008.10
Post: #1
Hello everyone,

Im currently having a problem i need to solve, so basically at the moment im drawing a series of lines to create a shape. This works fine but I now want to fill in the shape, whats the best way to do this? I know open gl es doesnt support GL_FILL

Could someone please point me in the right direction, heres the code im using atm if anyone needs it. Im looping through and drawing one of these lines for each one i need to ultimately make a single shape.

GLfloat vVertices[] = {lsx, lsy, 0.0f, lfx, lfy, 0.0f};
glVertexPointer(3, GL_FLOAT, 0, vVertices);
glDrawArrays(GL_LINES, 0, 2);

Thanks for any help
Quote this message in a reply
Posts: 1,563
Joined: 2003.10
Post: #2
GL_TRIANGLE_FAN might do what you want.
Quote this message in a reply
Posts: 39
Joined: 2008.10
Post: #3
Thanks for the tip, GL_TRIANGLE_STRIP ended up the best choice, thanks for the help
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  OpenGL Cube drawing: VBOs, instanced geometry, octrees Symbol$ 5 13,536 Dec 23, 2011 01:43 PM
Last Post: Skorche
  Chipmunk physics accessing shapes in multiple methods issue JinnoRb 0 3,002 Mar 24, 2010 11:53 AM
Last Post: JinnoRb
  Drawing menu versus drawing game johncmurphy 4 6,348 Jan 6, 2010 09:14 AM
Last Post: AnotherJake
  OpenGL ES : Drawing Text... savage 8 14,411 Jan 4, 2010 08:59 PM
Last Post: alerus
  Drawing Anti-Aliased Shapes With Open GL muleskinner 4 5,766 Nov 17, 2009 10:01 AM
Last Post: warmi