@@ -0,0 +1,1348 @@
+#!/usr/bin/python2%0A%0Aimport sys%0Asys.path = %5B'', 'pyglet-1.1.4'%5D + sys.path%0A%0Aimport math%0A%0Aimport pyglet%0Afrom pyglet.graphics import vertex_list%0Afrom pyglet import gl%0Afrom pyglet.window import key%0A%0Awindow = pyglet.window.Window(width=800, height=600, resizable=True)%0A%0Afps_display = pyglet.clock.ClockDisplay()%0A%0Anum_points = 12%0Anum_lines = 10%0Anum_points = 12%0Anum_lines = 12%0Aepsilon = 0.01%0Alines = %5B%5B0 for i in range(num_points)%5D for i in range(num_lines)%5D%0Avlists = %5Bvertex_list(num_points, 'v2f', 'c4B') for i in range(num_lines)%5D%0A%0Afor vlist in vlists:%0A    for i in range(len(vlist.colors)):%0A        vlist.colors%5Bi%5D = 255%0A%0A@window.event%0Adef on_resize(w, h):%0A    print %22on resize %25d %25d%22 %25 (w,h)%0A%0A@window.event%0Adef on_draw():%0A    window.clear()%0A    for vlist in vlists:%0A        vlist.draw(gl.GL_LINE_STRIP)%0A    fps_display.draw()%0A%0Adef update(dt):%0A    size = min(window.width, window.height)%0A    assert len(vlists) == len(lines)%0A    for i in range(len(lines)):%0A        for j in range(len(lines%5Bi%5D)):%0A            lines%5Bi%5D%5Bj%5D += i*j*dt*epsilon%0A            vlists%5Bi%5D.vertices%5B2*j%5D = math.cos(lines%5Bi%5D%5Bj%5D)*size/2 + size/2%0A            vlists%5Bi%5D.vertices%5B2*j+1%5D = math.sin(lines%5Bi%5D%5Bj%5D)*size/2 + size/2%0A            assert lines%5Bi%5D%5B0%5D == 0.0%0A%0A@window.event%0Adef on_key_press(sym, mod):%0A    pass%0A%0Apyglet.clock.schedule_interval(update, 1.0/200.0)%0A%0Apyglet.app.run()%0A

Add magice circle demo app