* latest raylib version * add libwayland-dev * update headers * add libxkbcommon-dev * sdl * sdl dl * sdl dl * sdl2 link flags * remove glfw header * try static sdl build * try to set fpic * install alsa etc before building sdl * windows * fix * try * try * try * try * try * try * try * try * try * try * try * try * try * try mac * try mac * try mac * try mac * try * try * try * try * try * try * try * try * try * try * try * try * try * try * try * try * try * try * try * try * try * try * try * try * try * try * try * try * try * try * try * try * try * try * try * try * try * update raylib * try * try * try * try * try * try * try * try * try * try * try * try * try * try * try * update to 5.5 * dont link x11 if using DRM * update to fixed raylib version
162 lines
No EOL
8.7 KiB
HTML
162 lines
No EOL
8.7 KiB
HTML
|
||
|
||
<!DOCTYPE html>
|
||
<html class="writer-html5" lang="en" data-content_root="./">
|
||
<head>
|
||
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
|
||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||
<title>Dynamic Bindings — Raylib Python documentation</title>
|
||
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
|
||
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />
|
||
<link rel="stylesheet" type="text/css" href="_static/graphviz.css?v=4ae1632d" />
|
||
|
||
|
||
<script src="_static/jquery.js?v=5d32c60e"></script>
|
||
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
||
<script src="_static/documentation_options.js?v=5929fcd5"></script>
|
||
<script src="_static/doctools.js?v=9bcbadda"></script>
|
||
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
|
||
<script src="_static/js/theme.js"></script>
|
||
<link rel="index" title="Index" href="genindex.html" />
|
||
<link rel="search" title="Search" href="search.html" />
|
||
<link rel="next" title="Building from source" href="BUILDING.html" />
|
||
<link rel="prev" title="C API" href="raylib.html" />
|
||
</head>
|
||
|
||
<body class="wy-body-for-nav">
|
||
<div class="wy-grid-for-nav">
|
||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
||
<div class="wy-side-scroll">
|
||
<div class="wy-side-nav-search" >
|
||
|
||
|
||
|
||
<a href="index.html" class="icon icon-home">
|
||
Raylib Python
|
||
</a>
|
||
<div role="search">
|
||
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
|
||
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
|
||
<input type="hidden" name="check_keywords" value="yes" />
|
||
<input type="hidden" name="area" value="default" />
|
||
</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>
|
||
<ul class="current">
|
||
<li class="toctree-l1"><a class="reference internal" href="README.html">Python Bindings for Raylib 5.5</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="README.html#quickstart">Quickstart</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="README.html#installation">Installation</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="README.html#how-to-use">How to use</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="README.html#running-in-a-web-browser">Running in a web browser</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="README.html#app-showcase">App showcase</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="README.html#rlzero">RLZero</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="README.html#help-wanted">Help wanted</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="README.html#license">License</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="README.html#performance">Performance</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="README.html#packaging-your-app">Packaging your app</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="README.html#advert">Advert</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="pyray.html">Python API</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="raylib.html">C API</a></li>
|
||
<li class="toctree-l1 current"><a class="current reference internal" href="#">Dynamic Bindings</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="BUILDING.html">Building from source</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="RPI.html">Raspberry Pi</a></li>
|
||
</ul>
|
||
|
||
</div>
|
||
</div>
|
||
</nav>
|
||
|
||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
|
||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||
<a href="index.html">Raylib Python</a>
|
||
</nav>
|
||
|
||
<div class="wy-nav-content">
|
||
<div class="rst-content">
|
||
<div role="navigation" aria-label="Page navigation">
|
||
<ul class="wy-breadcrumbs">
|
||
<li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
|
||
<li class="breadcrumb-item active">Dynamic Bindings</li>
|
||
<li class="wy-breadcrumbs-aside">
|
||
<a href="_sources/dynamic.rst.txt" rel="nofollow"> View page source</a>
|
||
</li>
|
||
</ul>
|
||
<hr/>
|
||
</div>
|
||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
||
<div itemprop="articleBody">
|
||
|
||
<section id="dynamic-bindings">
|
||
<h1>Dynamic Bindings<a class="headerlink" href="#dynamic-bindings" title="Link to this heading"></a></h1>
|
||
<p>CFFI ABI dynamic bindings avoid the need to compile a C extension module. They now been moved to a separate module:</p>
|
||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">python3</span> <span class="o">-</span><span class="n">m</span> <span class="n">pip</span> <span class="n">install</span> <span class="n">raylib_dynamic</span>
|
||
</pre></div>
|
||
</div>
|
||
<div class="admonition warning">
|
||
<p class="admonition-title">Warning</p>
|
||
<p>There have been some weird failures with dynamic bindings and ctypes bindings before and often the
|
||
failures are silent
|
||
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.</p>
|
||
</div>
|
||
<p>The 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:</p>
|
||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">raylib</span> <span class="kn">import</span> <span class="o">*</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>Instead you have to do:</p>
|
||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">raylib</span> <span class="kn">import</span> <span class="n">rl</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>Then you access the functions with <code class="docutils literal notranslate"><span class="pre">rl.</span></code> prefix.</p>
|
||
<p>See <a class="reference external" href="https://github.com/electronstudio/raylib-python-cffi/blob/master/dynamic/test_dynamic.py">https://github.com/electronstudio/raylib-python-cffi/blob/master/dynamic/test_dynamic.py</a> for an example.</p>
|
||
<p>If you use the <code class="docutils literal notranslate"><span class="pre">rl.</span></code> prefix then code will work on both static and dynamic bindings.</p>
|
||
<div class="admonition tip">
|
||
<p class="admonition-title">Tip</p>
|
||
<p>If you access functions via <code class="docutils literal notranslate"><span class="pre">import</span> <span class="pre">pyray</span></code> then there is no difference at all, but be warned this hasn’t been tested much.</p>
|
||
</div>
|
||
<div class="admonition note">
|
||
<p class="admonition-title">Note</p>
|
||
<p>Standard Raylib DLLs do not include additional libraries like Raygui, Physac, etc. So these functions won’t work.</p>
|
||
</div>
|
||
<div class="admonition important">
|
||
<p class="admonition-title">Important</p>
|
||
<p>If your system already has the Raylib library installed, you can set the environment variable <code class="docutils literal notranslate"><span class="pre">USE_EXTERNAL_RAYLIB</span></code> and it will
|
||
always be used instead of the bundled DLLs.</p>
|
||
</div>
|
||
</section>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
|
||
<a href="raylib.html" class="btn btn-neutral float-left" title="C API" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
||
<a href="BUILDING.html" class="btn btn-neutral float-right" title="Building from source" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
||
</div>
|
||
|
||
<hr/>
|
||
|
||
<div role="contentinfo">
|
||
<p>© Copyright 2021, Richard Smith.</p>
|
||
</div>
|
||
|
||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
||
|
||
|
||
</footer>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
</div>
|
||
<script>
|
||
jQuery(function () {
|
||
SphinxRtdTheme.Navigation.enable(true);
|
||
});
|
||
</script>
|
||
|
||
</body>
|
||
</html> |