Drawing shapes opengl es

Member
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.


Code:
GLfloat vVertices[] = {lsx, lsy, 0.0f, lfx, lfy, 0.0f};
                
glLineWidth(3*endGameScale);
glVertexPointer(3, GL_FLOAT, 0, vVertices);
glEnableClientState(GL_VERTEX_ARRAY);
glDrawArrays(GL_LINES, 0, 2);


Thanks for any help
Quote this message in a reply
Moderator
Posts: 1,560
Joined: 2003.10
Post: #2
GL_TRIANGLE_FAN might do what you want.
Quote this message in a reply
Member
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 8,911 Dec 23, 2011 01:43 PM
Last Post: Skorche
  Chipmunk physics accessing shapes in multiple methods issue JinnoRb 0 2,039 Mar 24, 2010 11:53 AM
Last Post: JinnoRb
  Drawing menu versus drawing game johncmurphy 4 4,239 Jan 6, 2010 09:14 AM
Last Post: AnotherJake
  OpenGL ES : Drawing Text... savage 8 9,948 Jan 4, 2010 08:59 PM
Last Post: alerus
  Drawing Anti-Aliased Shapes With Open GL muleskinner 4 3,922 Nov 17, 2009 10:01 AM
Last Post: warmi