A GPU-accelerated 2D game engine for Python with camera, drawing and packaging helpers.
Project description
PyBitEngine ⚡
A GPU-accelerated 2D game engine for Python, built on SDL2, ModernGL, NumPy and Numba.
PyBitEngine helps developers draw thousands of 2D objects efficiently while keeping the API simple. It uses instanced GPU rendering, texture atlases, and Numba kernels to reduce runtime overhead.
📦 Version: 0.1.3
This release brings major new features: a unified collision system, mouse helpers, rounded shapes, pixel‑perfect texture collisions, a texture atlas, depth sorting, performance optimizations, and a complete timer module.
What is new in 0.1.3
- Unified collision system —
CheckCollisionworks with any combination of immutable shapes (Rect,Circle,Ellipse,Triangle,Line,RotRect,RoundedRect,Polygon,TextureCollider). Zero object creation overhead. - Mouse helpers —
MouseOver,MousePressed,MouseClicked,MouseHeld,MouseDragging,MouseWheelOnwork directly with any shape and optionally with a camera for world-space picking. - Full rounded shapes —
DrawRoundedRect,DrawRoundedTriangleand their outline variants, with GPU-instanced batch versions (DrawRoundedRectsBatch,DrawRoundedTrianglesBatch). - Pixel‑perfect texture collisions —
CollidePointTextureandCollidePointTextureBatchuse the alpha channel stored on the CPU (no GPU readback, no disk I/O at runtime). - Texture atlas —
LoadTextureAtlasinserts an image into the shared atlas;DrawSpritesBatchcan then render thousands of sprites from the same atlas in one draw call. - Easy‑to‑use batch wrappers —
DrawRects,DrawLines,DrawCircles,DrawEllipses,DrawSprites,DrawTextsaccept lists of tuples with the same parameters as their immediate counterparts. No NumPy knowledge required. - Early‑Z / depth sorting —
enable_early_z()and thebegin_opaque_pass()/begin_transparent_pass()helpers let you sort opaque objects front‑to‑back and transparent objects back‑to‑front, dramatically reducing overdraw. - Performance boost — color packing in uint32, pre‑computed cos/sin on the CPU, optimized Numba kernels, and fewer allocations make batch rendering faster than ever.
- Complete key constants — all keyboard and mouse constants are now exported, including previously missing ones like
PE_K_CAPSLOCK,PE_K_NUMLOCK,PE_K_PRINTSCREEN,PE_K_LSUPER, etc. - PE_TIME module — non‑blocking timers:
Scheduler,After,Every,Countdown,Cooldown,Stopwatch, plusAsyncTimer/AsyncAfterfor background work withRunOnMainThreadandPumpMainThread. - PE_PAKER module —
pack()creates standalone executables usingcx_Freeze, with automatic inclusion of assets and dependencies. - CameraGPU and CameraCPU — both now support smooth follow, screen‑shake, world bounds, coordinate conversion (
screen_to_world/world_to_screen), and batch culling (is_visible_batch). The shake offset is now zero‑mean (no net drift). - Painter’s algorithm fixed —
DrawTexturenow participates in the same batching system as primitives, so draw calls appear in the exact order they are issued.
🚀 Installation
pip install pybitengine
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pybitengine-0.1.3a1.tar.gz.
File metadata
- Download URL: pybitengine-0.1.3a1.tar.gz
- Upload date:
- Size: 108.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73576a3faf890e54f23ec321282f8c7c5692617278c7d162bb88d84ee09fc6fa
|
|
| MD5 |
9b9ff63fd3604f056dbf4f6ef9a0e0e2
|
|
| BLAKE2b-256 |
56c22e21b62755576e8284607964a1add7348c5b9009a7219e00ffa8333ca5e3
|
File details
Details for the file pybitengine-0.1.3a1-py3-none-any.whl.
File metadata
- Download URL: pybitengine-0.1.3a1-py3-none-any.whl
- Upload date:
- Size: 108.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87cc5e3178f4c68398e3b260f24b6cddda352e8335875a237361f0468613cbaf
|
|
| MD5 |
aaf8cb36ab689c1874cd88d238e79ee1
|
|
| BLAKE2b-256 |
5d3a85f9b7eaf693501fb76087856149671f5fe2eff6df4c0f68b67ca1e9521d
|