Choosing Between Pygame and GLUT
January 6th, 2009
It's been a very long time since I last interacted with iDG - so long that I can't even remember the username I used to have, which has probably been deleted by now anyway. But on the brighter side, I have much more of a clue than I did back in high school.
I've started using Python for all my game programming, and I'm loving it. I have so far been using Pygame for things like input handling and FPS control, but pyOpenGL on the graphics side. I've been looking through the pyOpenGL GLUT documentation and wondering whether there would be any advantage to using GLUT's event handling system, i.e. registering a callback function for all mouse and keyboard events, instead of processing Pygame's event queue each frame, which has worked fine for me so far.
My inclination is to not fix what ain't broke, but I'm also somewhat interested in the pop-up functionality GLUT offers, as I'm in the middle of building a level editor for my game. In short, is there anything I'd be losing by switching from pygame to GLUT for window management and input handling?
Thanks,
- Chris Doucette
Pygame was originally called pySDL, because it was simply a python wrapper for SDL - of course pygame now offers more (using SDL_ttf and SDL_mixer for fonts and sounds, MPEG playback with ffmpeg, plus many modules to help you do a wealth of other interesting things). So you can think about this as SDL vs GLUT. EDIT: and OneSadCookie compared them nicely above.
Anyway, thanks for the advice on SDL vs. GLUT. I would rather stick with the infrastructure I've already got working. One thing that is unfortunately missing from Pygame, though, is any way of interacting with the menubar, and it's not intuitive how to make it play nicely with a separate Python GUI package like wxWidgets; any suggestions on that front?
You want to stick with the standard SDL-based window & events, if they're already working for you.
(Under the hood, it's all Cocoa, so there's no efficiency concerns here).
You're still going to need to write an 'engine'. PyGame is only SDL after all.
I meant elements of an engine (IE the individual components that provide all that functionality), and much has been done by the community. Pygame isn't just vanilla SDL, after all.
#If you have any other info about this subject , Please add it free.# |