I would suggest using GL_LINES. You can either do it by doubling up all of the verts, or specifying all of the verts once and using an index to denote the pairs. The latter is a bit more complicated, but more efficient, particularly if the indices can be 1 or 2 byte ints.
-Casey On Fri, Jan 8, 2010 at 9:33 AM, Ricky Ng <[email protected]> wrote: > Ahh thanks, I missed that part. Happen to know what the next > most efficient way to draw squares is then? > > On Fri, Jan 8, 2010 at 1:35 AM, Jonathan Hartley <[email protected]> > wrote: >> >> On Jan 8, 5:29 am, Dummey <[email protected]> wrote: >> > I was working with vector list to create a grid on top of my window. >> > This would involve lots of squares (48*32) that would need to be >> > refreshed. >> > >> > This is when I ran into an issue trying to use a pyglet.graphics.batch >> > () >> > >> > ###self.rendered_heatmap_batch.draw() >> > >> > ###for row in self.rendered_heatmap: >> > #######for element in row: >> > ###########element.draw(pyglet.gl.GL_POLYGON) >> > >> > for some reason, the top line of code produces the polygons, but with >> > errors. The bottom line for loop however works perfectly fine. >> > >> > top:http://yfrog.com/j980617869j >> > >> > bottom:http://yfrog.com/6263983072j >> >> I don't believe Batches can handle GL_POLYGON, GL_LINE_LOOP or >> GL_TRIANGLE_FAN >> >> (and watch out for the extra terminating vertex required when using >> GL_LINE_STRIP, GL_TRIANGLE_STRIP or GL_QUAD_STRIP) >> >> This is described in the docs at >> http://www.pyglet.org/doc/api/pyglet.graphics-module.html >> >> This caught me out once, too. Easy to fix once you realise what's >> going on. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "pyglet-users" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/pyglet-users?hl=en. >> >> >> > > > > -- > Incoherently, > RIcky Ng > > -- > You received this message because you are subscribed to the Google Groups > "pyglet-users" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/pyglet-users?hl=en. > >
-- You received this message because you are subscribed to the Google Groups "pyglet-users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en.
