update building docs

This commit is contained in:
richard 2021-10-03 17:09:46 +01:00
parent 4f7c17de05
commit 0a2ed8e1a4
34 changed files with 16462 additions and 3659 deletions

View file

@ -1,153 +0,0 @@
# Building from source
## Have Pip build from source
Useful if the binaries don't work on your system.
Make sure Raylib is installed and then:
pip3 install --no-binary raylib --upgrade --force-reinstall raylib
## Build from source manually
Useful if the Pip build doesn't work, or you want to contribute to the project, or you want to skip building the
static lib and just *use the dynamic binding with your own dll*.
If you do build on a new platform please
submit your binaries as a PR.
### Windows manual build
Clone this repo including submodules so you get correct version of Raylib.
git clone --recurse-submodules https://github.com/electronstudio/raylib-python-cffi
Open Visual C++ command shell.
Fix the symlink that doesnt work on Windows
cd raylib-python-cffi
copy raylib-c\src\raylib.h raylib\raylib.h
Build and install Raylib from the raylib-c directory.
cd raylib-python-cffi/raylib-c
mkdir build
cd build
cmake -DWITH_PIC=on -DCMAKE_BUILD_TYPE=Release ..
msbuild raylib.sln /target:raylib /property:Configuration=Release
copy raylib\Release\raylib.lib ..\..
cd ..\..
To update the dynamic libs, download the official release, e.g. https://github.com/raysan5/raylib/releases/download/3.7.0/raylib-3.7.0_win64_msvc16.zip and extract `raylib.dll`
into `raylib/dynamic`. Delete the files for other platforms, unless you want them in your distribution.
To build a binary wheel distribution:
rmdir /Q /S build
pip3 install cffi
pip3 install wheel
python setup.py bdist_wheel
Alternatively, if you don't want the static binaries and just want to use DLLs with raylib.dynamic:
python3 setup_dynamic.py bdist_wheel
Then install it:
pip3 install dist\raylib-3.7.0-cp37-cp37m-win_amd64.whl
(Note: your wheel's filename will probably be different than the one here.)
### Linux etc manual build
These instructions have been tested on Ubuntu 20.10 and 16.04. Mac should be very similar.
Clone this repo including submodules so you get correct version of Raylib.
git clone --recurse-submodules https://github.com/electronstudio/raylib-python-cffi
Build and install Raylib from the raylib-c directory.
sudo apt install libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev
cd raylib-python-cffi/raylib-c
mkdir build
cd build
cmake -DWITH_PIC=on -DCMAKE_BUILD_TYPE=Release ..
sudo make install
Optional: Build the Raylib shared libs, if you plan to use `raylib.dynamic` binding.
rm -rf *
cmake -DWITH_PIC=on -DBUILD_SHARED_LIBS=on -DCMAKE_BUILD_TYPE=Release ..
sudo make install
Optional: Make a patched version of raylib header. (**Not necessary** if you've already got
raylib_modifed.h from repo and haven't changed anything.)
cd ../../raylib
cp raylib.h raylib_modified.h
patch -p0 <raylib_modified.h.patch
Build
pip3 install cffi
cd ..
rm -rf build raylib/static/_raylib_cffi.*
python3 raylib/static/build.py
To update the Linux dynamic libs (names will be different on other platfroms):
rm raylib/dynamic/*.so*
cp -P /usr/local/lib/libraylib.so* raylib/dynamic/
To build a binary wheel distribution:
pip3 install wheel
python3 setup.py bdist_wheel
Alternatively, if you don't want the static binaries and just want to use DLLs with raylib.dynamic:
python3 setup_dynamic.py bdist_wheel
Then install it:
pip3 install dist/raylib*.whl
To build a complete set of libs for Python 3.6, 3.7, 3.8 and 3.9:
./raylib/static/build_multi.sh
(NOTE pypi wont accept Linux packages unless they are built `--plat-name manylinux2014_x86_64` so on linux
please run `./raylib/static/build_multi_linux.sh` )
(TODO move the dynamic libs into a separate package rather than include them with every one.)
### Raspberry Pi
The integrated GPU hardware in a Raspberry Pi ("VideoCore") is rather
idiosyncratic, resulting in a complex set of software options. Probably the
most interesting two options for Raylib applications are:
1. Use the Broadcom proprietary Open GL ES 2.0 drivers, installed by Raspbian
into `/opt/vc`. These are 32-bit only, and currently X11 doesn't use these
for its acceleration, so this is most suitable for driving the entire HDMI
output from one application with minimal overhead (no X11).
2. Use the more recent open-source `vc4-fkms-v3d` kernel driver. This can run
in either 32-bit or 64-bit, and X11 can use these, so using X11 is probably
the more common choice here.
With option 2, the regular linux install instructions above should probably
work as-is.
For option 1, then also follow the above instructions, but with these
modifications:
- With `cmake`, use `cmake -DWITH_PIC=on -DSTATIC=on -DSHARED=on -DPLATFORM='Raspberry Pi' ..`
(See [here](https://github.com/electronstudio/raylib-python-cffi/issues/31#issuecomment-862078330) for a Raspberry Pi wheel)

214
BUILDING.rst Normal file
View file

@ -0,0 +1,214 @@
Building from source
====================
Have Pip build from source
--------------------------
Useful if the binaries dont work on your system.
Make sure Raylib is installed and then:
::
pip3 install --no-binary raylib --upgrade --force-reinstall raylib
Build from source manually
--------------------------
Useful if the Pip build doesnt work, or you want to contribute to the
project, or you want to skip building the static lib and just *use the
dynamic binding with your own dll*.
.. attention::
If the Pip build doesnt work, please submit a bug. (And if you have
fixed it, a PR.)
Windows manual build
~~~~~~~~~~~~~~~~~~~~
Clone this repo including submodules so you get correct version of
Raylib.
::
git clone --recurse-submodules https://github.com/electronstudio/raylib-python-cffi
Open Visual C++ command shell.
Fix the symlink that doesnt work on Windows
::
cd raylib-python-cffi
copy raylib-c\src\raylib.h raylib\raylib.h
Build and install Raylib from the raylib-c directory.
::
cd raylib-python-cffi/raylib-c
mkdir build
cd build
cmake -DWITH_PIC=on -DCMAKE_BUILD_TYPE=Release ..
msbuild raylib.sln /target:raylib /property:Configuration=Release
copy raylib\Release\raylib.lib ..\..
cd ..\..
To update the dynamic libs, download the official release,
e.g. https://github.com/raysan5/raylib/releases/download/3.7.0/raylib-3.7.0_win64_msvc16.zip
and extract ``raylib.dll`` into ``raylib/dynamic``. Delete the files for
other platforms, unless you want them in your distribution.
To build a binary wheel distribution:
::
rmdir /Q /S build
pip3 install cffi
pip3 install wheel
python setup.py bdist_wheel
Alternatively, if you dont want the static binaries and just want to
use DLLs with raylib.dynamic:
::
python3 setup_dynamic.py bdist_wheel
Then install it:
::
pip3 install dist\raylib-3.7.0-cp37-cp37m-win_amd64.whl
(Note: your wheels filename will probably be different than the one
here.)
Linux manual build
~~~~~~~~~~~~~~~~~~~~~~
These instructions have been tested on Ubuntu 20.10 and 16.04. Mac
should be very similar.
Clone this repo including submodules so you get correct version of
Raylib.
::
git clone --recurse-submodules https://github.com/electronstudio/raylib-python-cffi
Build and install Raylib from the raylib-c directory.
::
sudo apt install cmake libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev
cd raylib-python-cffi/raylib-c
mkdir build
cd build
cmake -DWITH_PIC=on -DCMAKE_BUILD_TYPE=Release ..
sudo make install
.. note:: Optional: Build the Raylib shared libs, if you plan to use
``raylib.dynamic`` binding.
::
rm -rf *
cmake -DWITH_PIC=on -DBUILD_SHARED_LIBS=on -DCMAKE_BUILD_TYPE=Release ..
sudo make install
::
cd ../..
.. note:: Optional: Make a patched version of raylib header. (**Not necessary** if
youve already got raylib_modifed.h from repo and havent changed
anything.)
::
cd raylib
cp raylib.h raylib_modified.h
patch -p0 <raylib_modified.h.patch
cd ..
Build
::
pip3 install cffi
rm -rf build raylib/static/_raylib_cffi.*
python3 raylib/static/build.py
.. note:: (Optional) To update the Linux dynamic libs (names will be different on other platfroms):
::
rm raylib/dynamic/*.so*
cp -P /usr/local/lib/libraylib.so* raylib/dynamic/
To build a binary wheel distribution:
::
pip3 install wheel
python3 setup.py bdist_wheel
Alternatively, if you dont want the static binaries and just want to
use DLLs with raylib.dynamic:
::
python3 setup_dynamic.py bdist_wheel
Then install it:
::
pip3 install dist/raylib*.whl
To build a complete set of libs for Python 3.6, 3.7, 3.8 and 3.9:
::
./raylib/static/build_multi.sh
.. warning::
pypi wont accept Linux packages unless they are built
``--plat-name manylinux2014_x86_64`` so on linux please run
``./raylib/static/build_multi_linux.sh`` )
.. TODO::
move the dynamic libs into a separate package rather than include
them with every one.
Raspberry Pi
~~~~~~~~~~~~
The integrated GPU hardware in a Raspberry Pi (“VideoCore”) is rather
idiosyncratic, resulting in a complex set of software options. Probably
the most interesting two options for Raylib applications are:
1. Use the Broadcom proprietary Open GL ES 2.0 drivers, installed by
Raspbian into ``/opt/vc``. These are 32-bit only, and currently X11
doesnt use these for its acceleration, so this is most suitable for
driving the entire HDMI output from one application with minimal
overhead (no X11).
2. Use the more recent open-source ``vc4-fkms-v3d`` kernel driver. This
can run in either 32-bit or 64-bit, and X11 can use these, so using
X11 is probably the more common choice here.
With option 2, the regular linux install instructions above should
probably work as-is.
For option 1, then also follow the above instructions, but with these
modifications:
- With ``cmake``, use
``cmake -DWITH_PIC=on -DSTATIC=on -DSHARED=on -DPLATFORM='Raspberry Pi' ..``
(See
`here <https://github.com/electronstudio/raylib-python-cffi/issues/31#issuecomment-862078330>`__
for a Raspberry Pi wheel)

View file

@ -1 +0,0 @@
../BUILDING.md

1
docs-src/BUILDING.rst Symbolic link
View file

@ -0,0 +1 @@
../BUILDING.rst

View file

@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: b194f6bda240fa6b2ce63ebf0c59a33d
config: c6c8605a01fab3fc8b4c8636342889f3
tags: 645f666f9bcd5a90fca523b33c5a78b7

View file

@ -28,7 +28,7 @@ author = 'Richard Smith'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'myst_parser', 'autoapi.extension', "sphinx_rtd_theme"]
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'myst_parser', 'autoapi.extension', "sphinx_rtd_theme", 'sphinx.ext.todo']
autoapi_dirs = ['../raylib']
@ -61,3 +61,5 @@ html_theme = "sphinx_rtd_theme"
html_static_path = ['_static']
pygments_style = 'sphinx'
todo_include_todos = True

View file

@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: cc130bfc0dc4a1401fdcd32a4066bb28
config: c6c8605a01fab3fc8b4c8636342889f3
tags: 645f666f9bcd5a90fca523b33c5a78b7

View file

@ -3,15 +3,13 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Building from source &mdash; Raylib Python documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<title>Building from source &mdash; Raylib Python documentation</title><link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/graphviz.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
@ -36,7 +34,7 @@
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<p class="caption"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="README.html">Python Bindings for Raylib 3.7</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#license-updated">License (updated)</a></li>
@ -54,7 +52,7 @@
<li class="toctree-l2"><a class="reference internal" href="#have-pip-build-from-source">Have Pip build from source</a></li>
<li class="toctree-l2"><a class="reference internal" href="#build-from-source-manually">Build from source manually</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#windows-manual-build">Windows manual build</a></li>
<li class="toctree-l3"><a class="reference internal" href="#linux-etc-manual-build">Linux etc manual build</a></li>
<li class="toctree-l3"><a class="reference internal" href="#linux-manual-build">Linux manual build</a></li>
<li class="toctree-l3"><a class="reference internal" href="#raspberry-pi">Raspberry Pi</a></li>
</ul>
</li>
@ -78,7 +76,7 @@
<li><a href="index.html" class="icon icon-home"></a> &raquo;</li>
<li>Building from source</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/BUILDING.md.txt" rel="nofollow"> View page source</a>
<a href="_sources/BUILDING.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
@ -86,147 +84,185 @@
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="tex2jax_ignore mathjax_ignore section" id="building-from-source">
<div class="section" id="building-from-source">
<h1>Building from source<a class="headerlink" href="#building-from-source" title="Permalink to this headline"></a></h1>
<div class="section" id="have-pip-build-from-source">
<h2>Have Pip build from source<a class="headerlink" href="#have-pip-build-from-source" title="Permalink to this headline"></a></h2>
<p>Useful if the binaries dont work on your system.</p>
<p>Make sure Raylib is installed and then:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>pip3 install --no-binary raylib --upgrade --force-reinstall raylib
<div class="highlight-default notranslate"><div class="highlight"><pre><span></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">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>
</pre></div>
</div>
</div>
<div class="section" id="build-from-source-manually">
<h2>Build from source manually<a class="headerlink" href="#build-from-source-manually" title="Permalink to this headline"></a></h2>
<p>Useful if the Pip build doesnt work, or you want to contribute to the project, or you want to skip building the
static lib and just <em>use the dynamic binding with your own dll</em>.</p>
<p>If you do build on a new platform please
submit your binaries as a PR.</p>
<p>Useful if the Pip build doesnt work, or you want to contribute to the
project, or you want to skip building the static lib and just <em>use the
dynamic binding with your own dll</em>.</p>
<div class="admonition attention">
<p class="admonition-title">Attention</p>
<p>If the Pip build doesnt work, please submit a bug. (And if you have
fixed it, a PR.)</p>
</div>
<div class="section" id="windows-manual-build">
<h3>Windows manual build<a class="headerlink" href="#windows-manual-build" title="Permalink to this headline"></a></h3>
<p>Clone this repo including submodules so you get correct version of Raylib.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>git clone --recurse-submodules https://github.com/electronstudio/raylib-python-cffi
<p>Clone this repo including submodules so you get correct version of
Raylib.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">git</span> <span class="n">clone</span> <span class="o">--</span><span class="n">recurse</span><span class="o">-</span><span class="n">submodules</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">electronstudio</span><span class="o">/</span><span class="n">raylib</span><span class="o">-</span><span class="n">python</span><span class="o">-</span><span class="n">cffi</span>
</pre></div>
</div>
<p>Open Visual C++ command shell.</p>
<p>Fix the symlink that doesnt work on Windows</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>cd raylib-python-cffi
copy raylib-c\src\raylib.h raylib\raylib.h
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cd</span> <span class="n">raylib</span><span class="o">-</span><span class="n">python</span><span class="o">-</span><span class="n">cffi</span>
<span class="n">copy</span> <span class="n">raylib</span><span class="o">-</span><span class="n">c</span>\<span class="n">src</span>\<span class="n">raylib</span><span class="o">.</span><span class="n">h</span> <span class="n">raylib</span>\<span class="n">raylib</span><span class="o">.</span><span class="n">h</span>
</pre></div>
</div>
<p>Build and install Raylib from the raylib-c directory.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>cd raylib-python-cffi/raylib-c
mkdir build
cd build
cmake -DWITH_PIC=on -DCMAKE_BUILD_TYPE=Release ..
msbuild raylib.sln /target:raylib /property:Configuration=Release
copy raylib\Release\raylib.lib ..\..
cd ..\..
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cd</span> <span class="n">raylib</span><span class="o">-</span><span class="n">python</span><span class="o">-</span><span class="n">cffi</span><span class="o">/</span><span class="n">raylib</span><span class="o">-</span><span class="n">c</span>
<span class="n">mkdir</span> <span class="n">build</span>
<span class="n">cd</span> <span class="n">build</span>
<span class="n">cmake</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">msbuild</span> <span class="n">raylib</span><span class="o">.</span><span class="n">sln</span> <span class="o">/</span><span class="n">target</span><span class="p">:</span><span class="n">raylib</span> <span class="o">/</span><span class="nb">property</span><span class="p">:</span><span class="n">Configuration</span><span class="o">=</span><span class="n">Release</span>
<span class="n">copy</span> <span class="n">raylib</span>\<span class="n">Release</span>\<span class="n">raylib</span><span class="o">.</span><span class="n">lib</span> <span class="o">..</span>\<span class="o">..</span>
<span class="n">cd</span> <span class="o">..</span>\<span class="o">..</span>
</pre></div>
</div>
<p>To update the dynamic libs, download the official release, e.g. https://github.com/raysan5/raylib/releases/download/3.7.0/raylib-3.7.0_win64_msvc16.zip and extract <code class="docutils literal notranslate"><span class="pre">raylib.dll</span></code>
into <code class="docutils literal notranslate"><span class="pre">raylib/dynamic</span></code>. Delete the files for other platforms, unless you want them in your distribution.</p>
<p>To update the dynamic libs, download the official release,
e.g. <a class="reference external" href="https://github.com/raysan5/raylib/releases/download/3.7.0/raylib-3.7.0_win64_msvc16.zip">https://github.com/raysan5/raylib/releases/download/3.7.0/raylib-3.7.0_win64_msvc16.zip</a>
and extract <code class="docutils literal notranslate"><span class="pre">raylib.dll</span></code> into <code class="docutils literal notranslate"><span class="pre">raylib/dynamic</span></code>. Delete the files for
other platforms, unless you want them in your distribution.</p>
<p>To build a binary wheel distribution:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>rmdir /Q /S build
pip3 install cffi
pip3 install wheel
python setup.py bdist_wheel
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">rmdir</span> <span class="o">/</span><span class="n">Q</span> <span class="o">/</span><span class="n">S</span> <span class="n">build</span>
<span class="n">pip3</span> <span class="n">install</span> <span class="n">cffi</span>
<span class="n">pip3</span> <span class="n">install</span> <span class="n">wheel</span>
<span class="n">python</span> <span class="n">setup</span><span class="o">.</span><span class="n">py</span> <span class="n">bdist_wheel</span>
</pre></div>
</div>
<p>Alternatively, if you dont want the static binaries and just want to use DLLs with raylib.dynamic:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>python3 setup_dynamic.py bdist_wheel
<p>Alternatively, if you dont want the static binaries and just want to
use DLLs with raylib.dynamic:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">python3</span> <span class="n">setup_dynamic</span><span class="o">.</span><span class="n">py</span> <span class="n">bdist_wheel</span>
</pre></div>
</div>
<p>Then install it:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>pip3 install dist\raylib-3.7.0-cp37-cp37m-win_amd64.whl
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pip3</span> <span class="n">install</span> <span class="n">dist</span>\<span class="n">raylib</span><span class="o">-</span><span class="mf">3.7</span><span class="o">.</span><span class="mi">0</span><span class="o">-</span><span class="n">cp37</span><span class="o">-</span><span class="n">cp37m</span><span class="o">-</span><span class="n">win_amd64</span><span class="o">.</span><span class="n">whl</span>
</pre></div>
</div>
<p>(Note: your wheels filename will probably be different than the one here.)</p>
<p>(Note: your wheels filename will probably be different than the one
here.)</p>
</div>
<div class="section" id="linux-etc-manual-build">
<h3>Linux etc manual build<a class="headerlink" href="#linux-etc-manual-build" title="Permalink to this headline"></a></h3>
<p>These instructions have been tested on Ubuntu 20.10 and 16.04. Mac should be very similar.</p>
<p>Clone this repo including submodules so you get correct version of Raylib.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>git clone --recurse-submodules https://github.com/electronstudio/raylib-python-cffi
<div class="section" id="linux-manual-build">
<h3>Linux manual build<a class="headerlink" href="#linux-manual-build" title="Permalink to this headline"></a></h3>
<p>These instructions have been tested on Ubuntu 20.10 and 16.04. Mac
should be very similar.</p>
<p>Clone this repo including submodules so you get correct version of
Raylib.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">git</span> <span class="n">clone</span> <span class="o">--</span><span class="n">recurse</span><span class="o">-</span><span class="n">submodules</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">electronstudio</span><span class="o">/</span><span class="n">raylib</span><span class="o">-</span><span class="n">python</span><span class="o">-</span><span class="n">cffi</span>
</pre></div>
</div>
<p>Build and install Raylib from the raylib-c directory.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>sudo apt install libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev
cd raylib-python-cffi/raylib-c
mkdir build
cd build
cmake -DWITH_PIC=on -DCMAKE_BUILD_TYPE=Release ..
sudo make install
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">apt</span> <span class="n">install</span> <span class="n">cmake</span> <span class="n">libasound2</span><span class="o">-</span><span class="n">dev</span> <span class="n">mesa</span><span class="o">-</span><span class="n">common</span><span class="o">-</span><span class="n">dev</span> <span class="n">libx11</span><span class="o">-</span><span class="n">dev</span> <span class="n">libxrandr</span><span class="o">-</span><span class="n">dev</span> <span class="n">libxi</span><span class="o">-</span><span class="n">dev</span> <span class="n">xorg</span><span class="o">-</span><span class="n">dev</span> <span class="n">libgl1</span><span class="o">-</span><span class="n">mesa</span><span class="o">-</span><span class="n">dev</span> <span class="n">libglu1</span><span class="o">-</span><span class="n">mesa</span><span class="o">-</span><span class="n">dev</span>
<span class="n">cd</span> <span class="n">raylib</span><span class="o">-</span><span class="n">python</span><span class="o">-</span><span class="n">cffi</span><span class="o">/</span><span class="n">raylib</span><span class="o">-</span><span class="n">c</span>
<span class="n">mkdir</span> <span class="n">build</span>
<span class="n">cd</span> <span class="n">build</span>
<span class="n">cmake</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">sudo</span> <span class="n">make</span> <span class="n">install</span>
</pre></div>
</div>
<p>Optional: Build the Raylib shared libs, if you plan to use <code class="docutils literal notranslate"><span class="pre">raylib.dynamic</span></code> binding.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>rm -rf *
cmake -DWITH_PIC=on -DBUILD_SHARED_LIBS=on -DCMAKE_BUILD_TYPE=Release ..
sudo make install
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Optional: Build the Raylib shared libs, if you plan to use
<code class="docutils literal notranslate"><span class="pre">raylib.dynamic</span></code> binding.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">rm</span> <span class="o">-</span><span class="n">rf</span> <span class="o">*</span>
<span class="n">cmake</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">DBUILD_SHARED_LIBS</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">sudo</span> <span class="n">make</span> <span class="n">install</span>
</pre></div>
</div>
<p>Optional: Make a patched version of raylib header. (<strong>Not necessary</strong> if youve already got
raylib_modifed.h from repo and havent changed anything.)</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>cd ../../raylib
cp raylib.h raylib_modified.h
patch -p0 &lt;raylib_modified.h.patch
</div>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cd</span> <span class="o">../..</span>
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Optional: Make a patched version of raylib header. (<strong>Not necessary</strong> if
youve already got raylib_modifed.h from repo and havent changed
anything.)</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cd</span> <span class="n">raylib</span>
<span class="n">cp</span> <span class="n">raylib</span><span class="o">.</span><span class="n">h</span> <span class="n">raylib_modified</span><span class="o">.</span><span class="n">h</span>
<span class="n">patch</span> <span class="o">-</span><span class="n">p0</span> <span class="o">&lt;</span><span class="n">raylib_modified</span><span class="o">.</span><span class="n">h</span><span class="o">.</span><span class="n">patch</span>
<span class="n">cd</span> <span class="o">..</span>
</pre></div>
</div>
</div>
<p>Build</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>pip3 install cffi
cd ..
rm -rf build raylib/static/_raylib_cffi.*
python3 raylib/static/build.py
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pip3</span> <span class="n">install</span> <span class="n">cffi</span>
<span class="n">rm</span> <span class="o">-</span><span class="n">rf</span> <span class="n">build</span> <span class="n">raylib</span><span class="o">/</span><span class="n">static</span><span class="o">/</span><span class="n">_raylib_cffi</span><span class="o">.*</span>
<span class="n">python3</span> <span class="n">raylib</span><span class="o">/</span><span class="n">static</span><span class="o">/</span><span class="n">build</span><span class="o">.</span><span class="n">py</span>
</pre></div>
</div>
<p>To update the Linux dynamic libs (names will be different on other platfroms):</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>rm raylib/dynamic/*.so*
cp -P /usr/local/lib/libraylib.so* raylib/dynamic/
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>(Optional) To update the Linux dynamic libs (names will be different on other platfroms):</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">rm</span> <span class="n">raylib</span><span class="o">/</span><span class="n">dynamic</span><span class="o">/*.</span><span class="n">so</span><span class="o">*</span>
<span class="n">cp</span> <span class="o">-</span><span class="n">P</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">lib</span><span class="o">/</span><span class="n">libraylib</span><span class="o">.</span><span class="n">so</span><span class="o">*</span> <span class="n">raylib</span><span class="o">/</span><span class="n">dynamic</span><span class="o">/</span>
</pre></div>
</div>
</div>
<p>To build a binary wheel distribution:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>pip3 install wheel
python3 setup.py bdist_wheel
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pip3</span> <span class="n">install</span> <span class="n">wheel</span>
<span class="n">python3</span> <span class="n">setup</span><span class="o">.</span><span class="n">py</span> <span class="n">bdist_wheel</span>
</pre></div>
</div>
<p>Alternatively, if you dont want the static binaries and just want to use DLLs with raylib.dynamic:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>python3 setup_dynamic.py bdist_wheel
<p>Alternatively, if you dont want the static binaries and just want to
use DLLs with raylib.dynamic:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">python3</span> <span class="n">setup_dynamic</span><span class="o">.</span><span class="n">py</span> <span class="n">bdist_wheel</span>
</pre></div>
</div>
<p>Then install it:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>pip3 install dist/raylib*.whl
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pip3</span> <span class="n">install</span> <span class="n">dist</span><span class="o">/</span><span class="n">raylib</span><span class="o">*.</span><span class="n">whl</span>
</pre></div>
</div>
<p>To build a complete set of libs for Python 3.6, 3.7, 3.8 and 3.9:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>./raylib/static/build_multi.sh
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">./</span><span class="n">raylib</span><span class="o">/</span><span class="n">static</span><span class="o">/</span><span class="n">build_multi</span><span class="o">.</span><span class="n">sh</span>
</pre></div>
</div>
<p>(NOTE pypi wont accept Linux packages unless they are built <code class="docutils literal notranslate"><span class="pre">--plat-name</span> <span class="pre">manylinux2014_x86_64</span></code> so on linux
please run <code class="docutils literal notranslate"><span class="pre">./raylib/static/build_multi_linux.sh</span></code> )</p>
<p>(TODO move the dynamic libs into a separate package rather than include them with every one.)</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>pypi wont accept Linux packages unless they are built
<code class="docutils literal notranslate"><span class="pre">--plat-name</span> <span class="pre">manylinux2014_x86_64</span></code> so on linux please run
<code class="docutils literal notranslate"><span class="pre">./raylib/static/build_multi_linux.sh</span></code> )</p>
</div>
<div class="admonition-todo admonition" id="id1">
<p class="admonition-title">Todo</p>
<p>move the dynamic libs into a separate package rather than include
them with every one.)</p>
</div>
</div>
<div class="section" id="raspberry-pi">
<h3>Raspberry Pi<a class="headerlink" href="#raspberry-pi" title="Permalink to this headline"></a></h3>
<p>The integrated GPU hardware in a Raspberry Pi (“VideoCore”) is rather
idiosyncratic, resulting in a complex set of software options. Probably the
most interesting two options for Raylib applications are:</p>
<ol class="simple">
<li><p>Use the Broadcom proprietary Open GL ES 2.0 drivers, installed by Raspbian
into <code class="docutils literal notranslate"><span class="pre">/opt/vc</span></code>. These are 32-bit only, and currently X11 doesnt use these
for its acceleration, so this is most suitable for driving the entire HDMI
output from one application with minimal overhead (no X11).</p></li>
<li><p>Use the more recent open-source <code class="docutils literal notranslate"><span class="pre">vc4-fkms-v3d</span></code> kernel driver. This can run
in either 32-bit or 64-bit, and X11 can use these, so using X11 is probably
the more common choice here.</p></li>
idiosyncratic, resulting in a complex set of software options. Probably
the most interesting two options for Raylib applications are:</p>
<ol class="arabic simple">
<li><p>Use the Broadcom proprietary Open GL ES 2.0 drivers, installed by
Raspbian into <code class="docutils literal notranslate"><span class="pre">/opt/vc</span></code>. These are 32-bit only, and currently X11
doesnt use these for its acceleration, so this is most suitable for
driving the entire HDMI output from one application with minimal
overhead (no X11).</p></li>
<li><p>Use the more recent open-source <code class="docutils literal notranslate"><span class="pre">vc4-fkms-v3d</span></code> kernel driver. This
can run in either 32-bit or 64-bit, and X11 can use these, so using
X11 is probably the more common choice here.</p></li>
</ol>
<p>With option 2, the regular linux install instructions above should probably
work as-is.</p>
<p>With option 2, the regular linux install instructions above should
probably work as-is.</p>
<p>For option 1, then also follow the above instructions, but with these
modifications:</p>
<ul class="simple">
<li><p>With <code class="docutils literal notranslate"><span class="pre">cmake</span></code>, use <code class="docutils literal notranslate"><span class="pre">cmake</span> <span class="pre">-DWITH_PIC=on</span> <span class="pre">-DSTATIC=on</span> <span class="pre">-DSHARED=on</span> <span class="pre">-DPLATFORM='Raspberry</span> <span class="pre">Pi'</span> <span class="pre">..</span></code></p></li>
<li><p>With <code class="docutils literal notranslate"><span class="pre">cmake</span></code>, use
<code class="docutils literal notranslate"><span class="pre">cmake</span> <span class="pre">-DWITH_PIC=on</span> <span class="pre">-DSTATIC=on</span> <span class="pre">-DSHARED=on</span> <span class="pre">-DPLATFORM='Raspberry</span> <span class="pre">Pi'</span> <span class="pre">..</span></code></p></li>
</ul>
<p>(See <a class="reference external" href="https://github.com/electronstudio/raylib-python-cffi/issues/31#issuecomment-862078330">here</a> for a Raspberry Pi wheel)</p>
<p>(See
<a class="reference external" href="https://github.com/electronstudio/raylib-python-cffi/issues/31#issuecomment-862078330">here</a>
for a Raspberry Pi wheel)</p>
</div>
</div>
</div>

View file

@ -3,15 +3,13 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Python Bindings for Raylib 3.7 &mdash; Raylib Python documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<title>Python Bindings for Raylib 3.7 &mdash; Raylib Python documentation</title><link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/graphviz.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
@ -37,7 +35,7 @@
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<p class="caption"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">Python Bindings for Raylib 3.7</a></li>
<li class="toctree-l1"><a class="reference internal" href="#license-updated">License (updated)</a></li>

View file

@ -0,0 +1,214 @@
Building from source
====================
Have Pip build from source
--------------------------
Useful if the binaries dont work on your system.
Make sure Raylib is installed and then:
::
pip3 install --no-binary raylib --upgrade --force-reinstall raylib
Build from source manually
--------------------------
Useful if the Pip build doesnt work, or you want to contribute to the
project, or you want to skip building the static lib and just *use the
dynamic binding with your own dll*.
.. attention::
If the Pip build doesnt work, please submit a bug. (And if you have
fixed it, a PR.)
Windows manual build
~~~~~~~~~~~~~~~~~~~~
Clone this repo including submodules so you get correct version of
Raylib.
::
git clone --recurse-submodules https://github.com/electronstudio/raylib-python-cffi
Open Visual C++ command shell.
Fix the symlink that doesnt work on Windows
::
cd raylib-python-cffi
copy raylib-c\src\raylib.h raylib\raylib.h
Build and install Raylib from the raylib-c directory.
::
cd raylib-python-cffi/raylib-c
mkdir build
cd build
cmake -DWITH_PIC=on -DCMAKE_BUILD_TYPE=Release ..
msbuild raylib.sln /target:raylib /property:Configuration=Release
copy raylib\Release\raylib.lib ..\..
cd ..\..
To update the dynamic libs, download the official release,
e.g. https://github.com/raysan5/raylib/releases/download/3.7.0/raylib-3.7.0_win64_msvc16.zip
and extract ``raylib.dll`` into ``raylib/dynamic``. Delete the files for
other platforms, unless you want them in your distribution.
To build a binary wheel distribution:
::
rmdir /Q /S build
pip3 install cffi
pip3 install wheel
python setup.py bdist_wheel
Alternatively, if you dont want the static binaries and just want to
use DLLs with raylib.dynamic:
::
python3 setup_dynamic.py bdist_wheel
Then install it:
::
pip3 install dist\raylib-3.7.0-cp37-cp37m-win_amd64.whl
(Note: your wheels filename will probably be different than the one
here.)
Linux manual build
~~~~~~~~~~~~~~~~~~~~~~
These instructions have been tested on Ubuntu 20.10 and 16.04. Mac
should be very similar.
Clone this repo including submodules so you get correct version of
Raylib.
::
git clone --recurse-submodules https://github.com/electronstudio/raylib-python-cffi
Build and install Raylib from the raylib-c directory.
::
sudo apt install cmake libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev
cd raylib-python-cffi/raylib-c
mkdir build
cd build
cmake -DWITH_PIC=on -DCMAKE_BUILD_TYPE=Release ..
sudo make install
.. note:: Optional: Build the Raylib shared libs, if you plan to use
``raylib.dynamic`` binding.
::
rm -rf *
cmake -DWITH_PIC=on -DBUILD_SHARED_LIBS=on -DCMAKE_BUILD_TYPE=Release ..
sudo make install
::
cd ../..
.. note:: Optional: Make a patched version of raylib header. (**Not necessary** if
youve already got raylib_modifed.h from repo and havent changed
anything.)
::
cd raylib
cp raylib.h raylib_modified.h
patch -p0 <raylib_modified.h.patch
cd ..
Build
::
pip3 install cffi
rm -rf build raylib/static/_raylib_cffi.*
python3 raylib/static/build.py
.. note:: (Optional) To update the Linux dynamic libs (names will be different on other platfroms):
::
rm raylib/dynamic/*.so*
cp -P /usr/local/lib/libraylib.so* raylib/dynamic/
To build a binary wheel distribution:
::
pip3 install wheel
python3 setup.py bdist_wheel
Alternatively, if you dont want the static binaries and just want to
use DLLs with raylib.dynamic:
::
python3 setup_dynamic.py bdist_wheel
Then install it:
::
pip3 install dist/raylib*.whl
To build a complete set of libs for Python 3.6, 3.7, 3.8 and 3.9:
::
./raylib/static/build_multi.sh
.. warning::
pypi wont accept Linux packages unless they are built
``--plat-name manylinux2014_x86_64`` so on linux please run
``./raylib/static/build_multi_linux.sh`` )
.. TODO::
move the dynamic libs into a separate package rather than include
them with every one.)
Raspberry Pi
~~~~~~~~~~~~
The integrated GPU hardware in a Raspberry Pi (“VideoCore”) is rather
idiosyncratic, resulting in a complex set of software options. Probably
the most interesting two options for Raylib applications are:
1. Use the Broadcom proprietary Open GL ES 2.0 drivers, installed by
Raspbian into ``/opt/vc``. These are 32-bit only, and currently X11
doesnt use these for its acceleration, so this is most suitable for
driving the entire HDMI output from one application with minimal
overhead (no X11).
2. Use the more recent open-source ``vc4-fkms-v3d`` kernel driver. This
can run in either 32-bit or 64-bit, and X11 can use these, so using
X11 is probably the more common choice here.
With option 2, the regular linux install instructions above should
probably work as-is.
For option 1, then also follow the above instructions, but with these
modifications:
- With ``cmake``, use
``cmake -DWITH_PIC=on -DSTATIC=on -DSHARED=on -DPLATFORM='Raspberry Pi' ..``
(See
`here <https://github.com/electronstudio/raylib-python-cffi/issues/31#issuecomment-862078330>`__
for a Raspberry Pi wheel)

108
docs/_static/basic.css vendored
View file

@ -130,7 +130,7 @@ ul.search li a {
font-weight: bold;
}
ul.search li p.context {
ul.search li div.context {
color: #888;
margin: 2px 0 0 30px;
text-align: left;
@ -277,25 +277,25 @@ p.rubric {
font-weight: bold;
}
img.align-left, figure.align-left, .figure.align-left, object.align-left {
img.align-left, .figure.align-left, object.align-left {
clear: left;
float: left;
margin-right: 1em;
}
img.align-right, figure.align-right, .figure.align-right, object.align-right {
img.align-right, .figure.align-right, object.align-right {
clear: right;
float: right;
margin-left: 1em;
}
img.align-center, figure.align-center, .figure.align-center, object.align-center {
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
img.align-default, figure.align-default, .figure.align-default {
img.align-default, .figure.align-default {
display: block;
margin-left: auto;
margin-right: auto;
@ -319,8 +319,7 @@ img.align-default, figure.align-default, .figure.align-default {
/* -- sidebars -------------------------------------------------------------- */
div.sidebar,
aside.sidebar {
div.sidebar {
margin: 0 0 0.5em 1em;
border: 1px solid #ddb;
padding: 7px;
@ -378,14 +377,12 @@ div.body p.centered {
/* -- content of sidebars/topics/admonitions -------------------------------- */
div.sidebar > :last-child,
aside.sidebar > :last-child,
div.topic > :last-child,
div.admonition > :last-child {
margin-bottom: 0;
}
div.sidebar::after,
aside.sidebar::after,
div.topic::after,
div.admonition::after,
blockquote::after {
@ -458,22 +455,20 @@ td > :last-child {
/* -- figures --------------------------------------------------------------- */
div.figure, figure {
div.figure {
margin: 0.5em;
padding: 0.5em;
}
div.figure p.caption, figcaption {
div.figure p.caption {
padding: 0.3em;
}
div.figure p.caption span.caption-number,
figcaption span.caption-number {
div.figure p.caption span.caption-number {
font-style: italic;
}
div.figure p.caption span.caption-text,
figcaption span.caption-text {
div.figure p.caption span.caption-text {
}
/* -- field list styles ----------------------------------------------------- */
@ -508,63 +503,6 @@ table.hlist td {
vertical-align: top;
}
/* -- object description styles --------------------------------------------- */
.sig {
font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
}
.sig-name, code.descname {
background-color: transparent;
font-weight: bold;
}
.sig-name {
font-size: 1.1em;
}
code.descname {
font-size: 1.2em;
}
.sig-prename, code.descclassname {
background-color: transparent;
}
.optional {
font-size: 1.3em;
}
.sig-paren {
font-size: larger;
}
.sig-param.n {
font-style: italic;
}
/* C++ specific styling */
.sig-inline.c-texpr,
.sig-inline.cpp-texpr {
font-family: unset;
}
.sig.c .k, .sig.c .kt,
.sig.cpp .k, .sig.cpp .kt {
color: #0033B3;
}
.sig.c .m,
.sig.cpp .m {
color: #1750EB;
}
.sig.c .s, .sig.c .sc,
.sig.cpp .s, .sig.cpp .sc {
color: #067D17;
}
/* -- other body styles ----------------------------------------------------- */
@ -691,6 +629,14 @@ dl.glossary dt {
font-size: 1.1em;
}
.optional {
font-size: 1.3em;
}
.sig-paren {
font-size: larger;
}
.versionmodified {
font-style: italic;
}
@ -819,12 +765,8 @@ div.code-block-caption code {
table.highlighttable td.linenos,
span.linenos,
div.highlight span.gp { /* gp: Generic.Prompt */
user-select: none;
-webkit-user-select: text; /* Safari fallback only */
-webkit-user-select: none; /* Chrome/Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+ */
div.doctest > div.highlight span.gp { /* gp: Generic.Prompt */
user-select: none;
}
div.code-block-caption span.caption-number {
@ -839,6 +781,16 @@ div.literal-block-wrapper {
margin: 1em 0;
}
code.descname {
background-color: transparent;
font-weight: bold;
font-size: 1.2em;
}
code.descclassname {
background-color: transparent;
}
code.xref, a code {
background-color: transparent;
font-weight: bold;

File diff suppressed because one or more lines are too long

View file

@ -29,14 +29,9 @@ if (!window.console || !console.firebug) {
/**
* small helper function to urldecode strings
*
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL
*/
jQuery.urldecode = function(x) {
if (!x) {
return x
}
return decodeURIComponent(x.replace(/\+/g, ' '));
return decodeURIComponent(x).replace(/\+/g, ' ');
};
/**
@ -301,14 +296,12 @@ var Documentation = {
window.location.href = prevHref;
return false;
}
break;
case 39: // right
var nextHref = $('link[rel="next"]').prop('href');
if (nextHref) {
window.location.href = nextHref;
return false;
}
break;
}
}
});

10872
docs/_static/jquery.js vendored

File diff suppressed because one or more lines are too long

View file

@ -13,8 +13,7 @@
var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"];
/* Non-minified version is copied as a separate JS file, is available */
/* Non-minified version JS is _stemmer.js if file is provided */
/**
* Porter Stemmer
*/
@ -200,6 +199,7 @@ var Stemmer = function() {
var splitChars = (function() {
var result = {};
var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648,

View file

@ -1,8 +1,8 @@
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
pre { line-height: 125%; margin: 0; }
td.linenos pre { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; }
span.linenos { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; }
td.linenos pre.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight { background: #eeffcc; }
.highlight .c { color: #408090; font-style: italic } /* Comment */

View file

@ -248,7 +248,7 @@ var Search = {
// results left, load the summary and display it
if (results.length) {
var item = results.pop();
var listItem = $('<li></li>');
var listItem = $('<li style="display:none"></li>');
var requestUrl = "";
var linkUrl = "";
if (DOCUMENTATION_OPTIONS.BUILDER === 'dirhtml') {
@ -273,9 +273,9 @@ var Search = {
if (item[3]) {
listItem.append($('<span> (' + item[3] + ')</span>'));
Search.output.append(listItem);
setTimeout(function() {
listItem.slideDown(5, function() {
displayNextItem();
}, 5);
});
} else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
$.ajax({url: requestUrl,
dataType: "text",
@ -285,16 +285,16 @@ var Search = {
listItem.append(Search.makeSearchSummary(data, searchterms, hlterms));
}
Search.output.append(listItem);
setTimeout(function() {
listItem.slideDown(5, function() {
displayNextItem();
}, 5);
});
}});
} else {
// no source available, just display title
Search.output.append(listItem);
setTimeout(function() {
listItem.slideDown(5, function() {
displayNextItem();
}, 5);
});
}
}
// search finished, update title and status message
@ -379,13 +379,6 @@ var Search = {
return results;
},
/**
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
*/
escapeRegExp : function(string) {
return string.replace(/[.*+\-?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
},
/**
* search for full-text terms in the index
*/
@ -409,14 +402,13 @@ var Search = {
];
// add support for partial matches
if (word.length > 2) {
var word_regex = this.escapeRegExp(word);
for (var w in terms) {
if (w.match(word_regex) && !terms[word]) {
if (w.match(word) && !terms[word]) {
_o.push({files: terms[w], score: Scorer.partialTerm})
}
}
for (var w in titleterms) {
if (w.match(word_regex) && !titleterms[word]) {
if (w.match(word) && !titleterms[word]) {
_o.push({files: titleterms[w], score: Scorer.partialTitle})
}
}
@ -509,7 +501,7 @@ var Search = {
var excerpt = ((start > 0) ? '...' : '') +
$.trim(text.substr(start, 240)) +
((start + 240 - text.length) ? '...' : '');
var rv = $('<p class="context"></p>').text(excerpt);
var rv = $('<div class="context"></div>').text(excerpt);
$.each(hlwords, function() {
rv = rv.highlightText(this, 'highlighted');
});

File diff suppressed because one or more lines are too long

View file

@ -3,15 +3,13 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>raylib.dynamic &mdash; Raylib Python documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<title>raylib.dynamic &mdash; Raylib Python documentation</title><link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/graphviz.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
@ -37,7 +35,7 @@
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<p class="caption"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="README.html">Python Bindings for Raylib 3.7</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#license-updated">License (updated)</a></li>

View file

@ -3,15 +3,13 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>raylib.pyray.PyRay &mdash; Raylib Python documentation</title>
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
<title>raylib.pyray.PyRay &mdash; Raylib Python documentation</title><link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/graphviz.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
@ -35,7 +33,7 @@
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<p class="caption"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../README.html">Python Bindings for Raylib 3.7</a></li>
<li class="toctree-l1"><a class="reference internal" href="../README.html#license-updated">License (updated)</a></li>
@ -79,12 +77,13 @@
<div class="section" id="raylib-pyray-pyray">
<h1>raylib.pyray.PyRay<a class="headerlink" href="#raylib-pyray-pyray" title="Permalink to this headline"></a></h1>
<dl class="py class">
<dt class="sig sig-object py" id="raylib.pyray.PyRay">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">raylib.pyray.</span></span><span class="sig-name descname"><span class="pre">PyRay</span></span><a class="headerlink" href="#raylib.pyray.PyRay" title="Permalink to this definition"></a></dt>
<dt id="raylib.pyray.PyRay">
<em class="property">class </em><code class="sig-prename descclassname">raylib.pyray.</code><code class="sig-name descname">PyRay</code><a class="headerlink" href="#raylib.pyray.PyRay" title="Permalink to this definition"></a></dt>
<dd><dl class="py method">
<dt class="sig sig-object py" id="raylib.pyray.PyRay.__init__">
<span class="sig-name descname"><span class="pre">__init__</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#raylib.pyray.PyRay.__init__" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dt id="raylib.pyray.PyRay.__init__">
<code class="sig-name descname">__init__</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#raylib.pyray.PyRay.__init__" title="Permalink to this definition"></a></dt>
<dd><p>Initialize self. See help(type(self)) for accurate signature.</p>
</dd></dl>
<p class="rubric">Methods</p>
<table class="longtable docutils align-default">
@ -262,7 +261,7 @@
<td><p></p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#raylib.pyray.PyRay.__init__" title="raylib.pyray.PyRay.__init__"><code class="xref py py-obj docutils literal notranslate"><span class="pre">__init__</span></code></a>()</p></td>
<td><p></p></td>
<td><p>Initialize self.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../pyray.html#raylib.pyray.PyRay.begin_blend_mode" title="raylib.pyray.PyRay.begin_blend_mode"><code class="xref py py-obj docutils literal notranslate"><span class="pre">begin_blend_mode</span></code></a>(*args)</p></td>
<td><p></p></td>

View file

@ -3,15 +3,13 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Index &mdash; Raylib Python documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<title>Index &mdash; Raylib Python documentation</title><link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/graphviz.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
@ -35,7 +33,7 @@
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<p class="caption"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="README.html">Python Bindings for Raylib 3.7</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#license-updated">License (updated)</a></li>

View file

@ -3,15 +3,13 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Raylib Python &mdash; Raylib Python documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<title>Raylib Python &mdash; Raylib Python documentation</title><link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/graphviz.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
@ -36,7 +34,7 @@
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<p class="caption"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="README.html">Python Bindings for Raylib 3.7</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#license-updated">License (updated)</a></li>
@ -80,7 +78,7 @@
<div class="section" id="raylib-python">
<h1>Raylib Python<a class="headerlink" href="#raylib-python" title="Permalink to this headline"></a></h1>
<div class="toctree-wrapper compound">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<p class="caption"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="README.html">Python Bindings for Raylib 3.7</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#license-updated">License (updated)</a></li>

View file

@ -3,15 +3,13 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Python Module Index &mdash; Raylib Python documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<title>Python Module Index &mdash; Raylib Python documentation</title><link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/graphviz.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
@ -38,7 +36,7 @@
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<p class="caption"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="README.html">Python Bindings for Raylib 3.7</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#license-updated">License (updated)</a></li>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -3,16 +3,14 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Search &mdash; Raylib Python documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<title>Search &mdash; Raylib Python documentation</title><link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/graphviz.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
@ -38,7 +36,7 @@
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<p class="caption"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="README.html">Python Bindings for Raylib 3.7</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#license-updated">License (updated)</a></li>

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,6 @@
#!/usr/bin/bash
pip3 install sphinx-autoapi myst_parser sphinx_rtd_theme
python3 create_stub_pyray.py > raylib/pyray.pyi
python3 create_stub_static.py >raylib/static/__init__.pyi
cd docs-src