What is pyglet
pyglet is a Python library designed for creating games and multimedia applications across Windows, macOS, and Linux platforms. It offers support for windowing, input devices, image and video display, and audio playback, all through a Pythonic API that is both intuitive and powerful. With direct access to OpenGL bindings and user-friendly abstractions for advanced graphics, pyglet is a robust tool for both novice and experienced developers.
pyglet Features
-
No External Dependencies: pyglet requires no additional installations beyond Python, simplifying the distribution and installation process. This makes it easy to package your project using tools like PyInstaller or even create a zipapp.
-
Flexible Native Windowing: Offers platform-native windows, allowing for multiple windows and multi-monitor setups. Developers have full control over window display, including full-screen and windowed modes.
-
Built-in Support for Loading Images and Audio: Includes decoders for standard formats like wav, png, and bmp, with optional support for additional formats via FFmpeg.
-
Written in Pure Python: Entirely written in Python, utilizing the ctypes module for system library interfacing. This allows for easy code modification and contribution without needing compilation or other languages.
-
Extensive Input Support: Supports a wide range of input devices, including joysticks and modern game controllers, with features like rumble and automatic button mapping. The ControllerManager facilitates easy hot-plugging of controllers.