https://github.com/pocketpy/raylib-bindings
pocketpy bindings for raylib in C11 (.c & .pyi files)
https://github.com/pocketpy/raylib-bindings
Last synced: about 1 year ago
JSON representation
pocketpy bindings for raylib in C11 (.c & .pyi files)
- Host: GitHub
- URL: https://github.com/pocketpy/raylib-bindings
- Owner: pocketpy
- License: mit
- Created: 2023-09-29T15:00:21.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-04T05:54:52.000Z (over 1 year ago)
- Last Synced: 2025-05-01T17:56:28.272Z (about 1 year ago)
- Language: C
- Homepage:
- Size: 64.5 KB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# raylib-bindings
This repo contains pocketpy bindings for raylib.
**Current raylib version: `5.1-dev`**
## Requirements
+ Python 3.9 or higher
## Generate raylib's bindings
```
pip install pycparser
python gen_raylib.py
```
This generates two files:
+ [output/raylib.c](https://github.com/pocketpy/raylib-bindings/blob/main/output/raylib.c)
+ [output/raylib.pyi](https://github.com/pocketpy/raylib-bindings/blob/main/output/raylib.pyi)
You can take these two files directly into your project.
## Write a `main.py` file
```python
import raylib as rl
rl.InitWindow(800, 450, "raylib [core] example - basic window")
RAYWHITE = rl.Color(34, 34, 34, 255)
LIGHTGRAY = rl.Color(200, 200, 200, 255)
while not rl.WindowShouldClose():
rl.BeginDrawing()
rl.ClearBackground(RAYWHITE)
rl.DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY)
rl.EndDrawing()
rl.CloseWindow()
```
## Build the example
```bash
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release
./build/raylib_test
```

## Limitations
+ variadic functions are not supported
+ callbacks are not supported
## References
+ [pocketpy](https://github.com/pocketpy/pocketpy)
+ [raylib](https://github.com/raysan5/raylib)
## License
MIT License