Simple 2D game library using PySDL2 and modern OpenGL


License
MIT
Install
pip install mgl2d==0.9.9

Documentation

MGL2D

MGL2D (Modern GL 2D) is a simple library to give access to modern OpenGL to Python games.

MGL2D is licensed under the terms of the MIT License. See LICENSE for details of the usage license granted to you for this code.

HIGHLIGHTS

  • Based on PyOpenGL and SDL2
  • Super easy setup: create a window and a game loop in less than 10 lines of code
  • Shader support: Vertex, Geometry, Fragment
  • Textures: RGB/RGBA support via Pillow
  • Input handling: keyboard and joysticks
  • Multi-step fullscreen post-processing made easy!
  • Basic support for shapes: lines, polylines and [approximated] circles
  • Basic support of bitmap fonts in BMFont format
  • Support for 2D sprite-based animations
  • Support for Tiled 2D maps (TMX)
  • Developed and tested on MacOS using OpenGL 4.1

TODO

  • Support for joysticks hot-plugging

INSTALL

pip install mgl2d

DEPENDENCIES

SDL 2.0 (www.libsdl.org)
PyOpenGL (http://pyopengl.sourceforge.net)
Numpy (http://www.numpy.org)
PyTMX (https://github.com/bitcraft/PyTMX)
Pillow

LATEST SOURCE

MGL2D is hosted on Github (https://github.com/maxfish/mgl2d). You can check out the latest version of the source code with Git:

git clone https://github.com/maxfish/mgl2d.git mgl2d