This commit is contained in:
Richard Smith 2024-10-17 15:58:59 +01:00
parent cfad3eacaa
commit 1817fec006
16 changed files with 287 additions and 217 deletions

View file

@ -38,7 +38,7 @@ project.
If the Pip build doesnt work, please submit a bug. (And if you have
fixed it, a PR.)
Manual instructions follow, but may be outdated, so see also how we actually build the wheels
Manual instructions follow, but are probably outdated, so see instead how we actually build the wheels
at https://github.com/electronstudio/raylib-python-cffi/blob/master/.github/workflows/build.yml
Windows manual build

View file

@ -2,7 +2,7 @@
## Libraries: raymath, raygui, rlgl, physac and GLFW
## Backends: Desktop, SDL, DRM, Web
Chatroom: [Discord](https://discord.gg/fKDwt85aX6) or [Matrix](https://matrix.to/#/#raylib-python-cffi:matrix.org)
Chatroom: [Discord](https://discord.gg/fKDwt85aX6)
New CFFI API static bindings.
* Automatically generated to be as close as possible to
@ -39,7 +39,8 @@ Then install
python3 -m pip install setuptools
python3 -m pip install raylib==5.0.0.4
On most platforms it should install a binary wheel. If yours isn't available then pip will attempt to build from source, in which case you will need to have Raylib development libs installed, e.g.
On most platforms it should install a binary wheel. If yours isn't available then pip will attempt to build from
source, in which case you will need to have Raylib development libs installed, e.g.
using homebrew, apt, etc.
## Windows
@ -50,7 +51,9 @@ Use an [official Windows Python release](https://www.python.org/downloads/window
## MacOS
Binaries require arm64 MacOS 13 or x64 MacOS 12 or newer.
Binaries require:
* arm64 MacOS 14
* x64 MacOS 10.13, or newer.
Older MacOS requires building from source but this is usually simple:
@ -58,12 +61,15 @@ Older MacOS requires building from source but this is usually simple:
brew install raylib
python3 -m pip install raylib==5.0.0.4
(I do have binaries for arm64 MacOS 11, 12 and 13 but I have no way of testing they work, so post an issue
if you want to test them.)
## Linux
Binaries require OS newer than Ubuntu 2020, x64 or arm64. Otherwise build from source.
(Pip should attempt automatically but will need Raylib itself installed and also pkg-config.)
The arm64 builds are built on Raspberry Pi arm64 Bullseye
The arm64 binaries are built on Raspberry Pi arm64 Bullseye with OpenGL 2.0
so may not work on other boards.
## Raspberry Pi
@ -74,6 +80,7 @@ so may not work on other boards.
There is now a separate dynamic version of this binding:
python3 -m pip uninstall raylib
python3 -m pip install raylib_dynamic
It works on some systems where the static version doesn't, [but be sure to read these caveats before using it](https://electronstudio.github.io/raylib-python-cffi/dynamic.html)
@ -85,7 +92,7 @@ This is not well tested but has better support for controllers:
python3 -m pip uninstall raylib
python3 -m pip install raylib_sdl
You can't have multiple backends installed at once.
You can't have multiple raylib packages installed at once.
## DRM backend
@ -94,29 +101,31 @@ This uses the Linux framebuffer for devices that don't run X11/Wayland:
python3 -m pip uninstall raylib
python3 -m pip install raylib_drm
You can't have multiple backends installed at once.
You can't have multiple raylib packages installed at once.
## Problems?
If it doesn't work, [try to build manually.](BUILDING.rst). If that works then [submit an issue](https://github.com/electronstudio/raylib-python-cffi/issues)
to let us know what you did.
If you need help you can try asking [on Discord](https://discord.gg/raylib).
If you need help you can try asking on [our discord](https://discord.gg/fKDwt85aX6). There is also a large [Raylib discord](https://discord.gg/raylib)
for issues that are not Python-specific.
If it still doesn't work, [submit an issue](https://github.com/electronstudio/raylib-python-cffi/issues).
# How to use
There are two APIs, you can use either or both:
There are two modules in the raylib package, `raylib` and `pyray`. (There is no separate package for
pyray). You can use either or both:
### If you are familiar with C coding and the Raylib C library and you want to use an exact copy of the C API
Use [the C API](https://electronstudio.github.io/raylib-python-cffi/raylib.html).
Use [the raylib module](https://electronstudio.github.io/raylib-python-cffi/raylib.html).
### If you prefer a slightly more Pythonistic API and don't mind it might be slightly slower
### If you prefer a more Pythonistic API
Use [the Python API](https://electronstudio.github.io/raylib-python-cffi/pyray.html).
Use [the pyray module](https://electronstudio.github.io/raylib-python-cffi/pyray.html).
# Running in a web browser

View file

@ -56,7 +56,6 @@ Example program:
init_window(800, 450, "Raylib texture test")
...
(You don't need to use the PyRay() class anymore.)
`See all examples here <https://github.com/electronstudio/raylib-python-cffi/tree/master/examples>`_