improve docs, make clear different APIs and static/dynamic
This commit is contained in:
parent
47c4d0d1b4
commit
9e17046408
49 changed files with 5467 additions and 17850 deletions
|
@ -1,28 +1,38 @@
|
|||
raylib.dynamic
|
||||
==============
|
||||
|
||||
CFFI ABI dynamic bindings exist in order to avoid the need to compile a C extension module.
|
||||
|
||||
See https://github.com/electronstudio/raylib-python-cffi/blob/master/test_static.py for how to use.
|
||||
|
||||
Currently the github version may include bundled DLLs in ``raylib/dynamic`` but the pypi version requires a system installed Raylib.
|
||||
You can put your own DLLs in ``raylib/dynamic`` if you prefer.
|
||||
|
||||
If your system already has the Raylib library installed, you can set the environment variable ``USE_EXTERNAL_RAYLIB`` and it will
|
||||
always be used instead of the bundled DLLs.
|
||||
|
||||
If you want to build your own wheel with just raylib.dynamic and not even attempt to compile the static libraries,
|
||||
the command is::
|
||||
|
||||
python3 setup_dynamic.py bdist_wheel
|
||||
Dynamic Bindings
|
||||
================
|
||||
|
||||
CFFI ABI dynamic bindings avoid the need to compile a C extension module. They now been moved to a separate module::
|
||||
|
||||
python3 -m pip install raylib_dynamic
|
||||
|
||||
.. warning::
|
||||
|
||||
There have been some weird failures with dynamic bindings and ctypes bindings before and often the
|
||||
failures are silent
|
||||
so you dont even know. Also the static bindings should be faster. Therefore I personally recommend the static ones.
|
||||
But the dynamic bindings have the big advantage that you don't need to compile anything to install. You just need a Raylib DLL.
|
||||
so you don't even know something has gone wrong and you don't get proper stacktraces. Also the static bindings are faster.
|
||||
Therefore I personally recommend the static ones.
|
||||
But the dynamic bindings have the advantage that you don't need to compile anything to install. You just need a Raylib DLL.
|
||||
|
||||
API is the same as raylib.static.
|
||||
API is exactly the same as the static one documented here. (Therefore you can't have both modules installed at once.) The only difference is you can't do::
|
||||
|
||||
from raylib import *
|
||||
|
||||
Instead you have to do::
|
||||
|
||||
from raylib import rl
|
||||
|
||||
Then you access the functions with ``rl.`` prefix. See
|
||||
|
||||
See https://github.com/electronstudio/raylib-python-cffi/blob/master/dynamic/test_dynamic.py for an example.
|
||||
|
||||
If you use the ``rl.`` prefix then code will work on both static and dynamic bindings.
|
||||
|
||||
.. warning::
|
||||
|
||||
If you access functions via ``raylib.pyray`` then there is no difference at all, but be warned this hasn't been tested.
|
||||
|
||||
|
||||
.. important::
|
||||
|
||||
If your system already has the Raylib library installed, you can set the environment variable ``USE_EXTERNAL_RAYLIB`` and it will
|
||||
always be used instead of the bundled DLLs.
|
||||
|
|
Reference in a new issue