update docs

This commit is contained in:
Richard Smith 2024-07-02 15:43:33 +01:00
parent 57da96d576
commit 7af2922eb3
7 changed files with 48 additions and 45 deletions

View file

@ -37,7 +37,7 @@ Then install
python3 -m pip install setuptools python3 -m pip install setuptools
python3 -m pip install raylib python3 -m pip install raylib
On most platforms it should install a binary wheel (Windows 10 x64, MacOS 10.15 x64, Linux Ubuntu1804 x64). On most platforms it should install a binary wheel (Windows 10 x64, MacOS 12 x64/arm64, Linux Ubuntu2004 x64/arm64).
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. 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. using homebrew, apt, etc.
@ -158,7 +158,7 @@ If you need more performance, do in this order:
in your update loop in your update loop
and then only convert them to C data structures when you have to call the C functions for drawing. and then only convert them to C data structures when you have to call the C functions for drawing.
3. The raylib.* functions are potentially 1.5x faster than the pyray.* equivalents, so if you need a tiny bit more performance 3. The raylib.* functions are potentially *slightly* faster than the pyray.* equivalents, so if you need a tiny bit more performance
you can switch your inner loop functions to these. you can switch your inner loop functions to these.
4. There is a version of Python that is faster than Pypy: GraalPy. However it's not fully compatible with all Python 4. There is a version of Python that is faster than Pypy: GraalPy. However it's not fully compatible with all Python

25
RPI.rst
View file

@ -1,7 +1,7 @@
Raspberry Pi Raspberry Pi
==================== ====================
Please use Raspberry Pi OS Bullseye. Older OSes are not tested. Please use Raspberry Pi OS Bookworm. Bullseye should also work. Older OSes are not tested.
Option 1: Binary wheel Option 1: Binary wheel
---------------------- ----------------------
@ -10,7 +10,7 @@ We have published binary wheels compiled for 64-bit Raspberry OS Bullseye in X11
:: ::
python -m pip install raylib python -m pip install --break-system-packages raylib
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. 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.
For full instructions on this, see https://github.com/raysan5/raylib/wiki/Working-on-Raspberry-Pi . If you need help with this ask Raylib. For full instructions on this, see https://github.com/raysan5/raylib/wiki/Working-on-Raspberry-Pi . If you need help with this ask Raylib.
@ -22,6 +22,8 @@ This should work for everyone.
:: ::
sudo apt update
sudo python3-pip cmake libegl1-mesa-dev libgbm-dev libgles2-mesa-dev libdrm-dev libglfw3-dev
git clone https://github.com/raysan5/raylib.git --branch 5.0 --single-branch git clone https://github.com/raysan5/raylib.git --branch 5.0 --single-branch
cd raylib cd raylib
mkdir build mkdir build
@ -30,24 +32,24 @@ This should work for everyone.
cmake -DPLATFORM="Desktop" -DOPENGL_VERSION=2.1 -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release .. cmake -DPLATFORM="Desktop" -DOPENGL_VERSION=2.1 -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release ..
make make
sudo make install sudo make install
sudo cp -r ../src/external/glfw/include/GLFW /usr/local/include/
Then have pip compile and install the wheel: Then have pip compile and install the wheel:
:: ::
sudo apt update python -m pip install --break-system-packages setuptools
sudo apt install python3-pip python -m pip install --no-cache-dir --no-binary raylib --upgrade --force-reinstall --break-system-packages raylib==5.0.0.3
pip3 install setuptools
pip3 install --no-cache-dir --no-binary raylib --upgrade --force-reinstall raylib==5.0.0.2
Option 3: Compile Raylib from source DRM mode Option 3: Compile Raylib from source DRM mode
--------------------------------------------- ---------------------------------------------
As far as I can tell, Raylib DRM is broken. It doesn't work on my Pi. However, if you want to compile it and This seems to work on Raspberry Pi 4. Note you must not be running X11 when you run your programs.
give it a go, these are the commands:
:: ::
sudo apt update
sudo python3-pip cmake libegl1-mesa-dev libgbm-dev libgles2-mesa-dev libdrm-dev libglfw3-dev
git clone https://github.com/raysan5/raylib.git --branch 5.0 --single-branch git clone https://github.com/raysan5/raylib.git --branch 5.0 --single-branch
cd raylib cd raylib
mkdir build mkdir build
@ -56,15 +58,14 @@ give it a go, these are the commands:
cmake -DPLATFORM="DRM" -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release .. cmake -DPLATFORM="DRM" -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release ..
make make
sudo make install sudo make install
sudo cp -r ../src/external/glfw/include/GLFW /usr/local/include/
Then have pip compile and install the wheel with some extra linker flags: Then have pip compile and install the wheel with some extra linker flags:
:: ::
sudo apt update python -m pip install --break-system-packages setuptools
sudo apt install python3-pip LDFLAGS="-lgbm -ldrm -lEGL" pip3 install --no-cache-dir --no-binary raylib --upgrade --force-reinstall --break-system-packages raylib==5.0.0.3
pip3 install setuptools
LDFLAGS="-lgbm -ldrm -lEGL" pip3 install --no-cache-dir --no-binary raylib --upgrade --force-reinstall raylib==5.0.0.2

View file

@ -143,7 +143,7 @@ close_window()
python3 -m pip install raylib python3 -m pip install raylib
</pre></div> </pre></div>
</div> </div>
<p>On most platforms it should install a binary wheel (Windows 10 x64, MacOS 10.15 x64, Linux Ubuntu1804 x64).</p> <p>On most platforms it should install a binary wheel (Windows 10 x64, MacOS 12 x64/arm64, Linux Ubuntu2004 x64/arm64).</p>
<p>If yours isnt available then pip will attempt to build from source, in which case you will need to have Raylib development libs installed, e.g. <p>If yours isnt 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.</p> using homebrew, apt, etc.</p>
<section id="raspberry-pi"> <section id="raspberry-pi">
@ -255,7 +255,7 @@ statically link and use in non-free / proprietary / commercial projects!</p>
<li><p>Every call to C is costly, so its slightly faster if you use Python data structures and functions when calculating <li><p>Every call to C is costly, so its slightly faster if you use Python data structures and functions when calculating
in your update loop in your update loop
and then only convert them to C data structures when you have to call the C functions for drawing.</p></li> and then only convert them to C data structures when you have to call the C functions for drawing.</p></li>
<li><p>The raylib.* functions are potentially 1.5x faster than the pyray.* equivalents, so if you need a tiny bit more performance <li><p>The raylib.* functions are potentially <em>slightly</em> faster than the pyray.* equivalents, so if you need a tiny bit more performance
you can switch your inner loop functions to these.</p></li> you can switch your inner loop functions to these.</p></li>
<li><p>There is a version of Python that is faster than Pypy: GraalPy. However its not fully compatible with all Python <li><p>There is a version of Python that is faster than Pypy: GraalPy. However its not fully compatible with all Python
packages. It doesnt work with CFFI and so doesnt work with this binding. But it <em>is</em> compatible with the packages. It doesnt work with CFFI and so doesnt work with this binding. But it <em>is</em> compatible with the

View file

@ -96,11 +96,11 @@
<section id="raspberry-pi"> <section id="raspberry-pi">
<h1>Raspberry Pi<a class="headerlink" href="#raspberry-pi" title="Link to this heading"></a></h1> <h1>Raspberry Pi<a class="headerlink" href="#raspberry-pi" title="Link to this heading"></a></h1>
<p>Please use Raspberry Pi OS Bullseye. Older OSes are not tested.</p> <p>Please use Raspberry Pi OS Bookworm. Bullseye should also work. Older OSes are not tested.</p>
<section id="option-1-binary-wheel"> <section id="option-1-binary-wheel">
<h2>Option 1: Binary wheel<a class="headerlink" href="#option-1-binary-wheel" title="Link to this heading"></a></h2> <h2>Option 1: Binary wheel<a class="headerlink" href="#option-1-binary-wheel" title="Link to this heading"></a></h2>
<p>We have published binary wheels compiled for 64-bit Raspberry OS Bullseye in X11 mode.</p> <p>We have published binary wheels compiled for 64-bit Raspberry OS Bullseye in X11 mode.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">python</span> <span class="o">-</span><span class="n">m</span> <span class="n">pip</span> <span class="n">install</span> <span class="n">raylib</span> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">python</span> <span class="o">-</span><span class="n">m</span> <span class="n">pip</span> <span class="n">install</span> <span class="o">--</span><span class="k">break</span><span class="o">-</span><span class="n">system</span><span class="o">-</span><span class="n">packages</span> <span class="n">raylib</span>
</pre></div> </pre></div>
</div> </div>
<p>If it doesnt work, or youre not on Bullseye, or youre 32 bit, or if you want to use Raylib in <code class="docutils literal notranslate"><span class="pre">PLATFORM_DRM</span></code> mode, you will need to compile your own raylib. See below. <p>If it doesnt work, or youre not on Bullseye, or youre 32 bit, or if you want to use Raylib in <code class="docutils literal notranslate"><span class="pre">PLATFORM_DRM</span></code> mode, you will need to compile your own raylib. See below.
@ -109,7 +109,9 @@ For full instructions on this, see <a class="reference external" href="https://g
<section id="option-2-compile-raylib-from-source-x11-mode"> <section id="option-2-compile-raylib-from-source-x11-mode">
<h2>Option 2: Compile Raylib from source X11 mode<a class="headerlink" href="#option-2-compile-raylib-from-source-x11-mode" title="Link to this heading"></a></h2> <h2>Option 2: Compile Raylib from source X11 mode<a class="headerlink" href="#option-2-compile-raylib-from-source-x11-mode" title="Link to this heading"></a></h2>
<p>This should work for everyone.</p> <p>This should work for everyone.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">git</span> <span class="n">clone</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">raysan5</span><span class="o">/</span><span class="n">raylib</span><span class="o">.</span><span class="n">git</span> <span class="o">--</span><span class="n">branch</span> <span class="mf">5.0</span> <span class="o">--</span><span class="n">single</span><span class="o">-</span><span class="n">branch</span> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">apt</span> <span class="n">update</span>
<span class="n">sudo</span> <span class="n">python3</span><span class="o">-</span><span class="n">pip</span> <span class="n">cmake</span> <span class="n">libegl1</span><span class="o">-</span><span class="n">mesa</span><span class="o">-</span><span class="n">dev</span> <span class="n">libgbm</span><span class="o">-</span><span class="n">dev</span> <span class="n">libgles2</span><span class="o">-</span><span class="n">mesa</span><span class="o">-</span><span class="n">dev</span> <span class="n">libdrm</span><span class="o">-</span><span class="n">dev</span> <span class="n">libglfw3</span><span class="o">-</span><span class="n">dev</span>
<span class="n">git</span> <span class="n">clone</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">raysan5</span><span class="o">/</span><span class="n">raylib</span><span class="o">.</span><span class="n">git</span> <span class="o">--</span><span class="n">branch</span> <span class="mf">5.0</span> <span class="o">--</span><span class="n">single</span><span class="o">-</span><span class="n">branch</span>
<span class="n">cd</span> <span class="n">raylib</span> <span class="n">cd</span> <span class="n">raylib</span>
<span class="n">mkdir</span> <span class="n">build</span> <span class="n">mkdir</span> <span class="n">build</span>
<span class="n">rm</span> <span class="o">-</span><span class="n">rf</span> <span class="n">build</span><span class="o">/*</span> <span class="n">rm</span> <span class="o">-</span><span class="n">rf</span> <span class="n">build</span><span class="o">/*</span>
@ -117,21 +119,21 @@ For full instructions on this, see <a class="reference external" href="https://g
<span class="n">cmake</span> <span class="o">-</span><span class="n">DPLATFORM</span><span class="o">=</span><span class="s2">&quot;Desktop&quot;</span> <span class="o">-</span><span class="n">DOPENGL_VERSION</span><span class="o">=</span><span class="mf">2.1</span> <span class="o">-</span><span class="n">DBUILD_EXAMPLES</span><span class="o">=</span><span class="n">OFF</span> <span class="o">-</span><span class="n">DCUSTOMIZE_BUILD</span><span class="o">=</span><span class="n">ON</span> <span class="o">-</span><span class="n">DSUPPORT_FILEFORMAT_JPG</span><span class="o">=</span><span class="n">ON</span> <span class="o">-</span><span class="n">DSUPPORT_FILEFORMAT_FLAC</span><span class="o">=</span><span class="n">ON</span> <span class="o">-</span><span class="n">DWITH_PIC</span><span class="o">=</span><span class="n">ON</span> <span class="o">-</span><span class="n">DCMAKE_BUILD_TYPE</span><span class="o">=</span><span class="n">Release</span> <span class="o">..</span> <span class="n">cmake</span> <span class="o">-</span><span class="n">DPLATFORM</span><span class="o">=</span><span class="s2">&quot;Desktop&quot;</span> <span class="o">-</span><span class="n">DOPENGL_VERSION</span><span class="o">=</span><span class="mf">2.1</span> <span class="o">-</span><span class="n">DBUILD_EXAMPLES</span><span class="o">=</span><span class="n">OFF</span> <span class="o">-</span><span class="n">DCUSTOMIZE_BUILD</span><span class="o">=</span><span class="n">ON</span> <span class="o">-</span><span class="n">DSUPPORT_FILEFORMAT_JPG</span><span class="o">=</span><span class="n">ON</span> <span class="o">-</span><span class="n">DSUPPORT_FILEFORMAT_FLAC</span><span class="o">=</span><span class="n">ON</span> <span class="o">-</span><span class="n">DWITH_PIC</span><span class="o">=</span><span class="n">ON</span> <span class="o">-</span><span class="n">DCMAKE_BUILD_TYPE</span><span class="o">=</span><span class="n">Release</span> <span class="o">..</span>
<span class="n">make</span> <span class="n">make</span>
<span class="n">sudo</span> <span class="n">make</span> <span class="n">install</span> <span class="n">sudo</span> <span class="n">make</span> <span class="n">install</span>
<span class="n">sudo</span> <span class="n">cp</span> <span class="o">-</span><span class="n">r</span> <span class="o">../</span><span class="n">src</span><span class="o">/</span><span class="n">external</span><span class="o">/</span><span class="n">glfw</span><span class="o">/</span><span class="n">include</span><span class="o">/</span><span class="n">GLFW</span> <span class="o">/</span><span class="n">usr</span><span class="o">/</span><span class="n">local</span><span class="o">/</span><span class="n">include</span><span class="o">/</span>
</pre></div> </pre></div>
</div> </div>
<p>Then have pip compile and install the wheel:</p> <p>Then have pip compile and install the wheel:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">apt</span> <span class="n">update</span> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">python</span> <span class="o">-</span><span class="n">m</span> <span class="n">pip</span> <span class="n">install</span> <span class="o">--</span><span class="k">break</span><span class="o">-</span><span class="n">system</span><span class="o">-</span><span class="n">packages</span> <span class="n">setuptools</span>
<span class="n">sudo</span> <span class="n">apt</span> <span class="n">install</span> <span class="n">python3</span><span class="o">-</span><span class="n">pip</span> <span class="n">python</span> <span class="o">-</span><span class="n">m</span> <span class="n">pip</span> <span class="n">install</span> <span class="o">--</span><span class="n">no</span><span class="o">-</span><span class="n">cache</span><span class="o">-</span><span class="nb">dir</span> <span class="o">--</span><span class="n">no</span><span class="o">-</span><span class="n">binary</span> <span class="n">raylib</span> <span class="o">--</span><span class="n">upgrade</span> <span class="o">--</span><span class="n">force</span><span class="o">-</span><span class="n">reinstall</span> <span class="o">--</span><span class="k">break</span><span class="o">-</span><span class="n">system</span><span class="o">-</span><span class="n">packages</span> <span class="n">raylib</span><span class="o">==</span><span class="mf">5.0.0.3</span>
<span class="n">pip3</span> <span class="n">install</span> <span class="n">setuptools</span>
<span class="n">pip3</span> <span class="n">install</span> <span class="o">--</span><span class="n">no</span><span class="o">-</span><span class="n">cache</span><span class="o">-</span><span class="nb">dir</span> <span class="o">--</span><span class="n">no</span><span class="o">-</span><span class="n">binary</span> <span class="n">raylib</span> <span class="o">--</span><span class="n">upgrade</span> <span class="o">--</span><span class="n">force</span><span class="o">-</span><span class="n">reinstall</span> <span class="n">raylib</span><span class="o">==</span><span class="mf">5.0.0.2</span>
</pre></div> </pre></div>
</div> </div>
</section> </section>
<section id="option-3-compile-raylib-from-source-drm-mode"> <section id="option-3-compile-raylib-from-source-drm-mode">
<h2>Option 3: Compile Raylib from source DRM mode<a class="headerlink" href="#option-3-compile-raylib-from-source-drm-mode" title="Link to this heading"></a></h2> <h2>Option 3: Compile Raylib from source DRM mode<a class="headerlink" href="#option-3-compile-raylib-from-source-drm-mode" title="Link to this heading"></a></h2>
<p>As far as I can tell, Raylib DRM is broken. It doesnt work on my Pi. However, if you want to compile it and <p>This seems to work on Raspberry Pi 4. Note you must not be running X11 when you run your programs.</p>
give it a go, these are the commands:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">apt</span> <span class="n">update</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">git</span> <span class="n">clone</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">raysan5</span><span class="o">/</span><span class="n">raylib</span><span class="o">.</span><span class="n">git</span> <span class="o">--</span><span class="n">branch</span> <span class="mf">5.0</span> <span class="o">--</span><span class="n">single</span><span class="o">-</span><span class="n">branch</span> <span class="n">sudo</span> <span class="n">python3</span><span class="o">-</span><span class="n">pip</span> <span class="n">cmake</span> <span class="n">libegl1</span><span class="o">-</span><span class="n">mesa</span><span class="o">-</span><span class="n">dev</span> <span class="n">libgbm</span><span class="o">-</span><span class="n">dev</span> <span class="n">libgles2</span><span class="o">-</span><span class="n">mesa</span><span class="o">-</span><span class="n">dev</span> <span class="n">libdrm</span><span class="o">-</span><span class="n">dev</span> <span class="n">libglfw3</span><span class="o">-</span><span class="n">dev</span>
<span class="n">git</span> <span class="n">clone</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">raysan5</span><span class="o">/</span><span class="n">raylib</span><span class="o">.</span><span class="n">git</span> <span class="o">--</span><span class="n">branch</span> <span class="mf">5.0</span> <span class="o">--</span><span class="n">single</span><span class="o">-</span><span class="n">branch</span>
<span class="n">cd</span> <span class="n">raylib</span> <span class="n">cd</span> <span class="n">raylib</span>
<span class="n">mkdir</span> <span class="n">build</span> <span class="n">mkdir</span> <span class="n">build</span>
<span class="n">rm</span> <span class="n">rf</span> <span class="n">build</span><span class="o">/*</span> <span class="n">rm</span> <span class="n">rf</span> <span class="n">build</span><span class="o">/*</span>
@ -139,13 +141,12 @@ give it a go, these are the commands:</p>
<span class="n">cmake</span> <span class="o">-</span><span class="n">DPLATFORM</span><span class="o">=</span><span class="s2">&quot;DRM&quot;</span> <span class="o">-</span><span class="n">DBUILD_EXAMPLES</span><span class="o">=</span><span class="n">OFF</span> <span class="o">-</span><span class="n">DCUSTOMIZE_BUILD</span><span class="o">=</span><span class="n">ON</span> <span class="o">-</span><span class="n">DSUPPORT_FILEFORMAT_JPG</span><span class="o">=</span><span class="n">ON</span> <span class="o">-</span><span class="n">DSUPPORT_FILEFORMAT_FLAC</span><span class="o">=</span><span class="n">ON</span> <span class="o">-</span><span class="n">DWITH_PIC</span><span class="o">=</span><span class="n">ON</span> <span class="o">-</span><span class="n">DCMAKE_BUILD_TYPE</span><span class="o">=</span><span class="n">Release</span> <span class="o">..</span> <span class="n">cmake</span> <span class="o">-</span><span class="n">DPLATFORM</span><span class="o">=</span><span class="s2">&quot;DRM&quot;</span> <span class="o">-</span><span class="n">DBUILD_EXAMPLES</span><span class="o">=</span><span class="n">OFF</span> <span class="o">-</span><span class="n">DCUSTOMIZE_BUILD</span><span class="o">=</span><span class="n">ON</span> <span class="o">-</span><span class="n">DSUPPORT_FILEFORMAT_JPG</span><span class="o">=</span><span class="n">ON</span> <span class="o">-</span><span class="n">DSUPPORT_FILEFORMAT_FLAC</span><span class="o">=</span><span class="n">ON</span> <span class="o">-</span><span class="n">DWITH_PIC</span><span class="o">=</span><span class="n">ON</span> <span class="o">-</span><span class="n">DCMAKE_BUILD_TYPE</span><span class="o">=</span><span class="n">Release</span> <span class="o">..</span>
<span class="n">make</span> <span class="n">make</span>
<span class="n">sudo</span> <span class="n">make</span> <span class="n">install</span> <span class="n">sudo</span> <span class="n">make</span> <span class="n">install</span>
<span class="n">sudo</span> <span class="n">cp</span> <span class="o">-</span><span class="n">r</span> <span class="o">../</span><span class="n">src</span><span class="o">/</span><span class="n">external</span><span class="o">/</span><span class="n">glfw</span><span class="o">/</span><span class="n">include</span><span class="o">/</span><span class="n">GLFW</span> <span class="o">/</span><span class="n">usr</span><span class="o">/</span><span class="n">local</span><span class="o">/</span><span class="n">include</span><span class="o">/</span>
</pre></div> </pre></div>
</div> </div>
<p>Then have pip compile and install the wheel with some extra linker flags:</p> <p>Then have pip compile and install the wheel with some extra linker flags:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">apt</span> <span class="n">update</span> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">python</span> <span class="o">-</span><span class="n">m</span> <span class="n">pip</span> <span class="n">install</span> <span class="o">--</span><span class="k">break</span><span class="o">-</span><span class="n">system</span><span class="o">-</span><span class="n">packages</span> <span class="n">setuptools</span>
<span class="n">sudo</span> <span class="n">apt</span> <span class="n">install</span> <span class="n">python3</span><span class="o">-</span><span class="n">pip</span> <span class="n">LDFLAGS</span><span class="o">=</span><span class="s2">&quot;-lgbm -ldrm -lEGL&quot;</span> <span class="n">pip3</span> <span class="n">install</span> <span class="o">--</span><span class="n">no</span><span class="o">-</span><span class="n">cache</span><span class="o">-</span><span class="nb">dir</span> <span class="o">--</span><span class="n">no</span><span class="o">-</span><span class="n">binary</span> <span class="n">raylib</span> <span class="o">--</span><span class="n">upgrade</span> <span class="o">--</span><span class="n">force</span><span class="o">-</span><span class="n">reinstall</span> <span class="o">--</span><span class="k">break</span><span class="o">-</span><span class="n">system</span><span class="o">-</span><span class="n">packages</span> <span class="n">raylib</span><span class="o">==</span><span class="mf">5.0.0.3</span>
<span class="n">pip3</span> <span class="n">install</span> <span class="n">setuptools</span>
<span class="n">LDFLAGS</span><span class="o">=</span><span class="s2">&quot;-lgbm -ldrm -lEGL&quot;</span> <span class="n">pip3</span> <span class="n">install</span> <span class="o">--</span><span class="n">no</span><span class="o">-</span><span class="n">cache</span><span class="o">-</span><span class="nb">dir</span> <span class="o">--</span><span class="n">no</span><span class="o">-</span><span class="n">binary</span> <span class="n">raylib</span> <span class="o">--</span><span class="n">upgrade</span> <span class="o">--</span><span class="n">force</span><span class="o">-</span><span class="n">reinstall</span> <span class="n">raylib</span><span class="o">==</span><span class="mf">5.0.0.2</span>
</pre></div> </pre></div>
</div> </div>
<div class="admonition attention"> <div class="admonition attention">

View file

@ -37,7 +37,7 @@ Then install
python3 -m pip install setuptools python3 -m pip install setuptools
python3 -m pip install raylib python3 -m pip install raylib
On most platforms it should install a binary wheel (Windows 10 x64, MacOS 10.15 x64, Linux Ubuntu1804 x64). On most platforms it should install a binary wheel (Windows 10 x64, MacOS 12 x64/arm64, Linux Ubuntu2004 x64/arm64).
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. 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. using homebrew, apt, etc.
@ -158,7 +158,7 @@ If you need more performance, do in this order:
in your update loop in your update loop
and then only convert them to C data structures when you have to call the C functions for drawing. and then only convert them to C data structures when you have to call the C functions for drawing.
3. The raylib.* functions are potentially 1.5x faster than the pyray.* equivalents, so if you need a tiny bit more performance 3. The raylib.* functions are potentially *slightly* faster than the pyray.* equivalents, so if you need a tiny bit more performance
you can switch your inner loop functions to these. you can switch your inner loop functions to these.
4. There is a version of Python that is faster than Pypy: GraalPy. However it's not fully compatible with all Python 4. There is a version of Python that is faster than Pypy: GraalPy. However it's not fully compatible with all Python

View file

@ -1,7 +1,7 @@
Raspberry Pi Raspberry Pi
==================== ====================
Please use Raspberry Pi OS Bullseye. Older OSes are not tested. Please use Raspberry Pi OS Bookworm. Bullseye should also work. Older OSes are not tested.
Option 1: Binary wheel Option 1: Binary wheel
---------------------- ----------------------
@ -10,7 +10,7 @@ We have published binary wheels compiled for 64-bit Raspberry OS Bullseye in X11
:: ::
python -m pip install raylib python -m pip install --break-system-packages raylib
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. 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.
For full instructions on this, see https://github.com/raysan5/raylib/wiki/Working-on-Raspberry-Pi . If you need help with this ask Raylib. For full instructions on this, see https://github.com/raysan5/raylib/wiki/Working-on-Raspberry-Pi . If you need help with this ask Raylib.
@ -22,6 +22,8 @@ This should work for everyone.
:: ::
sudo apt update
sudo python3-pip cmake libegl1-mesa-dev libgbm-dev libgles2-mesa-dev libdrm-dev libglfw3-dev
git clone https://github.com/raysan5/raylib.git --branch 5.0 --single-branch git clone https://github.com/raysan5/raylib.git --branch 5.0 --single-branch
cd raylib cd raylib
mkdir build mkdir build
@ -30,24 +32,24 @@ This should work for everyone.
cmake -DPLATFORM="Desktop" -DOPENGL_VERSION=2.1 -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release .. cmake -DPLATFORM="Desktop" -DOPENGL_VERSION=2.1 -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release ..
make make
sudo make install sudo make install
sudo cp -r ../src/external/glfw/include/GLFW /usr/local/include/
Then have pip compile and install the wheel: Then have pip compile and install the wheel:
:: ::
sudo apt update python -m pip install --break-system-packages setuptools
sudo apt install python3-pip python -m pip install --no-cache-dir --no-binary raylib --upgrade --force-reinstall --break-system-packages raylib==5.0.0.3
pip3 install setuptools
pip3 install --no-cache-dir --no-binary raylib --upgrade --force-reinstall raylib==5.0.0.2
Option 3: Compile Raylib from source DRM mode Option 3: Compile Raylib from source DRM mode
--------------------------------------------- ---------------------------------------------
As far as I can tell, Raylib DRM is broken. It doesn't work on my Pi. However, if you want to compile it and This seems to work on Raspberry Pi 4. Note you must not be running X11 when you run your programs.
give it a go, these are the commands:
:: ::
sudo apt update
sudo python3-pip cmake libegl1-mesa-dev libgbm-dev libgles2-mesa-dev libdrm-dev libglfw3-dev
git clone https://github.com/raysan5/raylib.git --branch 5.0 --single-branch git clone https://github.com/raysan5/raylib.git --branch 5.0 --single-branch
cd raylib cd raylib
mkdir build mkdir build
@ -56,15 +58,14 @@ give it a go, these are the commands:
cmake -DPLATFORM="DRM" -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release .. cmake -DPLATFORM="DRM" -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release ..
make make
sudo make install sudo make install
sudo cp -r ../src/external/glfw/include/GLFW /usr/local/include/
Then have pip compile and install the wheel with some extra linker flags: Then have pip compile and install the wheel with some extra linker flags:
:: ::
sudo apt update python -m pip install --break-system-packages setuptools
sudo apt install python3-pip LDFLAGS="-lgbm -ldrm -lEGL" pip3 install --no-cache-dir --no-binary raylib --upgrade --force-reinstall --break-system-packages raylib==5.0.0.3
pip3 install setuptools
LDFLAGS="-lgbm -ldrm -lEGL" pip3 install --no-cache-dir --no-binary raylib --upgrade --force-reinstall raylib==5.0.0.2

File diff suppressed because one or more lines are too long