Skip to content

Cyclone is a blazingly fast and simple to use 2D graphics library for Python. Written in Cython, Python, and OpenGL.

License

Notifications You must be signed in to change notification settings

williamhCode/cyclone

Repository files navigation

Cyclone

A 2D graphics library written in Cython, Python, and OpenGL.

Motivation

There are many great 2D python graphics libraries like pygame, pyglet, and arcade. However, they either lack in performance, have a steep learning curve, or have issues with macOS (memory leaks and high dpi rendering). The purpose of the library is to provide a blazingly fast Python 2D graphics library that is, at the same time, easy to use and pick up.

The library is built with simplicity and modularity in mind. It takes care of windowing and input, everything you need for 2d rendering, and things useful for game dev. However, you can opt out of using built-in data types, and use other libraries for math related stuff (vectors, shapes and collisions).

Features:

  • blazingly fast (90,000 textures at 60fps)*
  • texture/primitive rendering with built-in rotation/offset
  • high-dpi support (macos)
  • minimizes cpu load by offloading most calculations to the GPU (python is slow and hard to parallelize)
  • multiple windows

*: tested on m1 macbook pro

Todo

Not active, building a library from Cython alone is too hard to maintain due to lack of proper tooling and language quirks.

  • rendering
    • textures
    • circles
    • rectangles
    • lines
    • polygons
    • render texture (framebuffer)
    • fonts
    • rendering options (blend, render to stencil buffer, etc.)
    • custom shaders
  • windowing
    • keyboard and mouse input
    • multi window
    • more window options (fullscreen, resizable, etc.)
  • math
    • vector/matrix classes
    • shapes
    • simple collision detection
  • build for linux and windows
  • upload to pypi
  • documentation
  • convert OpenGL to WebGPU for future proofing?

Contributing

Clone Repo

git clone --recurse-submodule https://github.com/williamhCode/cyclone.git

Install Python Modules

pip install -r requirements.txt

Build Cyclone

python setup.py build_ext --inplace

You can control the build mode in setup.py. You only need to run with build_libs option once, which builds the c libraries.

Install Library in Dev Mode

pip install -e .

Run Docs

mkdocs serve

About

Cyclone is a blazingly fast and simple to use 2D graphics library for Python. Written in Cython, Python, and OpenGL.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published