Thanks, it works. In indexed version I can use:
1. GL_LINES instead of GL_LINE_STRIP 2. (0, 1, 1, 2) instead of (0, 1, 2) batch1.add_indexed(3, pyglet.gl.GL_LINES, None, (0, 1, 1, 2), ('v2f', (200, 50, 200, 100, 100, 200)), ('c3B', (255, 0, 0) * 3)) Il giorno domenica 28 ottobre 2018 17:56:37 UTC+1, Jonathan Hartley ha scritto: > > Instead of GL_LINE_STRIP you want GL_LINES (I think that's what it's > called.) > > >> >> from pyglet.gl import * >> >> window = pyglet.window.Window(resizable=True) >> >> batch1 = pyglet.graphics.Batch() >> >> batch1.add_indexed(3, pyglet.gl.GL_LINE_STRIP, None, >> (0, 1, 2), >> ('v2f', (200, 50, 200, 100, 100, 200)), >> ('c3B', (255, 0, 0) * 3)) >> batch1.add_indexed(3, pyglet.gl.GL_LINE_STRIP, None, >> (0, 1, 2), >> ('v2f', (400, 50, 400, 100, 500, 200)), >> ('c3B', (0, 255, 0) * 3)) >> >> @window.event >> def on_draw(): >> window.clear() >> batch1.draw() >> >> pyglet.app.run() >> >> >> >> >> >> >> -- You received this message because you are subscribed to the Google Groups "pyglet-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users+unsubscr...@googlegroups.com. To post to this group, send email to pyglet-users@googlegroups.com. Visit this group at https://groups.google.com/group/pyglet-users. For more options, visit https://groups.google.com/d/optout.