diff --git a/BUILDING.rst b/BUILDING.rst index 8d09717..5923093 100644 --- a/BUILDING.rst +++ b/BUILDING.rst @@ -59,8 +59,7 @@ Build and install Raylib from the raylib-c directory. 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. +and extract ``raylib.dll`` into ``dynamic/raylib``. To build a binary wheel distribution: @@ -111,7 +110,7 @@ Build and install Raylib from the raylib-c directory. sudo make install .. note:: Optional: Build the Raylib shared libs, if you plan to use - ``raylib.dynamic`` binding. + ``raylib_dynamic`` binding. :: @@ -148,8 +147,8 @@ Build :: - rm raylib/dynamic/*.so* - cp -P /usr/local/lib/libraylib.so* raylib/dynamic/ + rm dynamic/raylib/*.so* + cp -P /usr/local/lib/libraylib.so* dynamic/raylib/ To build a binary wheel distribution: @@ -158,12 +157,6 @@ 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: @@ -183,8 +176,8 @@ To build a complete set of libs for Python 3.6, 3.7, 3.8 and 3.9: ``./raylib/static/build_multi_linux.sh`` ) .. TODO:: - move the dynamic libs into a separate package rather than include - them with every one. + Separate the instructions for preparing the dynamic module + from the instructions for building the static module! diff --git a/README.md b/README.md index 9332e14..ec8bb17 100644 --- a/README.md +++ b/README.md @@ -27,24 +27,26 @@ using homebrew, apt, etc. [If it doesn't work, build from source](BUILDING.md) +There is now a separate dynamic version of this binding: + + python3 -m pip install raylib_dynamic + +[Read this before using raylib_dynamic](https://electronstudio.github.io/raylib-python-cffi/dynamic.html) # How to use -There are three different ways of using this binding. You only need to pick one method, but you +There are two different ways of using this binding. You only need to pick one method, but you can combine two methods in one program if you want to. ### If you are familiar with C coding and the Raylib C library and you want to use an exact copy of the C API -Use [raylib.static](https://electronstudio.github.io/raylib-python-cffi/raylib.html). +Use [the C API](https://electronstudio.github.io/raylib-python-cffi/raylib.html). ### If you prefer a slightly more Pythonistic API and don't mind it might be slightly slower -Use [raylib.pyray](https://electronstudio.github.io/raylib-python-cffi/pyray.html). +Use [the Python API](https://electronstudio.github.io/raylib-python-cffi/pyray.html). -### If you insist on dynamic bindings and don't care that they are slower and less safe - -Use [raylib.dynamic](https://electronstudio.github.io/raylib-python-cffi/dynamic.html). diff --git a/docs-src/_build/doctrees/BUILDING.doctree b/docs-src/_build/doctrees/BUILDING.doctree index 1483bfd..1bcd50f 100644 Binary files a/docs-src/_build/doctrees/BUILDING.doctree and b/docs-src/_build/doctrees/BUILDING.doctree differ diff --git a/docs-src/_build/doctrees/README.doctree b/docs-src/_build/doctrees/README.doctree index 162dc9f..109cc6c 100644 Binary files a/docs-src/_build/doctrees/README.doctree and b/docs-src/_build/doctrees/README.doctree differ diff --git a/docs-src/_build/doctrees/dynamic.doctree b/docs-src/_build/doctrees/dynamic.doctree index 3fdf555..b7ef39a 100644 Binary files a/docs-src/_build/doctrees/dynamic.doctree and b/docs-src/_build/doctrees/dynamic.doctree differ diff --git a/docs-src/_build/doctrees/environment.pickle b/docs-src/_build/doctrees/environment.pickle index dd10473..f55276c 100644 Binary files a/docs-src/_build/doctrees/environment.pickle and b/docs-src/_build/doctrees/environment.pickle differ diff --git a/docs-src/_build/doctrees/generated/raylib.pyray.PyRay.doctree b/docs-src/_build/doctrees/generated/raylib.pyray.PyRay.doctree index 69e46b2..b745926 100644 Binary files a/docs-src/_build/doctrees/generated/raylib.pyray.PyRay.doctree and b/docs-src/_build/doctrees/generated/raylib.pyray.PyRay.doctree differ diff --git a/docs-src/_build/doctrees/index.doctree b/docs-src/_build/doctrees/index.doctree index 3a51c5a..f4575f4 100644 Binary files a/docs-src/_build/doctrees/index.doctree and b/docs-src/_build/doctrees/index.doctree differ diff --git a/docs-src/_build/doctrees/pyray.doctree b/docs-src/_build/doctrees/pyray.doctree index 764d70d..5c1fed3 100644 Binary files a/docs-src/_build/doctrees/pyray.doctree and b/docs-src/_build/doctrees/pyray.doctree differ diff --git a/docs-src/_build/doctrees/raylib.doctree b/docs-src/_build/doctrees/raylib.doctree index b6e66f8..ab8a72e 100644 Binary files a/docs-src/_build/doctrees/raylib.doctree and b/docs-src/_build/doctrees/raylib.doctree differ diff --git a/docs-src/_build/html/.buildinfo b/docs-src/_build/html/.buildinfo index 7ec31ce..383a7b7 100644 --- a/docs-src/_build/html/.buildinfo +++ b/docs-src/_build/html/.buildinfo @@ -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: c6c8605a01fab3fc8b4c8636342889f3 +config: ea2d09333a22dd4475734aaaf7403057 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs-src/pyray.rst b/docs-src/pyray.rst index 883cd66..6dfe959 100644 --- a/docs-src/pyray.rst +++ b/docs-src/pyray.rst @@ -1,5 +1,5 @@ -raylib.pyray -============ +Python API +============== .. comment:: @@ -10,7 +10,7 @@ raylib.pyray autoapi/raylib/pyray/index -This is a wrapper around the static bindings. +This is a wrapper around the C API with some syntactic sugar. The API is *still the same as Raylib*, so you should still reply on `the official Raylib docs `_, except: diff --git a/docs-src/raylib.rst b/docs-src/raylib.rst index 5cc2934..7ca4a46 100644 --- a/docs-src/raylib.rst +++ b/docs-src/raylib.rst @@ -1,14 +1,14 @@ -raylib.static +C API ============= -The goal of raylib.static is make usage as similar to the original C as CFFI will allow. The `example programs `_ +The goal of the C API is make usage as similar to the original C as CFFI will allow. The `example programs `_ are very, very similar to the C originals. Example program: .. code-block:: - from raylib.static import * + from raylib import * InitWindow(800, 450, b"Hello Raylib") SetTargetFPS(60) @@ -27,18 +27,30 @@ Example program: EndDrawing() CloseWindow() +If you want to be more portable you can prefix the functions like this: + +.. code-block:: + + from raylib import ffi, rl, colors + + rl.InitWindow(800, 450, b"Hello Raylib") + rl.SetTargetFPS(60) + + ... + + See also https://github.com/electronstudio/raylib-python-cffi/blob/master/test_static.py -Also useful to read whenever you need to convert stuff between C and Python: https://cffi.readthedocs.io +.. note:: Whenever you need to convert stuff between C and Python see https://cffi.readthedocs.io -Your **primary reference** should always be `the official Raylib docs `_ +.. important:: Your **primary reference** should always be `the official Raylib docs `_ However, here is a list of available functions: Functions API reference ----------------------- -.. autoapimodule:: raylib.static +.. autoapimodule:: raylib :members: :undoc-members: diff --git a/docs/.buildinfo b/docs/.buildinfo index 7ec31ce..383a7b7 100644 --- a/docs/.buildinfo +++ b/docs/.buildinfo @@ -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: c6c8605a01fab3fc8b4c8636342889f3 +config: ea2d09333a22dd4475734aaaf7403057 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/BUILDING.html b/docs/BUILDING.html index c541ba8..439e9ad 100644 --- a/docs/BUILDING.html +++ b/docs/BUILDING.html @@ -1,22 +1,25 @@ - + + - Building from source — Raylib Python documentation - + Building from source — Raylib Python documentation + + - + + - + @@ -34,7 +37,7 @@ + + +