2

There are many questions dealing with pyglet and pygame, but what I want to know is difference in theses two, in simple terms.

Not in technical terms, not experimental features and all that.

They are both libraries, both API, both for creation of games and multimedia apps, right?

Just in plain English, for someone like me, relative begginer, who has finished course about Python in Codecademy and read Head first Python book.

Uros de Selbi
  • 45
  • 3
  • 10
  • how about just hovering your mouse over the two tags? that's about as plain/simple as you can get – Marc B Jan 27 '16 at 17:39
  • 1
    While this is a pretty *basic* question, I disagree with the close vote - This is a question that has a definitive answer (even though it may not be very long ;) – Wayne Werner Jan 27 '16 at 17:42

3 Answers3

7

Pyglet is a wrapper around OpenGL, while Pygame is wrapper around SDL.

OpenGL is primarily concerned with 3d rendering, while SDL

is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.

Wayne Werner
  • 49,299
  • 29
  • 200
  • 290
1

PyGame is low-level library. You have to do all on your own - starting at mainloop and all functions called by mainloop. You can do it in different ways.

(And you can learn something about mainloops in Pyglet, Tkinter, PyQt, wxPython and other GUIs, not only in Python)

Pyglet is framework - it has already mainloop and you can't change it and you can't see how it works. You override functions which mainloop calls. You have to keep its rules.

furas
  • 134,197
  • 12
  • 106
  • 148
  • 2
    I'm down-voting this for two purposes. Saying you can't change the "main loop" of Pyglet is insane to say. You can always override any python function by using [Decorators](https://www.python.org/dev/peps/pep-0318/), further more have a good look at this example http://stackoverflow.com/questions/34846635/pyglet-image-rendering/34861509#34861509 where I've replaced the `mainloop` function with my own. Also `PyGame` is not a low-level library, it's a abstraction layer **ON TOP** of low level libraries such as `OpenGL`. I hope I'm not only on a rant here but it looks like you've mixed it up. – Torxed Feb 02 '16 at 17:12
  • 1
    Further more, saying that `You have to keep its rules` is absurd. Again, have a look at my example and reconsider your statement. I've written my entire `mainloop`, replaced all the "rules" that you claim is impossible to rewrite. I even create a framework out of Pyglet, on it's own it is not a framework at all since there are no UI classes or pre-defined functions for operations except for low level GL operations (such as vertices etc). – Torxed Feb 02 '16 at 17:14
-3

I've tried pyglet and pygame and rate pygame as the best .

pfaber11
  • 1
  • 2