Skip to content

pocketpy bindings for raylib in C11 (.c & .pyi files)

License

Notifications You must be signed in to change notification settings

pocketpy/raylib-bindings

Repository files navigation

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:

You can take these two files directly into your project.

Write a main.py file

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

cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release

./build/raylib_test

raylibw_test.png

Limitations

  • variadic functions are not supported
  • callbacks are not supported

References

License

MIT License

About

pocketpy bindings for raylib in C11 (.c & .pyi files)

Resources

License

Stars

Watchers

Forks

Releases

No releases published