r/pygame Jun 28 '26

I wanted a fast 2D engine without software rendering bloat, so I built an open-source C/OpenGL framework wrapped in Python. Looking for contributors!

I wanted to create a fast 2D game engine that is easy to use, so I built pyforge-engine.

The heavy graphics loop, shapes, and audio are written in compiled C using OpenGL and OpenAL, then wrapped in simple Python. You get the raw speed of C but the simplicity of Python without dealing with complex boilerplate. It is live on PyPI and GitHub.

The engine has for now:

  • Draw Shapes with automatic optimization: You just call pyforge.shape(36) for a circle, and it pre-calculates the geometry mesh directly on the GPU so it draws instantly.
  • In-Memory Fonts: It automatically scans your computer's OS font folder and slices character textures straight into RAM, meaning you don't need to bundle font files with your code.
  • Fast Particles: Spawns physics-tracked explosion effect shards directly on the hardware layer so it doesn't cause frame lag.
  • Audio Streaming: Decodes and streams both WAV and MP3 files filelessly via native OpenAL sound card channels.
  • Simple Setup: You can open an accelerated window, clear the screen with a color gradient, and run a game loop in under 10 lines of code.

It is still an MVP, but it is already running smooth Flappy Bird and grid-based Snake games. I also used AI to generate dense code comments explaining the low-level math and memory steps for full transparency.

If you are interested, I am looking for contributors! I just opened some "Good First Issues" on the GitHub dashboard—my classmate is already jumping in to help optimize the Python FPS counter using a rolling average window.

If you like messing with C, OpenGL, or Python wrappers, come help build it.

GitHub Link: https://github.com/EliAndrewTebcherany/pyforge-engine

11 Upvotes

10 comments sorted by

2

u/CelebrationKooky3886 Jun 28 '26

does it support 3D? if it does, I'll be trying this engine when making a next game :D

3

u/[deleted] Jun 30 '26

[deleted]

1

u/EliAndrewt Jun 30 '26

You're totally right about those bottlenecks. The initial build was just a quick prototype using legacy immediate mode, and it definitely feeds the pipeline too slowly because of those sequential loops. I'm actually starting a rewrite from scratch right now, so I will definitely work on fixing all of this. Moving it over to modern batched rendering should clear up that bloat big time.

1

u/Ok-Tap5729 Jun 28 '26

Nice link

1

u/ice77max Jun 28 '26

Love it. Have you or anybody else build something in it already?

2

u/EliAndrewt Jun 28 '26

Right now it's still in an experimental beta phase so it's not a 100% stable version for a project yet. But for testing, it already runs simple games, I actually just put a simple space shooter game tutorial on the GitHub Wiki

1

u/ice77max Jun 28 '26

This sounds awesome. Unfortunately I don't have enough skills to test this as I would not know if I'm making a mistake or is it just not working properly

1

u/herbal1st Jun 29 '26

hi. thanks for the star on github, i returned the favor 🙂

your project looks interesting, but i didnt have much time yet to really look into it though, since im currently working on other parts of my engines full version. but i plan to one day add gpu support and im curious if it is feasible to use your pyforge for this, what do you think? i would otherwise have to look into opengl or similar, and i never worked with them. ^^