Stretching pyglet’s Wings

I’m excited to be giving a talk at PyCon UK next weekend about creating OpenGL programs in Python, using the graphics and games library pyglet. I’m still working feverishly on the presentation. This post is to be a permanent URL for the content, downloadable demos and YOUR comments, once PyCon is over.

See y’all there.

Update v1.0: The presentation slides are online, as is the demo source code.

Update v1.1: Fixed a bug using batches of vertex lists. (they don’t work with triangle fans, and they need a duplicated first and last vertex in each list to delineate primitives.) Rendering speed is still awful using graphics.draw, vertex_lists and batches though. I’m chasing that up next.

Update v1.2: Fixed some of the performance problems, demo 6’s batches of vertex lists are now the fastest way to render, which is the expected result. Still curious why calls to are slower than though.

Update v1.3: Added demo 9 which creates a maze with ghosts wandering within it. The entire maze is rendered in a single batch.draw() call. Innumerable other improvements throughout.

13 thoughts on “Stretching pyglet’s Wings

  1. Pingback: Fast, Pixel Precision 2D Drawing API for Graphics App? | XL-UAT

  2. Pingback: Weeks Unknown – Scaling Troubles | Import Soul

  3. Thank you so much for this. Looking to supplement the somewhat skimpy tutorials that come with pyglet, this is gold to me

  4. Thanks Justin. Post to the pyglet list when you make something cool, no matter how minimal – I love seeing other people’s pyglet programs.

  5. I love the examples you’ve created. I’m just starting to play around with pyglet and stumbled across your code while looking for some example code.

    thanks and good job :)

  6. @Nick, thanks, glad you got something out of it. Incidentally, I can’t resist continuing to refine the code samples, they are improving on a daily basis, more updates to come tonight.

  7. Good talk Jonathan. I’ve used Pygame quite a bit with my students, and it was useful to see what pyglet can do. I’m going to have to give some serious thought to whether we should switch to pyglet in the future.

    I took some pictures of your talk; you’ll find them in amongst my PyCon UK set on Flickr.

  8. Pingback: Resolver Systems: News

  9. It does. Richard and I tried to make a big deal about it in the early days of the mailing list, but it got tiring :-). mental images (who make mental ray) also follow these rules, FWIW.

  10. Thanks Alex. A lower case ‘p’, you say? I had no idea, but I’ll endeavour to remember. Is it an e e cummings thing?

    So does pyglet’s lower-casing still apply in circumstances where lower case words normally have a capitalization applied to them? Such as in the post title?

  11. Sounds great — looking forward to the demos/video. One request: when promoting pyglet, please spell it correctly: “pyglet”, not “Pyglet”. Thanks!

  12. The talk was *amazing* Jonathan, you were fantastic.

    I thought I would say it now as I might find it difficult to lie *after* you give the talk… ;-)

Leave a Reply