Skip to content

Commit be6cf57

Browse files
try
1 parent 62ff73d commit be6cf57

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+8696
-4523
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
raylib-platform: ['Desktop', 'SDL']
2020
steps:
2121
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
22-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v4
2323
with:
2424
submodules: recursive
2525

@@ -34,7 +34,7 @@ jobs:
3434
sudo cmake --install .
3535
3636
- name: Setup Python
37-
uses: actions/setup-python@v2.2.2
37+
uses: actions/setup-python@v5
3838
with:
3939
# Version range or exact version of a Python version to use, using SemVer's version range syntax.
4040
python-version: ${{ matrix.python-version }}
@@ -106,7 +106,7 @@ jobs:
106106
# MACOSX_DEPLOYMENT_TARGET: 11.0
107107
# steps:
108108
# # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
109-
# - uses: actions/checkout@v2
109+
# - uses: actions/checkout@v4
110110
# with:
111111
# submodules: recursive
112112
#
@@ -121,7 +121,7 @@ jobs:
121121
# sudo cmake --install .
122122
#
123123
# - name: Setup Python
124-
# uses: actions/setup-python@v2.2.2
124+
# uses: actions/setup-python@v5
125125
# with:
126126
# # Version range or exact version of a Python version to use, using SemVer's version range syntax.
127127
# python-version: ${{ matrix.python-version }}
@@ -189,12 +189,12 @@ jobs:
189189
raylib-platform: ['Desktop', 'SDL', 'DRM']
190190
steps:
191191
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
192-
- uses: actions/checkout@v2
192+
- uses: actions/checkout@v4
193193
with:
194194
submodules: recursive
195195

196196
- name: Setup Python
197-
uses: actions/setup-python@v2.2.2
197+
uses: actions/setup-python@v5
198198
with:
199199
# Version range or exact version of a Python version to use, using SemVer's version range syntax.
200200
python-version: ${{ matrix.python-version }}
@@ -272,7 +272,7 @@ jobs:
272272
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.9', 'pypy-3.10' ]
273273
raylib-platform: ['Desktop', 'SDL']
274274
steps:
275-
- uses: actions/checkout@v2
275+
- uses: actions/checkout@v4
276276
with:
277277
submodules: recursive
278278

@@ -289,7 +289,7 @@ jobs:
289289
run: echo SDL2_DIR=${{ runner.temp }}\SDL2\cmake >> $env:GITHUB_ENV
290290

291291
- name: Setup Python
292-
uses: actions/setup-python@v2.2.2
292+
uses: actions/setup-python@v5
293293
with:
294294
# Version range or exact version of a Python version to use, using SemVer's version range syntax.
295295
python-version: ${{ matrix.python-version }}
@@ -353,12 +353,12 @@ jobs:
353353

354354
steps:
355355
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
356-
- uses: actions/checkout@v2
356+
- uses: actions/checkout@v4
357357
with:
358358
submodules: recursive
359359

360360
- name: Setup Python
361-
uses: actions/setup-python@v2.2.2
361+
uses: actions/setup-python@v5
362362
with:
363363
# Version range or exact version of a Python version to use, using SemVer's version range syntax.
364364
python-version: '3.12'
@@ -400,12 +400,12 @@ jobs:
400400

401401
steps:
402402
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
403-
- uses: actions/checkout@v2
403+
- uses: actions/checkout@v4
404404
with:
405405
submodules: recursive
406406

407407
- name: Setup Python
408-
uses: actions/setup-python@v2.2.2
408+
uses: actions/setup-python@v5
409409
with:
410410
# Version range or exact version of a Python version to use, using SemVer's version range syntax.
411411
python-version: '3.12'

README.md

Lines changed: 58 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Python Bindings for Raylib 5.0
1+
# Python Bindings for Raylib 5.5
2+
## Libraries: raymath, raygui, rlgl, physac and GLFW
3+
## Backends: Desktop, SDL, DRM, Web
24

35
Chatroom: [Discord](https://discord.gg/fKDwt85aX6) or [Matrix](https://matrix.to/#/#raylib-python-cffi:matrix.org)
46

@@ -8,23 +10,23 @@ original Raylib.
810
* Faster, fewer bugs and easier to maintain than ctypes.
911
* Commercial-friendly license.
1012
* Docstrings and auto-completion.
11-
* **Now includes extra libraries: raymath, raygui, rlgl, physac and GLFW**
13+
1214

1315
[Full documentation](http://electronstudio.github.io/raylib-python-cffi)
1416

1517
# Quickstart
1618

17-
`pip3 install raylib`
18-
19-
from pyray import *
20-
init_window(800, 450, "Hello")
21-
while not window_should_close():
22-
begin_drawing()
23-
clear_background(WHITE)
24-
draw_text("Hello world", 190, 200, 20, VIOLET)
25-
end_drawing()
26-
close_window()
27-
19+
`pip3 install raylib==5.0.0.4`
20+
```python
21+
from pyray import *
22+
init_window(800, 450, "Hello")
23+
while not window_should_close():
24+
begin_drawing()
25+
clear_background(WHITE)
26+
draw_text("Hello world", 190, 200, 20, VIOLET)
27+
end_drawing()
28+
close_window()
29+
```
2830

2931
# Installation
3032

@@ -35,13 +37,35 @@ First make sure you have the latest pip installed:
3537
Then install
3638

3739
python3 -m pip install setuptools
38-
python3 -m pip install raylib
39-
40-
On most platforms it should install a binary wheel (Windows 10 x64, MacOS 12 x64/arm64, Linux Ubuntu2004 x64/arm64).
40+
python3 -m pip install raylib==5.0.0.4
4141

42-
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.
42+
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.
4343
using homebrew, apt, etc.
4444

45+
## Windows
46+
47+
Binaries require x64 Windows 10 or newer. (For x86 or older Windows you will have to build from source.)
48+
49+
Use an [official Windows Python release](https://www.python.org/downloads/windows/) rather than WSL, MSYS, etc.
50+
51+
## MacOS
52+
53+
Binaries require arm64 MacOS 13 or x64 MacOS 12 or newer.
54+
55+
Older MacOS requires building from source but this is usually simple:
56+
57+
brew install pkg-config
58+
brew install raylib
59+
python3 -m pip install raylib==5.0.0.4
60+
61+
## Linux
62+
63+
Binaries require OS newer than Ubuntu 2020, x64 or arm64. Otherwise build from source.
64+
(Pip should attempt automatically but will need Raylib itself installed and also pkg-config.)
65+
66+
The arm64 builds are built on Raspberry Pi arm64 Bullseye
67+
so may not work on other boards.
68+
4569
## Raspberry Pi
4670

4771
[Using on Rasperry Pi](RPI.rst)
@@ -54,12 +78,23 @@ There is now a separate dynamic version of this binding:
5478

5579
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)
5680

57-
## Beta testing
81+
## SDL backend
82+
83+
This is not well tested but has better support for controllers:
84+
85+
python3 -m pip uninstall raylib
86+
python3 -m pip install raylib_sdl
87+
88+
You can't have multiple backends installed at once.
89+
90+
## DRM backend
91+
92+
This uses the Linux framebuffer for devices that don't run X11/Wayland:
5893

59-
If you find a bug, it may be fixed in the [latest dev release](https://github.com/electronstudio/raylib-python-cffi/releases).
60-
You can install an alpha or beta version by specifying the exact version number like this:
94+
python3 -m pip uninstall raylib
95+
python3 -m pip install raylib_drm
6196

62-
python3 -m pip install raylib==4.2.0.0.dev4
97+
You can't have multiple backends installed at once.
6398

6499
## Problems?
65100

@@ -143,9 +178,9 @@ A related library (that is a work in progress!):
143178
* Converting more examples from C to Python
144179
* Testing on more platforms
145180

146-
# License (updated)
181+
# License
147182

148-
The bindings are now under the Eclipse Public License, so you are free to
183+
Eclipse Public License, so you are free to
149184
statically link and use in non-free / proprietary / commercial projects!
150185

151186
# Performance

RPI.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ We have published binary wheels compiled for 64-bit Raspberry OS Bullseye in X11
1212

1313
python -m pip install --break-system-packages raylib
1414

15-
If it doesn't work, or you're not on Bullseye, or you're 32 bit, or if you want to use Raylib in ``PLATFORM_DRM`` mode, you will need to compile your own raylib. See below.
15+
Alternatively there is a DRM wheel called ``raylib_drm`` to use the framebuffer without X11. You can't have both wheels
16+
installed at once.
17+
18+
If it doesn't work, or you're not on Bullseye, or you're 32 bit, you will need to compile your own raylib. See below.
1619
For full instructions on this, see https://github.com/raysan5/raylib/wiki/Working-on-Raspberry-Pi . If you need help with this ask Raylib.
1720

1821
Option 2: Compile Raylib from source X11 mode
@@ -39,7 +42,7 @@ Then have pip compile and install the wheel:
3942
::
4043

4144
python3 -m pip install --break-system-packages setuptools
42-
python3 -m pip install --no-cache-dir --no-binary raylib --upgrade --force-reinstall --break-system-packages raylib==5.0.0.3
45+
python3 -m pip install --no-cache-dir --no-binary raylib --upgrade --force-reinstall --break-system-packages raylib==5.0.0.4
4346

4447
Option 3: Compile Raylib from source DRM mode
4548
---------------------------------------------
@@ -82,7 +85,7 @@ Then have pip compile and install the wheel:
8285
::
8386

8487
python3 -m pip install --break-system-packages setuptools
85-
python3 -m pip install --no-cache-dir --no-binary raylib --upgrade --force-reinstall --break-system-packages raylib==5.0.0.3
88+
python3 -m pip install --no-cache-dir --no-binary raylib --upgrade --force-reinstall --break-system-packages raylib==5.0.0.4
8689

8790

8891

create_stub_pyray.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ def ctype_to_python_type(t):
6363
print("""from typing import Any
6464
6565
66-
def pointer(struct):
67-
...
6866
""")
6967

7068
# These words can be used for c arg names, but not in python
@@ -137,7 +135,7 @@ def pointer(struct):
137135
# elif ffi.typeof(struct).kind == "enum":
138136
# print(f"{struct}: int")
139137
else:
140-
print("ERROR UNKNOWN TYPE", ffi.typeof(struct), file=sys.stderr)
138+
print("WARNING: SKIPPING UNKNOWN TYPE", ffi.typeof(struct), file=sys.stderr)
141139

142140
print("""
143141
LIGHTGRAY : Color

create_stub_static.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class struct: ...
133133
elif ffi.typeof(struct).kind == "enum":
134134
print(f"{struct}: int")
135135
else:
136-
print("ERROR UNKNOWN TYPE", ffi.typeof(struct), file=sys.stderr)
136+
print("WARNING: SKIPPING UNKNOWN TYPE", ffi.typeof(struct), file=sys.stderr)
137137

138138

139139
print("""

docs/.buildinfo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
2-
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 614f580883a5bffb7f1606004f7be223
2+
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
3+
config: 6b88b88b20947586d6498748ffd23a92
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

docs/BUILDING.html

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2+
13
<!DOCTYPE html>
24
<html class="writer-html5" lang="en" data-content_root="./">
35
<head>
@@ -6,19 +8,15 @@
68
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
79
<title>Building from source &mdash; Raylib Python documentation</title>
810
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
9-
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=19f00094" />
10-
<link rel="stylesheet" type="text/css" href="_static/graphviz.css?v=fd3f3429" />
11+
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />
12+
<link rel="stylesheet" type="text/css" href="_static/graphviz.css?v=4ae1632d" />
1113

1214

13-
<!--[if lt IE 9]>
14-
<script src="_static/js/html5shiv.min.js"></script>
15-
<![endif]-->
16-
17-
<script src="_static/jquery.js?v=5d32c60e"></script>
18-
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
19-
<script src="_static/documentation_options.js?v=5929fcd5"></script>
20-
<script src="_static/doctools.js?v=9a2dae69"></script>
21-
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
15+
<script src="_static/jquery.js?v=5d32c60e"></script>
16+
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
17+
<script src="_static/documentation_options.js?v=5929fcd5"></script>
18+
<script src="_static/doctools.js?v=9bcbadda"></script>
19+
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
2220
<script src="_static/js/theme.js"></script>
2321
<link rel="index" title="Index" href="genindex.html" />
2422
<link rel="search" title="Search" href="search.html" />
@@ -47,15 +45,15 @@
4745
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
4846
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
4947
<ul class="current">
50-
<li class="toctree-l1"><a class="reference internal" href="README.html">Python Bindings for Raylib 5.0</a></li>
48+
<li class="toctree-l1"><a class="reference internal" href="README.html">Python Bindings for Raylib 5.5</a></li>
5149
<li class="toctree-l1"><a class="reference internal" href="README.html#quickstart">Quickstart</a></li>
5250
<li class="toctree-l1"><a class="reference internal" href="README.html#installation">Installation</a></li>
5351
<li class="toctree-l1"><a class="reference internal" href="README.html#how-to-use">How to use</a></li>
5452
<li class="toctree-l1"><a class="reference internal" href="README.html#running-in-a-web-browser">Running in a web browser</a></li>
5553
<li class="toctree-l1"><a class="reference internal" href="README.html#app-showcase">App showcase</a></li>
5654
<li class="toctree-l1"><a class="reference internal" href="README.html#rlzero">RLZero</a></li>
5755
<li class="toctree-l1"><a class="reference internal" href="README.html#help-wanted">Help wanted</a></li>
58-
<li class="toctree-l1"><a class="reference internal" href="README.html#license-updated">License (updated)</a></li>
56+
<li class="toctree-l1"><a class="reference internal" href="README.html#license">License</a></li>
5957
<li class="toctree-l1"><a class="reference internal" href="README.html#performance">Performance</a></li>
6058
<li class="toctree-l1"><a class="reference internal" href="README.html#packaging-your-app">Packaging your app</a></li>
6159
<li class="toctree-l1"><a class="reference internal" href="README.html#advert">Advert</a></li>

0 commit comments

Comments
 (0)