1
\$\begingroup\$

I'm looking between PyGame and Pyglet, Pyglet seems to be somewhat newer and more Pythony, but it's last release according to Wikipedia is January '10. PyGame seems to have more documentation, more recent updates, and more published books/tutorials on the web for learning.

I downloaded both the Pyglet and PyGame versions of the NeHe OpenGL tutorials (Lessons 1-10) which cover this material:

lesson01 - Setting up the window lesson02 - Polygons lesson03 - Adding color lesson04 - Rotation lesson05 - 3D lesson06 - Textures lesson07 - Filters, Lighting, input lesson08 - Blending (transparency) lesson09 - 2D Sprites in 3D lesson10 - Moving in a 3D world

What do you guys think? Is my hunch that I'll be better off working with PyGame somewhat warranted?

\$\endgroup\$
1
  • 1
    \$\begingroup\$ I wouldn't go with NeHe since it's based on an old version of OpenGL. The best advice I've seen on how to get into OpenGL is found here, and it recommends starting with open.gl , which is in C++ but you can find the Python and Pyglet translation of it at: github.com/01AutoMonkey/open.gl-tutorials-to-pyglet \$\endgroup\$ Sep 18, 2014 at 16:35

3 Answers 3

8
\$\begingroup\$

Pygame doesn't even have OpenGL bindings; you'd need to use PyOpenGL with it.

If your goal is to learn OpenGL, my suggestion would be to use PyOpenGL, with Pygame. The API is closer to actual OpenGL. (I'd also recommend not using NeHe and using the SuperBible instead.)

If your goal is to make a quick game, I'd recommend pyglet. It has all the annoying OpenGL higher-level wrapper stuff written in more Python-friendly ways, e.g. batch for VBOs, groups for render state sorting.

If your goal is to make a high-quality game, I'd recommend neither. Python and OpenGL really don't go together unless you put lots of layers of C in the middle; ctypes is too slow, function calls are too slow, neither Pygame nor pyglet offers very good interfaces for audio, and neither library is really well-maintained.

\$\endgroup\$
3
  • \$\begingroup\$ I don't like C++ and absolutely hate Pointers. I enjoy Scripting languages like Python and Lua, because I know them both well. I feel like it's my only option from a technical ability standpoint. Trying to add paragraphs, but ENTER submits my edit :( I have downloaded the 1-10 NeHe tutorials for both Pyglet and PyGame, and both seem to be clear (they set up the window normally and then each uses regular glWhatever functions to handle OpenGl. From there, I just need to read the Super Bible to learn OpenGL. I don't understand why you think Python is a bad option for this. I don'twant C++ \$\endgroup\$ Nov 26, 2010 at 22:21
  • \$\begingroup\$ If you just want to learn OpenGL, pyglet or PyOpenGL with the SuperBible will be fine. If you want to make games, you will quickly hit speed limits; sooner if you don't understand memory (including pointers); sooner if you use NeHe or other fixed-function approaches. You will also find bugs in pyglet and Pygame that you can't work around without working in C or at least being comfortable with it. The reality is, if it was actually easier to make high-quality games in Python than C(++), we'd all be using Python instead of C(++). Instead you spend so much time fighting Python that it's not. \$\endgroup\$
    – user744
    Nov 26, 2010 at 22:32
  • \$\begingroup\$ I know C++, I guess I was just looking for shortcuts. I've been playing with Lua and Love2D which is awesome, just wish the beauties of 3D lighting were available in a 2D sprite setting ;) I hear you though, and will definitely consider C++, it's just brutal after playing with Scripting languages \$\endgroup\$ Nov 26, 2010 at 22:50
2
\$\begingroup\$

I would recommend PyGlet, it has both GL and GLU built in, you can also use PyOpenGL(if you're ready to type a million OpenGL calls) for the best result, download it at CheeseShop: http://pypi.python.org/pypi

\$\endgroup\$
0
\$\begingroup\$

The actual problem with opengl or directx is that it requires you to learn how to use matrices, which are another subject apart from programming. From what I'm reading, you dislike pointers and don't want C++, then I recommend you to use Panda3D, which has been made to be used with Python. It's in my opinion the best complete 3d game engine for non-programmers who like to do some gameplay as fast as possible.

Learning opengl primitives can be quite easy, but learning how to make something with it is a whole other problem. Programming is one topic, programming graphics involve to learn how to use another kind of processor with another memory, which will be harder to handle if you don't know how to use basical things like pointers.

Don't forget that python is a very good programming language because it's more on the side of the programmer, which is not the case of system language like C or C++. I don't even think we can call python a programming language, since it's more a scripting language: it's too high level.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ I wouldn't say Python isn't a programming language. Contrary to popular belief, with the right practices, Python can be Fast Enough (tm) for most (if not all) projects. \$\endgroup\$ Oct 7, 2012 at 2:34

Not the answer you're looking for? Browse other questions tagged .