Bump raylib to 5.0, Bump RayGUI to 4.0

Generate bindings for raylib's embedded GLFW, to enable lower-level examples (see examples/others/rlgl_standalone.py)
Dynamically generate defines at library build-time, they are known by the raylib parser.
Bug fix, allow raylib parser to see RayGUI, Physac, and RayMath exported functions, get proper argument names from functions, provide real argument names on interface definitions.
This commit is contained in:
Ashley Sommer 2023-12-19 00:41:55 +10:00
parent 3b01e59338
commit d7c5fea7d0
46 changed files with 16071 additions and 8142 deletions

View file

@ -44,6 +44,7 @@ jobs:
- name: Copy extras
run: |
sudo cp -r raylib-c/src/external/glfw/include/GLFW /usr/local/include/
sudo cp physac/src/physac.h /usr/local/include/
sudo cp raygui/src/raygui.h /usr/local/include/
@ -193,6 +194,7 @@ jobs:
sudo make install
- name: Copy extras
run: |
sudo cp -r raylib-c/src/external/glfw/include/GLFW /usr/local/include/
sudo cp physac/src/physac.h /usr/local/include/
sudo cp raygui/src/raygui.h /usr/local/include/
- name: Build raylib-python-cffi
@ -325,6 +327,7 @@ jobs:
sudo make install
- name: Copy extras
run: |
sudo cp -r raylib-c/src/external/glfw/include/GLFW /usr/local/include/
sudo cp physac/src/physac.h /usr/local/include/
sudo cp raygui/src/raygui.h /usr/local/include/

105
create_define_consts.py Normal file
View file

@ -0,0 +1,105 @@
# Copyright (c) 2021 Richard Smith and others
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0.
#
# This Source Code may also be made available under the following Secondary
# licenses when the conditions for such availability set forth in the Eclipse
# Public License, v. 2.0 are satisfied: GNU General Public License, version 2
# with the GNU Classpath Exception which is
# available at https://www.gnu.org/software/classpath/license.html.
#
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
from raylib import rl, ffi
from inspect import ismethod, getmembers, isbuiltin
import inflection, sys, json, re
two_or = re.compile(r'''\(\s*([^\s]*)\s*\|\s*([^\s]*)\s*\)''')
three_or = re.compile(r'''\(\s*([^\s]*)\s*\|\s*([^\s]*)\s*\|\s*(^\s*)\s*\)''')
two_mult = re.compile(r'''\(\s*([^\s]*)\s*\*\s*([^\s]*)\s*\)''')
two_div = re.compile(r'''\(\s*([^\s]*)\s*/\s*([^\s]*)\s*\)''')
def process(filename):
f = open(filename, "r")
js = json.load(f)
known_define = []
known_enum = []
for e in js['enums']:
if e['name'] and e['values']:
for v in e['values']:
if v['name']:
known_enum.append(str(v['name']).strip())
for e in js['defines']:
if e['type'] in ('INT', 'FLOAT', 'STRING'):
if e['type'] == 'INT':
print(e['name'] + ": int = " + str(e['value']).strip())
elif e['type'] == 'FLOAT':
print(e['name'] + ": float = " + str(e['value']).strip())
else:
print(e['name'] + ": str = \"" + str(e['value']).strip() + '"')
known_define.append(str(e['name']).strip())
elif e['type'] == "UNKNOWN":
strval = str(e['value']).strip()
if strval.startswith("__"):
continue
if strval in known_enum:
print(e['name'] + " = raylib." + strval)
elif strval in known_define:
print(e['name'] + " = " + strval)
else:
matches = two_or.match(strval)
if not matches:
matches = three_or.match(strval)
if matches:
match_defs = [str(m).strip() for m in matches.groups()]
if all(d in known_enum for d in match_defs):
print(e['name'] + " = " + " | ".join(("raylib."+m) for m in match_defs))
elif all(d in known_define for d in match_defs):
print(e['name'] + " = " + " | ".join(match_defs))
else:
continue
known_define.append(str(e['name']).strip())
elif e['type'] == "FLOAT_MATH":
strval = str(e['value']).strip()
matches = two_mult.match(strval)
if matches:
match_defs = [str(m).strip() for m in matches.groups()]
match_parts = []
for m in match_defs:
if "." in m:
match_parts.append(m.rstrip("f"))
else:
match_parts.append(m)
if all(d in known_enum for d in match_parts):
print(e['name'] + " = " + " * ".join(("raylib." + m) for m in match_parts))
elif all(d in known_define for d in match_parts):
print(e['name'] + " = " + " * ".join(match_parts))
else:
matches = two_div.match(strval)
if matches:
match_defs = [str(m).strip() for m in matches.groups()]
match_parts = []
for m in match_defs:
if "." in m:
match_parts.append(m.rstrip("f"))
else:
match_parts.append(m)
if any(d in known_enum for d in match_parts):
print(e['name'] + " = " + " / ".join(("raylib." + m) for m in match_parts))
elif any(d in known_define for d in match_parts):
print(e['name'] + " = " + " / ".join(match_parts))
else:
continue
print("import raylib\n")
process("raylib.json")
process("raymath.json")
process("rlgl.json")
process("raygui.json")
process("physac.json")
process("glfw3.json")

View file

@ -33,4 +33,5 @@ print("""from enum import IntEnum
process("raylib.json")
process("raygui.json")
process("glfw3.json")

View file

@ -12,13 +12,23 @@
#
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
from pathlib import Path
from raylib import rl, ffi
from inspect import ismethod, getmembers, isbuiltin
import inflection, sys, json
f = open("raylib.json", "r")
js = json.load(f)
known_functions = {}
known_structs = {}
for filename in (Path("raylib.json"), Path("raymath.json"), Path("rlgl.json"), Path("raygui.json"), Path("physac.json")):
f = open(filename, "r")
js = json.load(f)
for fn in js["functions"]:
if fn["name"] not in known_functions:
known_functions[fn["name"]] = fn
for st in js["structs"]:
if st["name"] not in known_structs:
known_structs[st["name"]] = st
def ctype_to_python_type(t):
if t == '_Bool':
@ -51,16 +61,17 @@ def pointer(struct):
...
""")
# These words can be used for c arg names, but not in python
reserved_words = ("in", "list", "tuple", "set", "dict", "from", "range", "min", "max", "any", "all", "len")
for name, attr in getmembers(rl):
uname = inflection.underscore(name).replace('3_d', '_3d').replace('2_d', '_2d')
if isbuiltin(attr) or str(type(attr)) == "<class '_cffi_backend.__FFIFunctionWrapper'>":
json_array = [x for x in js['functions'] if x['name'] == name]
json_object = {}
if len(json_array) > 0:
json_object = json_array[0]
json_object = known_functions.get(name, None)
if json_object is None:
# this is _not_ an exported function from raylib, raymath, rlgl raygui or physac
# so we don't want it in the pyray API
continue
sig = ""
for i, arg in enumerate(ffi.typeof(attr).args):
param_name = arg.cname.replace("struct", "").replace("char *", "str").replace("*",
@ -69,7 +80,9 @@ for name, attr in getmembers(rl):
if 'params' in json_object:
p = json_object['params']
param_name = list(p)[i]['name']
# don't use a python reserved word:
if param_name in reserved_words:
param_name = param_name + "_" + str(i)
param_type = ctype_to_python_type(arg.cname)
sig += f"{param_name}: {param_type},"
@ -95,11 +108,13 @@ for name, attr in getmembers(rl):
for struct in ffi.list_types()[0]:
print("processing", struct, file=sys.stderr)
# json_array = [x for x in js['structs'] if x['name'] == name]
# json_object = {}
# if len(json_array) > 0:
# json_object = json_array[0]
if ffi.typeof(struct).kind == "struct":
json_object = known_structs.get(struct, None)
if json_object is None:
# this is _not_ an exported struct from raylib, raymath, rlgl raygui or physac
# so we don't want it in the pyray API
continue
if ffi.typeof(struct).fields is None:
print("weird empty struct, skipping "+struct, file=sys.stderr)
continue

View file

@ -12,14 +12,22 @@
#
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
from pathlib import Path
from raylib import rl, ffi
from inspect import ismethod, getmembers, isbuiltin
import inflection, sys, json
f = open("raylib.json", "r")
js = json.load(f)
known_functions = {}
known_structs = {}
for filename in (Path("raylib.json"), Path("raymath.json"), Path("rlgl.json"), Path("raygui.json"), Path("physac.json"), Path("glfw3.json")):
f = open(filename, "r")
js = json.load(f)
for fn in js["functions"]:
if fn["name"] not in known_functions:
known_functions[fn["name"]] = fn
for st in js["structs"]:
if st["name"] not in known_structs:
known_structs[st["name"]] = st
@ -59,22 +67,28 @@ class struct: ...
""")
# These words can be used for c arg names, but not in python
reserved_words = ("in", "list", "tuple", "set", "dict", "from", "range", "min", "max", "any", "all", "len")
for name, attr in getmembers(rl):
uname = name
if isbuiltin(attr) or str(type(attr)) == "<class '_cffi_backend.__FFIFunctionWrapper'>":
json_array = [x for x in js['functions'] if x['name'] == name]
json_object = {}
if len(json_array) > 0:
json_object = json_array[0]
json_object = known_functions.get(name, {})
sig = ""
for i, arg in enumerate(ffi.typeof(attr).args):
param_name = arg.cname.replace("struct", "").replace("char *", "str").replace("*",
"_pointer").replace(
" ", "")+"_"+str(i)
if ")(" in arg.cname:
# fn signature in arg types
param_name = str(arg.cname).split("(", 1)[0] + "_callback_" + str(i)
else:
param_name = arg.cname.replace("struct", "").replace("char *", "str").replace("*",
"_pointer").replace(" ", "")+"_"+str(i)
if 'params' in json_object:
p = json_object['params']
#print("param_name: ", param_name, "i", i, "params: ",p,file=sys.stderr)
param_name = list(p)[i]['name']
# don't use a python reserved word:
if param_name in reserved_words:
param_name = param_name+"_"+str(i)
param_type = ctype_to_python_type(arg.cname)
sig += f"{param_name}: {param_type},"

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: d3f6c06ab2f036ecf2386ff26e8dd625
config: 2de4f6370c9579a879a3fad007556483
tags: 645f666f9bcd5a90fca523b33c5a78b7

View file

@ -1,22 +1,24 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<html class="writer-html5" lang="en" data-content_root="./">
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
<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>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" />
<link rel="stylesheet" href="_static/graphviz.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=19f00094" />
<link rel="stylesheet" type="text/css" href="_static/graphviz.css?v=eafc0fe6" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script src="_static/jquery.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<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=888ff710"></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" />
@ -97,9 +99,9 @@
<div itemprop="articleBody">
<section id="building-from-source">
<h1>Building from source<a class="headerlink" href="#building-from-source" title="Permalink to this heading"></a></h1>
<h1>Building from source<a class="headerlink" href="#building-from-source" title="Link to this heading"></a></h1>
<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 heading"></a></h2>
<h2>Have Pip build from source<a class="headerlink" href="#have-pip-build-from-source" title="Link to this heading"></a></h2>
<p>This is useful if the binaries dont work on your system, or you want to use a newer version of Raylib.</p>
<p>First make sure Raylib is installed. On Linux/Mac it must include the pkg-config files. Best way to ensure this
is to compile and install Raylib using CMake: <a class="reference external" href="https://github.com/raysan5/raylib/wiki/Working-on-GNU-Linux#build-raylib-using-cmake">https://github.com/raysan5/raylib/wiki/Working-on-GNU-Linux#build-raylib-using-cmake</a></p>
@ -118,7 +120,7 @@ is to compile and install Raylib using CMake: <a class="reference external" href
</div>
</section>
<section id="or-build-from-source-manually">
<h2>Or, Build from source manually<a class="headerlink" href="#or-build-from-source-manually" title="Permalink to this heading"></a></h2>
<h2>Or, Build from source manually<a class="headerlink" href="#or-build-from-source-manually" title="Link to this heading"></a></h2>
<p>Useful if the Pip build doesnt work and you want to debug it, or you want to contribute to the
project.</p>
<div class="admonition attention">
@ -129,7 +131,7 @@ fixed it, a PR.)</p>
<p>Manual instructions follow, but may be outdated, so see also how we actually build the wheels
at <a class="reference external" href="https://github.com/electronstudio/raylib-python-cffi/blob/master/.github/workflows/build.yml">https://github.com/electronstudio/raylib-python-cffi/blob/master/.github/workflows/build.yml</a></p>
<section id="windows-manual-build">
<h3>Windows manual build<a class="headerlink" href="#windows-manual-build" title="Permalink to this heading"></a></h3>
<h3>Windows manual build<a class="headerlink" href="#windows-manual-build" title="Link to this heading"></a></h3>
<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>
@ -171,7 +173,7 @@ Would be useful if some Windows user could figure out how to auto detect this.</
here.)</p>
</section>
<section id="linux-manual-build">
<h3>Linux manual build<a class="headerlink" href="#linux-manual-build" title="Permalink to this heading"></a></h3>
<h3>Linux manual build<a class="headerlink" href="#linux-manual-build" title="Link to this heading"></a></h3>
<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>
@ -245,7 +247,7 @@ from the instructions for building the static module!</p>
</div>
</section>
<section id="macos-manual-build">
<h3>Macos manual build<a class="headerlink" href="#macos-manual-build" title="Permalink to this heading"></a></h3>
<h3>Macos manual build<a class="headerlink" href="#macos-manual-build" title="Link to this heading"></a></h3>
<p>These instructions have been tested on Macos 10.14.</p>
<p>Clone this repo including submodules so you get correct version of
Raylib.</p>

View file

@ -1,22 +1,24 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<html class="writer-html5" lang="en" data-content_root="./">
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
<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>Python Bindings for Raylib 4.5 &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" />
<link rel="stylesheet" href="_static/graphviz.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=19f00094" />
<link rel="stylesheet" type="text/css" href="_static/graphviz.css?v=eafc0fe6" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script src="_static/jquery.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<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=888ff710"></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" />
@ -101,7 +103,7 @@
<div itemprop="articleBody">
<section id="python-bindings-for-raylib-4-5">
<h1>Python Bindings for Raylib 4.5<a class="headerlink" href="#python-bindings-for-raylib-4-5" title="Permalink to this heading"></a></h1>
<h1>Python Bindings for Raylib 4.5<a class="headerlink" href="#python-bindings-for-raylib-4-5" title="Link to this heading"></a></h1>
<p>New CFFI API static bindings.</p>
<ul class="simple">
<li><p>Automatically generated to be as close as possible to
@ -114,7 +116,7 @@ original Raylib.</p></li>
<p><a class="reference external" href="http://electronstudio.github.io/raylib-python-cffi">Full documentation</a></p>
</section>
<section id="quickstart">
<h1>Quickstart<a class="headerlink" href="#quickstart" title="Permalink to this heading"></a></h1>
<h1>Quickstart<a class="headerlink" href="#quickstart" title="Link to this heading"></a></h1>
<p><code class="docutils literal notranslate"><span class="pre">pip3</span> <span class="pre">install</span> <span class="pre">raylib</span></code></p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>from pyray import *
init_window(800, 450, &quot;Hello&quot;)
@ -128,7 +130,7 @@ close_window()
</div>
</section>
<section id="installation">
<h1>Installation<a class="headerlink" href="#installation" title="Permalink to this heading"></a></h1>
<h1>Installation<a class="headerlink" href="#installation" title="Link to this heading"></a></h1>
<p>First make sure you have the latest pip installed:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>python3 -m pip install --upgrade pip
</pre></div>
@ -142,11 +144,11 @@ python3 -m pip install raylib
<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>
<section id="raspberry-pi">
<h2>Raspberry Pi<a class="headerlink" href="#raspberry-pi" title="Permalink to this heading"></a></h2>
<h2>Raspberry Pi<a class="headerlink" href="#raspberry-pi" title="Link to this heading"></a></h2>
<p><a class="reference internal" href="RPI.html"><span class="std std-doc">Using on Rasperry Pi</span></a></p>
</section>
<section id="dynamic-binding-version">
<h2>Dynamic binding version<a class="headerlink" href="#dynamic-binding-version" title="Permalink to this heading"></a></h2>
<h2>Dynamic binding version<a class="headerlink" href="#dynamic-binding-version" title="Link to this heading"></a></h2>
<p>There is now a separate dynamic version of this binding:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>python3 -m pip install raylib_dynamic
</pre></div>
@ -154,7 +156,7 @@ using homebrew, apt, etc.</p>
<p>It works on some systems where the static version doesnt, <a class="reference external" href="https://electronstudio.github.io/raylib-python-cffi/dynamic.html">but be sure to read these caveats before using it</a></p>
</section>
<section id="beta-testing">
<h2>Beta testing<a class="headerlink" href="#beta-testing" title="Permalink to this heading"></a></h2>
<h2>Beta testing<a class="headerlink" href="#beta-testing" title="Link to this heading"></a></h2>
<p>If you find a bug, it may be fixed in the <a class="reference external" href="https://github.com/electronstudio/raylib-python-cffi/releases">latest dev release</a>.
You can install an alpha or beta version by specifying the exact version number like this:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>python3 -m pip install raylib==4.2.0.0.dev4
@ -162,7 +164,7 @@ You can install an alpha or beta version by specifying the exact version number
</div>
</section>
<section id="problems">
<h2>Problems?<a class="headerlink" href="#problems" title="Permalink to this heading"></a></h2>
<h2>Problems?<a class="headerlink" href="#problems" title="Link to this heading"></a></h2>
<p>If it doesnt work, <a class="reference internal" href="BUILDING.html"><span class="std std-doc">try to build manually.</span></a>. If that works then <a class="reference external" href="https://github.com/electronstudio/raylib-python-cffi/issues">submit an issue</a>
to let us know what you did.</p>
<p>If you need help you can try asking <a class="reference external" href="https://discord.gg/raylib">on Discord</a>.</p>
@ -170,48 +172,48 @@ to let us know what you did.</p>
</section>
</section>
<section id="how-to-use">
<h1>How to use<a class="headerlink" href="#how-to-use" title="Permalink to this heading"></a></h1>
<h1>How to use<a class="headerlink" href="#how-to-use" title="Link to this heading"></a></h1>
<p>There are two APIs, you can use either or both:</p>
<section id="if-you-are-familiar-with-c-coding-and-the-raylib-c-library-and-you-want-to-use-an-exact-copy-of-the-c-api">
<h2>If you are familiar with C coding and the Raylib C library and you want to use an exact copy of the C API<a class="headerlink" href="#if-you-are-familiar-with-c-coding-and-the-raylib-c-library-and-you-want-to-use-an-exact-copy-of-the-c-api" title="Permalink to this heading"></a></h2>
<h2>If you are familiar with C coding and the Raylib C library and you want to use an exact copy of the C API<a class="headerlink" href="#if-you-are-familiar-with-c-coding-and-the-raylib-c-library-and-you-want-to-use-an-exact-copy-of-the-c-api" title="Link to this heading"></a></h2>
<p>Use <a class="reference external" href="https://electronstudio.github.io/raylib-python-cffi/raylib.html">the C API</a>.</p>
</section>
<section id="if-you-prefer-a-slightly-more-pythonistic-api-and-don-t-mind-it-might-be-slightly-slower">
<h2>If you prefer a slightly more Pythonistic API and dont mind it might be slightly slower<a class="headerlink" href="#if-you-prefer-a-slightly-more-pythonistic-api-and-don-t-mind-it-might-be-slightly-slower" title="Permalink to this heading"></a></h2>
<h2>If you prefer a slightly more Pythonistic API and dont mind it might be slightly slower<a class="headerlink" href="#if-you-prefer-a-slightly-more-pythonistic-api-and-don-t-mind-it-might-be-slightly-slower" title="Link to this heading"></a></h2>
<p>Use <a class="reference external" href="https://electronstudio.github.io/raylib-python-cffi/pyray.html">the Python API</a>.</p>
</section>
</section>
<section id="app-showcase">
<h1>App showcase<a class="headerlink" href="#app-showcase" title="Permalink to this heading"></a></h1>
<h1>App showcase<a class="headerlink" href="#app-showcase" title="Link to this heading"></a></h1>
<p><a class="reference external" href="https://github.com/pkulev/tanki">Tanki</a></p>
<p><a class="reference external" href="https://pebaz.itch.io/alloy-bloxel-editor">Alloy Bloxel Editor</a></p>
<p>Add your app here!</p>
</section>
<section id="rlzero">
<h1>RLZero<a class="headerlink" href="#rlzero" title="Permalink to this heading"></a></h1>
<h1>RLZero<a class="headerlink" href="#rlzero" title="Link to this heading"></a></h1>
<p>A related library (that is a work in progress!):</p>
<p><a class="reference external" href="https://github.com/electronstudio/rlzero">A simplified API for Raylib for use in education and to enable beginners to create 3d games</a></p>
</section>
<section id="help-wanted">
<h1>Help wanted<a class="headerlink" href="#help-wanted" title="Permalink to this heading"></a></h1>
<h1>Help wanted<a class="headerlink" href="#help-wanted" title="Link to this heading"></a></h1>
<ul class="simple">
<li><p>Converting more examples from C to Python</p></li>
<li><p>Testing on more platforms</p></li>
</ul>
</section>
<section id="license-updated">
<h1>License (updated)<a class="headerlink" href="#license-updated" title="Permalink to this heading"></a></h1>
<h1>License (updated)<a class="headerlink" href="#license-updated" title="Link to this heading"></a></h1>
<p>The bindings are now under the Eclipse Public License, so you are free to
statically link and use in non-free / proprietary / commercial projects!</p>
</section>
<section id="performance">
<h1>Performance<a class="headerlink" href="#performance" title="Permalink to this heading"></a></h1>
<h1>Performance<a class="headerlink" href="#performance" title="Link to this heading"></a></h1>
<p>For fastest performance use Pypy rather than standard Python.</p>
<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
and then only convert them to C data structures when you have to call the C functions for drawing.</p>
<section id="bunnymark">
<h2>Bunnymark<a class="headerlink" href="#bunnymark" title="Permalink to this heading"></a></h2>
<h2>Bunnymark<a class="headerlink" href="#bunnymark" title="Link to this heading"></a></h2>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>Library</p></th>
@ -251,7 +253,7 @@ and then only convert them to C data structures when you have to call the C func
</section>
</section>
<section id="packaging-your-app">
<h1>Packaging your app<a class="headerlink" href="#packaging-your-app" title="Permalink to this heading"></a></h1>
<h1>Packaging your app<a class="headerlink" href="#packaging-your-app" title="Link to this heading"></a></h1>
<p>You can create a standalone binary using the Nuitka compiler. For example, here is how to package Bunnymark:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>pip3 install nuitka
cd examples/textures
@ -260,7 +262,7 @@ python3 -m nuitka --onefile --linux-onefile-icon resources/wabbit_alpha.png text
</div>
</section>
<section id="advert">
<h1>Advert<a class="headerlink" href="#advert" title="Permalink to this heading"></a></h1>
<h1>Advert<a class="headerlink" href="#advert" title="Link to this heading"></a></h1>
<p><a class="reference external" href="https://store.steampowered.com/app/664240/RetroWar_8bit_Party_Battle/?git">RetroWar: 8-bit Party Battle</a> is out now. Defeat up to 15 of your friends in a tournament of 80s-inspired retro mini games.</p>
<p><a class="reference external" href="https://github.com/electronstudio/pygame-zero-book">Coding Games With Pygame Zero &amp; Python</a> is
a book for Python beginners.</p>

View file

@ -1,22 +1,24 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<html class="writer-html5" lang="en" data-content_root="./">
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
<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>Raspberry Pi &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" />
<link rel="stylesheet" href="_static/graphviz.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=19f00094" />
<link rel="stylesheet" type="text/css" href="_static/graphviz.css?v=eafc0fe6" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script src="_static/jquery.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<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=888ff710"></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" />
@ -87,7 +89,7 @@
<div itemprop="articleBody">
<section id="raspberry-pi">
<h1>Raspberry Pi<a class="headerlink" href="#raspberry-pi" title="Permalink 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>We have published a binary wheel using Raylib in X11 mode. This <em>should</em> install and work on Bullseye
with</p>

View file

@ -237,6 +237,10 @@ a.headerlink {
visibility: hidden;
}
a:visited {
color: #551A8B;
}
h1:hover > a.headerlink,
h2:hover > a.headerlink,
h3:hover > a.headerlink,
@ -670,6 +674,16 @@ dd {
margin-left: 30px;
}
.sig dd {
margin-top: 0px;
margin-bottom: 0px;
}
.sig dl {
margin-top: 0px;
margin-bottom: 0px;
}
dl > dd:last-child,
dl > dd:last-child > :last-child {
margin-bottom: 0;
@ -738,6 +752,14 @@ abbr, acronym {
cursor: help;
}
.translated {
background-color: rgba(207, 255, 207, 0.2)
}
.untranslated {
background-color: rgba(255, 207, 207, 0.2)
}
/* -- code displays --------------------------------------------------------- */
pre {

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,4 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
const DOCUMENTATION_OPTIONS = {
VERSION: '',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,

View file

@ -17,6 +17,7 @@ span.linenos.special { color: #000000; background-color: #ffffc0; padding-left:
.highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #A00000 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #FF0000 } /* Generic.Error */
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #00A000 } /* Generic.Inserted */

View file

@ -57,12 +57,12 @@ const _removeChildren = (element) => {
const _escapeRegExp = (string) =>
string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
const _displayItem = (item, searchTerms) => {
const _displayItem = (item, searchTerms, highlightTerms) => {
const docBuilder = DOCUMENTATION_OPTIONS.BUILDER;
const docUrlRoot = DOCUMENTATION_OPTIONS.URL_ROOT;
const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX;
const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX;
const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY;
const contentRoot = document.documentElement.dataset.content_root;
const [docName, title, anchor, descr, score, _filename] = item;
@ -75,20 +75,24 @@ const _displayItem = (item, searchTerms) => {
if (dirname.match(/\/index\/$/))
dirname = dirname.substring(0, dirname.length - 6);
else if (dirname === "index/") dirname = "";
requestUrl = docUrlRoot + dirname;
requestUrl = contentRoot + dirname;
linkUrl = requestUrl;
} else {
// normal html builders
requestUrl = docUrlRoot + docName + docFileSuffix;
requestUrl = contentRoot + docName + docFileSuffix;
linkUrl = docName + docLinkSuffix;
}
let linkEl = listItem.appendChild(document.createElement("a"));
linkEl.href = linkUrl + anchor;
linkEl.dataset.score = score;
linkEl.innerHTML = title;
if (descr)
if (descr) {
listItem.appendChild(document.createElement("span")).innerHTML =
" (" + descr + ")";
// highlight search terms in the description
if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js
highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted"));
}
else if (showSearchSummary)
fetch(requestUrl)
.then((responseData) => responseData.text())
@ -97,6 +101,9 @@ const _displayItem = (item, searchTerms) => {
listItem.appendChild(
Search.makeSearchSummary(data, searchTerms)
);
// highlight search terms in the summary
if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js
highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted"));
});
Search.output.appendChild(listItem);
};
@ -115,14 +122,15 @@ const _finishSearch = (resultCount) => {
const _displayNextItem = (
results,
resultCount,
searchTerms
searchTerms,
highlightTerms,
) => {
// results left, load the summary and display it
// this is intended to be dynamic (don't sub resultsCount)
if (results.length) {
_displayItem(results.pop(), searchTerms);
_displayItem(results.pop(), searchTerms, highlightTerms);
setTimeout(
() => _displayNextItem(results, resultCount, searchTerms),
() => _displayNextItem(results, resultCount, searchTerms, highlightTerms),
5
);
}
@ -360,7 +368,7 @@ const Search = {
// console.info("search results:", Search.lastresults);
// print the results
_displayNextItem(results, results.length, searchTerms);
_displayNextItem(results, results.length, searchTerms, highlightTerms);
},
/**

View file

@ -29,14 +29,19 @@ const _highlight = (node, addItems, text, className) => {
}
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
const rest = document.createTextNode(val.substr(pos + text.length));
parent.insertBefore(
span,
parent.insertBefore(
document.createTextNode(val.substr(pos + text.length)),
rest,
node.nextSibling
)
);
node.nodeValue = val.substr(0, pos);
/* There may be more occurrences of search term in this node. So call this
* function recursively on the remaining fragment.
*/
_highlight(rest, addItems, text, className);
if (isInSVG) {
const rect = document.createElementNS(
@ -140,5 +145,10 @@ const SphinxHighlight = {
},
};
_ready(SphinxHighlight.highlightSearchWords);
_ready(SphinxHighlight.initEscapeListener);
_ready(() => {
/* Do not call highlightSearchWords() when we are on the search page.
* It will highlight words from the *previous* search query.
*/
if (typeof Search === "undefined") SphinxHighlight.highlightSearchWords();
SphinxHighlight.initEscapeListener();
});

View file

@ -1,22 +1,24 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<html class="writer-html5" lang="en" data-content_root="./">
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
<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 &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" />
<link rel="stylesheet" href="_static/graphviz.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=19f00094" />
<link rel="stylesheet" type="text/css" href="_static/graphviz.css?v=eafc0fe6" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script src="_static/jquery.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<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=888ff710"></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" />
@ -88,7 +90,7 @@
<div itemprop="articleBody">
<section id="dynamic-bindings">
<h1>Dynamic Bindings<a class="headerlink" href="#dynamic-bindings" title="Permalink to this heading"></a></h1>
<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>

File diff suppressed because it is too large Load diff

View file

@ -1,22 +1,24 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<html class="writer-html5" lang="en" data-content_root="./">
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
<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>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" />
<link rel="stylesheet" href="_static/graphviz.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=19f00094" />
<link rel="stylesheet" type="text/css" href="_static/graphviz.css?v=eafc0fe6" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script src="_static/jquery.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<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=888ff710"></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" />
@ -87,7 +89,7 @@
<div itemprop="articleBody">
<section id="raylib-python">
<h1>Raylib Python<a class="headerlink" href="#raylib-python" title="Permalink to this heading"></a></h1>
<h1>Raylib Python<a class="headerlink" href="#raylib-python" title="Link to this heading"></a></h1>
<div class="toctree-wrapper compound">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul>

Binary file not shown.

View file

@ -1,21 +1,23 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<html class="writer-html5" lang="en" data-content_root="./">
<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" />
<link rel="stylesheet" href="_static/graphviz.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=19f00094" />
<link rel="stylesheet" type="text/css" href="_static/graphviz.css?v=eafc0fe6" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script src="_static/jquery.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<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=888ff710"></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" />

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,22 +1,24 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<html class="writer-html5" lang="en" data-content_root="./">
<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" />
<link rel="stylesheet" href="_static/graphviz.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=19f00094" />
<link rel="stylesheet" type="text/css" href="_static/graphviz.css?v=eafc0fe6" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script src="_static/jquery.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<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=888ff710"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
<script src="_static/searchtools.js"></script>
<script src="_static/language_data.js"></script>

File diff suppressed because one or more lines are too long

View file

@ -1,9 +1,494 @@
import raylib
MOUSE_LEFT_BUTTON = raylib.MOUSE_BUTTON_LEFT
MOUSE_RIGHT_BUTTON = raylib.MOUSE_BUTTON_RIGHT
RAYLIB_VERSION_MAJOR: int = 5
RAYLIB_VERSION_MINOR: int = 0
RAYLIB_VERSION_PATCH: int = 0
RAYLIB_VERSION: str = "5.0"
PI: float = 3.141592653589793
DEG2RAD = PI / 180.0
RAD2DEG = 180.0 / PI
MOUSE_LEFT_BUTTON = raylib.MOUSE_BUTTON_LEFT
MOUSE_RIGHT_BUTTON = raylib.MOUSE_BUTTON_RIGHT
MOUSE_MIDDLE_BUTTON = raylib.MOUSE_BUTTON_MIDDLE
MATERIAL_MAP_DIFFUSE = raylib.MATERIAL_MAP_ALBEDO
MATERIAL_MAP_SPECULAR = raylib.MATERIAL_MAP_METALNESS
SHADER_LOC_MAP_DIFFUSE = raylib.SHADER_LOC_MAP_ALBEDO
SHADER_LOC_MAP_SPECULAR = raylib.SHADER_LOC_MAP_METALNESS
SHADER_LOC_MAP_DIFFUSE = raylib.SHADER_LOC_MAP_ALBEDO
SHADER_LOC_MAP_SPECULAR = raylib.SHADER_LOC_MAP_METALNESS
PI: float = 3.141592653589793
EPSILON: float = 1e-06
DEG2RAD = PI / 180.0
RAD2DEG = 180.0 / PI
RLGL_VERSION: str = "4.5"
RL_DEFAULT_BATCH_BUFFER_ELEMENTS: int = 8192
RL_DEFAULT_BATCH_BUFFERS: int = 1
RL_DEFAULT_BATCH_DRAWCALLS: int = 256
RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS: int = 4
RL_MAX_MATRIX_STACK_SIZE: int = 32
RL_MAX_SHADER_LOCATIONS: int = 32
RL_TEXTURE_WRAP_S: int = 10242
RL_TEXTURE_WRAP_T: int = 10243
RL_TEXTURE_MAG_FILTER: int = 10240
RL_TEXTURE_MIN_FILTER: int = 10241
RL_TEXTURE_FILTER_NEAREST: int = 9728
RL_TEXTURE_FILTER_LINEAR: int = 9729
RL_TEXTURE_FILTER_MIP_NEAREST: int = 9984
RL_TEXTURE_FILTER_NEAREST_MIP_LINEAR: int = 9986
RL_TEXTURE_FILTER_LINEAR_MIP_NEAREST: int = 9985
RL_TEXTURE_FILTER_MIP_LINEAR: int = 9987
RL_TEXTURE_FILTER_ANISOTROPIC: int = 12288
RL_TEXTURE_MIPMAP_BIAS_RATIO: int = 16384
RL_TEXTURE_WRAP_REPEAT: int = 10497
RL_TEXTURE_WRAP_CLAMP: int = 33071
RL_TEXTURE_WRAP_MIRROR_REPEAT: int = 33648
RL_TEXTURE_WRAP_MIRROR_CLAMP: int = 34626
RL_MODELVIEW: int = 5888
RL_PROJECTION: int = 5889
RL_TEXTURE: int = 5890
RL_LINES: int = 1
RL_TRIANGLES: int = 4
RL_QUADS: int = 7
RL_UNSIGNED_BYTE: int = 5121
RL_FLOAT: int = 5126
RL_STREAM_DRAW: int = 35040
RL_STREAM_READ: int = 35041
RL_STREAM_COPY: int = 35042
RL_STATIC_DRAW: int = 35044
RL_STATIC_READ: int = 35045
RL_STATIC_COPY: int = 35046
RL_DYNAMIC_DRAW: int = 35048
RL_DYNAMIC_READ: int = 35049
RL_DYNAMIC_COPY: int = 35050
RL_FRAGMENT_SHADER: int = 35632
RL_VERTEX_SHADER: int = 35633
RL_COMPUTE_SHADER: int = 37305
RL_ZERO: int = 0
RL_ONE: int = 1
RL_SRC_COLOR: int = 768
RL_ONE_MINUS_SRC_COLOR: int = 769
RL_SRC_ALPHA: int = 770
RL_ONE_MINUS_SRC_ALPHA: int = 771
RL_DST_ALPHA: int = 772
RL_ONE_MINUS_DST_ALPHA: int = 773
RL_DST_COLOR: int = 774
RL_ONE_MINUS_DST_COLOR: int = 775
RL_SRC_ALPHA_SATURATE: int = 776
RL_CONSTANT_COLOR: int = 32769
RL_ONE_MINUS_CONSTANT_COLOR: int = 32770
RL_CONSTANT_ALPHA: int = 32771
RL_ONE_MINUS_CONSTANT_ALPHA: int = 32772
RL_FUNC_ADD: int = 32774
RL_MIN: int = 32775
RL_MAX: int = 32776
RL_FUNC_SUBTRACT: int = 32778
RL_FUNC_REVERSE_SUBTRACT: int = 32779
RL_BLEND_EQUATION: int = 32777
RL_BLEND_EQUATION_RGB: int = 32777
RL_BLEND_EQUATION_ALPHA: int = 34877
RL_BLEND_DST_RGB: int = 32968
RL_BLEND_SRC_RGB: int = 32969
RL_BLEND_DST_ALPHA: int = 32970
RL_BLEND_SRC_ALPHA: int = 32971
RL_BLEND_COLOR: int = 32773
RL_SHADER_LOC_MAP_DIFFUSE = raylib.RL_SHADER_LOC_MAP_ALBEDO
RL_SHADER_LOC_MAP_SPECULAR = raylib.RL_SHADER_LOC_MAP_METALNESS
PI: float = 3.141592653589793
DEG2RAD = PI / 180.0
RAD2DEG = 180.0 / PI
GL_SHADING_LANGUAGE_VERSION: int = 35724
GL_COMPRESSED_RGB_S3TC_DXT1_EXT: int = 33776
GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: int = 33777
GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: int = 33778
GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: int = 33779
GL_ETC1_RGB8_OES: int = 36196
GL_COMPRESSED_RGB8_ETC2: int = 37492
GL_COMPRESSED_RGBA8_ETC2_EAC: int = 37496
GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG: int = 35840
GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG: int = 35842
GL_COMPRESSED_RGBA_ASTC_4x4_KHR: int = 37808
GL_COMPRESSED_RGBA_ASTC_8x8_KHR: int = 37815
GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT: int = 34047
GL_TEXTURE_MAX_ANISOTROPY_EXT: int = 34046
GL_UNSIGNED_SHORT_5_6_5: int = 33635
GL_UNSIGNED_SHORT_5_5_5_1: int = 32820
GL_UNSIGNED_SHORT_4_4_4_4: int = 32819
GL_LUMINANCE: int = 6409
GL_LUMINANCE_ALPHA: int = 6410
RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION: str = "vertexPosition"
RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD: str = "vertexTexCoord"
RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL: str = "vertexNormal"
RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR: str = "vertexColor"
RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT: str = "vertexTangent"
RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2: str = "vertexTexCoord2"
RL_DEFAULT_SHADER_UNIFORM_NAME_MVP: str = "mvp"
RL_DEFAULT_SHADER_UNIFORM_NAME_VIEW: str = "matView"
RL_DEFAULT_SHADER_UNIFORM_NAME_PROJECTION: str = "matProjection"
RL_DEFAULT_SHADER_UNIFORM_NAME_MODEL: str = "matModel"
RL_DEFAULT_SHADER_UNIFORM_NAME_NORMAL: str = "matNormal"
RL_DEFAULT_SHADER_UNIFORM_NAME_COLOR: str = "colDiffuse"
RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE0: str = "texture0"
RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE1: str = "texture1"
RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE2: str = "texture2"
RAYGUI_VERSION_MAJOR: int = 4
RAYGUI_VERSION_MINOR: int = 0
RAYGUI_VERSION_PATCH: int = 0
RAYGUI_VERSION: str = "4.0"
SCROLLBAR_LEFT_SIDE: int = 0
SCROLLBAR_RIGHT_SIDE: int = 1
RAYGUI_ICON_SIZE: int = 16
RAYGUI_ICON_MAX_ICONS: int = 256
RAYGUI_ICON_MAX_NAME_LENGTH: int = 32
RAYGUI_MAX_CONTROLS: int = 16
RAYGUI_MAX_PROPS_BASE: int = 16
RAYGUI_MAX_PROPS_EXTENDED: int = 8
KEY_RIGHT: int = 262
KEY_LEFT: int = 263
KEY_DOWN: int = 264
KEY_UP: int = 265
KEY_BACKSPACE: int = 259
KEY_ENTER: int = 257
MOUSE_LEFT_BUTTON: int = 0
RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT: int = 24
RAYGUI_GROUPBOX_LINE_THICK: int = 1
RAYGUI_LINE_MARGIN_TEXT: int = 12
RAYGUI_LINE_TEXT_PADDING: int = 4
RAYGUI_PANEL_BORDER_WIDTH: int = 1
RAYGUI_TABBAR_ITEM_WIDTH: int = 160
RAYGUI_MIN_SCROLLBAR_WIDTH: int = 40
RAYGUI_MIN_SCROLLBAR_HEIGHT: int = 40
RAYGUI_TOGGLEGROUP_MAX_ITEMS: int = 32
RAYGUI_TEXTBOX_AUTO_CURSOR_COOLDOWN: int = 40
RAYGUI_TEXTBOX_AUTO_CURSOR_DELAY: int = 1
RAYGUI_VALUEBOX_MAX_CHARS: int = 32
RAYGUI_COLORBARALPHA_CHECKED_SIZE: int = 10
RAYGUI_MESSAGEBOX_BUTTON_HEIGHT: int = 24
RAYGUI_MESSAGEBOX_BUTTON_PADDING: int = 12
RAYGUI_TEXTINPUTBOX_BUTTON_HEIGHT: int = 24
RAYGUI_TEXTINPUTBOX_BUTTON_PADDING: int = 12
RAYGUI_TEXTINPUTBOX_HEIGHT: int = 26
RAYGUI_GRID_ALPHA: float = 0.15
MAX_LINE_BUFFER_SIZE: int = 256
ICON_TEXT_PADDING: int = 4
RAYGUI_MAX_TEXT_LINES: int = 128
RAYGUI_TEXTSPLIT_MAX_ITEMS: int = 128
RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE: int = 1024
RAYGUI_TEXTFORMAT_MAX_SIZE: int = 256
PHYSAC_MAX_BODIES: int = 64
PHYSAC_MAX_MANIFOLDS: int = 4096
PHYSAC_MAX_VERTICES: int = 24
PHYSAC_DEFAULT_CIRCLE_VERTICES: int = 24
PHYSAC_COLLISION_ITERATIONS: int = 100
PHYSAC_PENETRATION_ALLOWANCE: float = 0.05
PHYSAC_PENETRATION_CORRECTION: float = 0.4
PHYSAC_PI: float = 3.141592653589793
PHYSAC_DEG2RAD = PHYSAC_PI / 180.0
PHYSAC_FLT_MAX: float = 3.402823466e+38
PHYSAC_EPSILON: float = 1e-06
GLFW_VERSION_MAJOR: int = 3
GLFW_VERSION_MINOR: int = 4
GLFW_VERSION_REVISION: int = 0
GLFW_TRUE: int = 1
GLFW_FALSE: int = 0
GLFW_RELEASE: int = 0
GLFW_PRESS: int = 1
GLFW_REPEAT: int = 2
GLFW_HAT_CENTERED: int = 0
GLFW_HAT_UP: int = 1
GLFW_HAT_RIGHT: int = 2
GLFW_HAT_DOWN: int = 4
GLFW_HAT_LEFT: int = 8
GLFW_HAT_RIGHT_UP = GLFW_HAT_RIGHT | GLFW_HAT_UP
GLFW_HAT_RIGHT_DOWN = GLFW_HAT_RIGHT | GLFW_HAT_DOWN
GLFW_HAT_LEFT_UP = GLFW_HAT_LEFT | GLFW_HAT_UP
GLFW_HAT_LEFT_DOWN = GLFW_HAT_LEFT | GLFW_HAT_DOWN
GLFW_KEY_SPACE: int = 32
GLFW_KEY_APOSTROPHE: int = 39
GLFW_KEY_COMMA: int = 44
GLFW_KEY_MINUS: int = 45
GLFW_KEY_PERIOD: int = 46
GLFW_KEY_SLASH: int = 47
GLFW_KEY_0: int = 48
GLFW_KEY_1: int = 49
GLFW_KEY_2: int = 50
GLFW_KEY_3: int = 51
GLFW_KEY_4: int = 52
GLFW_KEY_5: int = 53
GLFW_KEY_6: int = 54
GLFW_KEY_7: int = 55
GLFW_KEY_8: int = 56
GLFW_KEY_9: int = 57
GLFW_KEY_SEMICOLON: int = 59
GLFW_KEY_EQUAL: int = 61
GLFW_KEY_A: int = 65
GLFW_KEY_B: int = 66
GLFW_KEY_C: int = 67
GLFW_KEY_D: int = 68
GLFW_KEY_E: int = 69
GLFW_KEY_F: int = 70
GLFW_KEY_G: int = 71
GLFW_KEY_H: int = 72
GLFW_KEY_I: int = 73
GLFW_KEY_J: int = 74
GLFW_KEY_K: int = 75
GLFW_KEY_L: int = 76
GLFW_KEY_M: int = 77
GLFW_KEY_N: int = 78
GLFW_KEY_O: int = 79
GLFW_KEY_P: int = 80
GLFW_KEY_Q: int = 81
GLFW_KEY_R: int = 82
GLFW_KEY_S: int = 83
GLFW_KEY_T: int = 84
GLFW_KEY_U: int = 85
GLFW_KEY_V: int = 86
GLFW_KEY_W: int = 87
GLFW_KEY_X: int = 88
GLFW_KEY_Y: int = 89
GLFW_KEY_Z: int = 90
GLFW_KEY_LEFT_BRACKET: int = 91
GLFW_KEY_BACKSLASH: int = 92
GLFW_KEY_RIGHT_BRACKET: int = 93
GLFW_KEY_GRAVE_ACCENT: int = 96
GLFW_KEY_WORLD_1: int = 161
GLFW_KEY_WORLD_2: int = 162
GLFW_KEY_ESCAPE: int = 256
GLFW_KEY_ENTER: int = 257
GLFW_KEY_TAB: int = 258
GLFW_KEY_BACKSPACE: int = 259
GLFW_KEY_INSERT: int = 260
GLFW_KEY_DELETE: int = 261
GLFW_KEY_RIGHT: int = 262
GLFW_KEY_LEFT: int = 263
GLFW_KEY_DOWN: int = 264
GLFW_KEY_UP: int = 265
GLFW_KEY_PAGE_UP: int = 266
GLFW_KEY_PAGE_DOWN: int = 267
GLFW_KEY_HOME: int = 268
GLFW_KEY_END: int = 269
GLFW_KEY_CAPS_LOCK: int = 280
GLFW_KEY_SCROLL_LOCK: int = 281
GLFW_KEY_NUM_LOCK: int = 282
GLFW_KEY_PRINT_SCREEN: int = 283
GLFW_KEY_PAUSE: int = 284
GLFW_KEY_F1: int = 290
GLFW_KEY_F2: int = 291
GLFW_KEY_F3: int = 292
GLFW_KEY_F4: int = 293
GLFW_KEY_F5: int = 294
GLFW_KEY_F6: int = 295
GLFW_KEY_F7: int = 296
GLFW_KEY_F8: int = 297
GLFW_KEY_F9: int = 298
GLFW_KEY_F10: int = 299
GLFW_KEY_F11: int = 300
GLFW_KEY_F12: int = 301
GLFW_KEY_F13: int = 302
GLFW_KEY_F14: int = 303
GLFW_KEY_F15: int = 304
GLFW_KEY_F16: int = 305
GLFW_KEY_F17: int = 306
GLFW_KEY_F18: int = 307
GLFW_KEY_F19: int = 308
GLFW_KEY_F20: int = 309
GLFW_KEY_F21: int = 310
GLFW_KEY_F22: int = 311
GLFW_KEY_F23: int = 312
GLFW_KEY_F24: int = 313
GLFW_KEY_F25: int = 314
GLFW_KEY_KP_0: int = 320
GLFW_KEY_KP_1: int = 321
GLFW_KEY_KP_2: int = 322
GLFW_KEY_KP_3: int = 323
GLFW_KEY_KP_4: int = 324
GLFW_KEY_KP_5: int = 325
GLFW_KEY_KP_6: int = 326
GLFW_KEY_KP_7: int = 327
GLFW_KEY_KP_8: int = 328
GLFW_KEY_KP_9: int = 329
GLFW_KEY_KP_DECIMAL: int = 330
GLFW_KEY_KP_DIVIDE: int = 331
GLFW_KEY_KP_MULTIPLY: int = 332
GLFW_KEY_KP_SUBTRACT: int = 333
GLFW_KEY_KP_ADD: int = 334
GLFW_KEY_KP_ENTER: int = 335
GLFW_KEY_KP_EQUAL: int = 336
GLFW_KEY_LEFT_SHIFT: int = 340
GLFW_KEY_LEFT_CONTROL: int = 341
GLFW_KEY_LEFT_ALT: int = 342
GLFW_KEY_LEFT_SUPER: int = 343
GLFW_KEY_RIGHT_SHIFT: int = 344
GLFW_KEY_RIGHT_CONTROL: int = 345
GLFW_KEY_RIGHT_ALT: int = 346
GLFW_KEY_RIGHT_SUPER: int = 347
GLFW_KEY_MENU: int = 348
GLFW_MOD_SHIFT: int = 1
GLFW_MOD_CONTROL: int = 2
GLFW_MOD_ALT: int = 4
GLFW_MOD_SUPER: int = 8
GLFW_MOD_CAPS_LOCK: int = 16
GLFW_MOD_NUM_LOCK: int = 32
GLFW_MOUSE_BUTTON_1: int = 0
GLFW_MOUSE_BUTTON_2: int = 1
GLFW_MOUSE_BUTTON_3: int = 2
GLFW_MOUSE_BUTTON_4: int = 3
GLFW_MOUSE_BUTTON_5: int = 4
GLFW_MOUSE_BUTTON_6: int = 5
GLFW_MOUSE_BUTTON_7: int = 6
GLFW_MOUSE_BUTTON_8: int = 7
GLFW_JOYSTICK_1: int = 0
GLFW_JOYSTICK_2: int = 1
GLFW_JOYSTICK_3: int = 2
GLFW_JOYSTICK_4: int = 3
GLFW_JOYSTICK_5: int = 4
GLFW_JOYSTICK_6: int = 5
GLFW_JOYSTICK_7: int = 6
GLFW_JOYSTICK_8: int = 7
GLFW_JOYSTICK_9: int = 8
GLFW_JOYSTICK_10: int = 9
GLFW_JOYSTICK_11: int = 10
GLFW_JOYSTICK_12: int = 11
GLFW_JOYSTICK_13: int = 12
GLFW_JOYSTICK_14: int = 13
GLFW_JOYSTICK_15: int = 14
GLFW_JOYSTICK_16: int = 15
GLFW_GAMEPAD_BUTTON_A: int = 0
GLFW_GAMEPAD_BUTTON_B: int = 1
GLFW_GAMEPAD_BUTTON_X: int = 2
GLFW_GAMEPAD_BUTTON_Y: int = 3
GLFW_GAMEPAD_BUTTON_LEFT_BUMPER: int = 4
GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER: int = 5
GLFW_GAMEPAD_BUTTON_BACK: int = 6
GLFW_GAMEPAD_BUTTON_START: int = 7
GLFW_GAMEPAD_BUTTON_GUIDE: int = 8
GLFW_GAMEPAD_BUTTON_LEFT_THUMB: int = 9
GLFW_GAMEPAD_BUTTON_RIGHT_THUMB: int = 10
GLFW_GAMEPAD_BUTTON_DPAD_UP: int = 11
GLFW_GAMEPAD_BUTTON_DPAD_RIGHT: int = 12
GLFW_GAMEPAD_BUTTON_DPAD_DOWN: int = 13
GLFW_GAMEPAD_BUTTON_DPAD_LEFT: int = 14
GLFW_GAMEPAD_AXIS_LEFT_X: int = 0
GLFW_GAMEPAD_AXIS_LEFT_Y: int = 1
GLFW_GAMEPAD_AXIS_RIGHT_X: int = 2
GLFW_GAMEPAD_AXIS_RIGHT_Y: int = 3
GLFW_GAMEPAD_AXIS_LEFT_TRIGGER: int = 4
GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER: int = 5
GLFW_NO_ERROR: int = 0
GLFW_NOT_INITIALIZED: int = 65537
GLFW_NO_CURRENT_CONTEXT: int = 65538
GLFW_INVALID_ENUM: int = 65539
GLFW_INVALID_VALUE: int = 65540
GLFW_OUT_OF_MEMORY: int = 65541
GLFW_API_UNAVAILABLE: int = 65542
GLFW_VERSION_UNAVAILABLE: int = 65543
GLFW_PLATFORM_ERROR: int = 65544
GLFW_FORMAT_UNAVAILABLE: int = 65545
GLFW_NO_WINDOW_CONTEXT: int = 65546
GLFW_CURSOR_UNAVAILABLE: int = 65547
GLFW_FEATURE_UNAVAILABLE: int = 65548
GLFW_FEATURE_UNIMPLEMENTED: int = 65549
GLFW_PLATFORM_UNAVAILABLE: int = 65550
GLFW_FOCUSED: int = 131073
GLFW_ICONIFIED: int = 131074
GLFW_RESIZABLE: int = 131075
GLFW_VISIBLE: int = 131076
GLFW_DECORATED: int = 131077
GLFW_AUTO_ICONIFY: int = 131078
GLFW_FLOATING: int = 131079
GLFW_MAXIMIZED: int = 131080
GLFW_CENTER_CURSOR: int = 131081
GLFW_TRANSPARENT_FRAMEBUFFER: int = 131082
GLFW_HOVERED: int = 131083
GLFW_FOCUS_ON_SHOW: int = 131084
GLFW_MOUSE_PASSTHROUGH: int = 131085
GLFW_POSITION_X: int = 131086
GLFW_POSITION_Y: int = 131087
GLFW_RED_BITS: int = 135169
GLFW_GREEN_BITS: int = 135170
GLFW_BLUE_BITS: int = 135171
GLFW_ALPHA_BITS: int = 135172
GLFW_DEPTH_BITS: int = 135173
GLFW_STENCIL_BITS: int = 135174
GLFW_ACCUM_RED_BITS: int = 135175
GLFW_ACCUM_GREEN_BITS: int = 135176
GLFW_ACCUM_BLUE_BITS: int = 135177
GLFW_ACCUM_ALPHA_BITS: int = 135178
GLFW_AUX_BUFFERS: int = 135179
GLFW_STEREO: int = 135180
GLFW_SAMPLES: int = 135181
GLFW_SRGB_CAPABLE: int = 135182
GLFW_REFRESH_RATE: int = 135183
GLFW_DOUBLEBUFFER: int = 135184
GLFW_CLIENT_API: int = 139265
GLFW_CONTEXT_VERSION_MAJOR: int = 139266
GLFW_CONTEXT_VERSION_MINOR: int = 139267
GLFW_CONTEXT_REVISION: int = 139268
GLFW_CONTEXT_ROBUSTNESS: int = 139269
GLFW_OPENGL_FORWARD_COMPAT: int = 139270
GLFW_CONTEXT_DEBUG: int = 139271
GLFW_OPENGL_PROFILE: int = 139272
GLFW_CONTEXT_RELEASE_BEHAVIOR: int = 139273
GLFW_CONTEXT_NO_ERROR: int = 139274
GLFW_CONTEXT_CREATION_API: int = 139275
GLFW_SCALE_TO_MONITOR: int = 139276
GLFW_COCOA_RETINA_FRAMEBUFFER: int = 143361
GLFW_COCOA_FRAME_NAME: int = 143362
GLFW_COCOA_GRAPHICS_SWITCHING: int = 143363
GLFW_X11_CLASS_NAME: int = 147457
GLFW_X11_INSTANCE_NAME: int = 147458
GLFW_WIN32_KEYBOARD_MENU: int = 151553
GLFW_WAYLAND_APP_ID: int = 155649
GLFW_NO_API: int = 0
GLFW_OPENGL_API: int = 196609
GLFW_OPENGL_ES_API: int = 196610
GLFW_NO_ROBUSTNESS: int = 0
GLFW_NO_RESET_NOTIFICATION: int = 200705
GLFW_LOSE_CONTEXT_ON_RESET: int = 200706
GLFW_OPENGL_ANY_PROFILE: int = 0
GLFW_OPENGL_CORE_PROFILE: int = 204801
GLFW_OPENGL_COMPAT_PROFILE: int = 204802
GLFW_CURSOR: int = 208897
GLFW_STICKY_KEYS: int = 208898
GLFW_STICKY_MOUSE_BUTTONS: int = 208899
GLFW_LOCK_KEY_MODS: int = 208900
GLFW_RAW_MOUSE_MOTION: int = 208901
GLFW_CURSOR_NORMAL: int = 212993
GLFW_CURSOR_HIDDEN: int = 212994
GLFW_CURSOR_DISABLED: int = 212995
GLFW_CURSOR_CAPTURED: int = 212996
GLFW_ANY_RELEASE_BEHAVIOR: int = 0
GLFW_RELEASE_BEHAVIOR_FLUSH: int = 217089
GLFW_RELEASE_BEHAVIOR_NONE: int = 217090
GLFW_NATIVE_CONTEXT_API: int = 221185
GLFW_EGL_CONTEXT_API: int = 221186
GLFW_OSMESA_CONTEXT_API: int = 221187
GLFW_ANGLE_PLATFORM_TYPE_NONE: int = 225281
GLFW_ANGLE_PLATFORM_TYPE_OPENGL: int = 225282
GLFW_ANGLE_PLATFORM_TYPE_OPENGLES: int = 225283
GLFW_ANGLE_PLATFORM_TYPE_D3D9: int = 225284
GLFW_ANGLE_PLATFORM_TYPE_D3D11: int = 225285
GLFW_ANGLE_PLATFORM_TYPE_VULKAN: int = 225287
GLFW_ANGLE_PLATFORM_TYPE_METAL: int = 225288
GLFW_ANY_POSITION: int = 2147483648
GLFW_ARROW_CURSOR: int = 221185
GLFW_IBEAM_CURSOR: int = 221186
GLFW_CROSSHAIR_CURSOR: int = 221187
GLFW_POINTING_HAND_CURSOR: int = 221188
GLFW_RESIZE_EW_CURSOR: int = 221189
GLFW_RESIZE_NS_CURSOR: int = 221190
GLFW_RESIZE_NWSE_CURSOR: int = 221191
GLFW_RESIZE_NESW_CURSOR: int = 221192
GLFW_RESIZE_ALL_CURSOR: int = 221193
GLFW_NOT_ALLOWED_CURSOR: int = 221194
GLFW_CONNECTED: int = 262145
GLFW_DISCONNECTED: int = 262146
GLFW_JOYSTICK_HAT_BUTTONS: int = 327681
GLFW_ANGLE_PLATFORM_TYPE: int = 327682
GLFW_PLATFORM: int = 327683
GLFW_COCOA_CHDIR_RESOURCES: int = 331777
GLFW_COCOA_MENUBAR: int = 331778
GLFW_X11_XCB_VULKAN_SURFACE: int = 335873
GLFW_ANY_PLATFORM: int = 393216
GLFW_PLATFORM_WIN32: int = 393217
GLFW_PLATFORM_COCOA: int = 393218
GLFW_PLATFORM_WAYLAND: int = 393219
GLFW_PLATFORM_X11: int = 393220
GLFW_PLATFORM_NULL: int = 393221

View file

@ -14,6 +14,7 @@ class ConfigFlags(IntEnum):
FLAG_WINDOW_TRANSPARENT = 16
FLAG_WINDOW_HIGHDPI = 8192
FLAG_WINDOW_MOUSE_PASSTHROUGH = 16384
FLAG_BORDERLESS_WINDOWED_MODE = 32768
FLAG_MSAA_4X_HINT = 32
FLAG_INTERLACED_HINT = 65536
@ -258,17 +259,20 @@ class PixelFormat(IntEnum):
PIXELFORMAT_UNCOMPRESSED_R32 = 8
PIXELFORMAT_UNCOMPRESSED_R32G32B32 = 9
PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 = 10
PIXELFORMAT_COMPRESSED_DXT1_RGB = 11
PIXELFORMAT_COMPRESSED_DXT1_RGBA = 12
PIXELFORMAT_COMPRESSED_DXT3_RGBA = 13
PIXELFORMAT_COMPRESSED_DXT5_RGBA = 14
PIXELFORMAT_COMPRESSED_ETC1_RGB = 15
PIXELFORMAT_COMPRESSED_ETC2_RGB = 16
PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 17
PIXELFORMAT_COMPRESSED_PVRT_RGB = 18
PIXELFORMAT_COMPRESSED_PVRT_RGBA = 19
PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 20
PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 21
PIXELFORMAT_UNCOMPRESSED_R16 = 11
PIXELFORMAT_UNCOMPRESSED_R16G16B16 = 12
PIXELFORMAT_UNCOMPRESSED_R16G16B16A16 = 13
PIXELFORMAT_COMPRESSED_DXT1_RGB = 14
PIXELFORMAT_COMPRESSED_DXT1_RGBA = 15
PIXELFORMAT_COMPRESSED_DXT3_RGBA = 16
PIXELFORMAT_COMPRESSED_DXT5_RGBA = 17
PIXELFORMAT_COMPRESSED_ETC1_RGB = 18
PIXELFORMAT_COMPRESSED_ETC2_RGB = 19
PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 20
PIXELFORMAT_COMPRESSED_PVRT_RGB = 21
PIXELFORMAT_COMPRESSED_PVRT_RGBA = 22
PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 23
PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 24
class TextureFilter(IntEnum):
TEXTURE_FILTER_POINT = 0
@ -347,6 +351,16 @@ class GuiTextAlignment(IntEnum):
TEXT_ALIGN_CENTER = 1
TEXT_ALIGN_RIGHT = 2
class GuiTextAlignmentVertical(IntEnum):
TEXT_ALIGN_TOP = 0
TEXT_ALIGN_MIDDLE = 1
TEXT_ALIGN_BOTTOM = 2
class GuiTextWrapMode(IntEnum):
TEXT_WRAP_NONE = 0
TEXT_WRAP_CHAR = 1
TEXT_WRAP_WORD = 2
class GuiControl(IntEnum):
DEFAULT = 0
LABEL = 1
@ -381,13 +395,15 @@ class GuiControlProperty(IntEnum):
BORDER_WIDTH = 12
TEXT_PADDING = 13
TEXT_ALIGNMENT = 14
RESERVED = 15
class GuiDefaultProperty(IntEnum):
TEXT_SIZE = 16
TEXT_SPACING = 17
LINE_COLOR = 18
BACKGROUND_COLOR = 19
TEXT_LINE_SPACING = 20
TEXT_ALIGNMENT_VERTICAL = 21
TEXT_WRAP_MODE = 22
class GuiToggleProperty(IntEnum):
GROUP_PADDING = 16
@ -419,11 +435,7 @@ class GuiDropdownBoxProperty(IntEnum):
DROPDOWN_ITEMS_SPACING = 17
class GuiTextBoxProperty(IntEnum):
TEXT_INNER_PADDING = 16
TEXT_LINES_SPACING = 17
TEXT_ALIGNMENT_VERTICAL = 18
TEXT_MULTILINE = 19
TEXT_WRAP_MODE = 20
TEXT_READONLY = 16
class GuiSpinnerProperty(IntEnum):
SPIN_BUTTON_WIDTH = 16
@ -662,7 +674,7 @@ class GuiIconName(IntEnum):
ICON_REG_EXP = 216
ICON_FOLDER = 217
ICON_FILE = 218
ICON_219 = 219
ICON_SAND_TIMER = 219
ICON_220 = 220
ICON_221 = 221
ICON_222 = 222

View file

@ -0,0 +1,172 @@
"""
raylib [audio] example - playing
"""
import dataclasses
import pyray
import raylib as rl
from raylib.colors import (
RAYWHITE,
ORANGE,
RED,
GOLD,
LIME,
BLUE,
VIOLET,
BROWN,
LIGHTGRAY,
PINK,
YELLOW,
GREEN,
SKYBLUE,
PURPLE,
BEIGE,
MAROON,
GRAY,
BLACK
)
MAX_CIRCLES=64
@dataclasses.dataclass
class CircleWave:
position: 'rl.Vector2'
radius: float
alpha: float
speed: float
color: 'rl.Color'
screenWidth = 800
screenHeight = 450
rl.SetConfigFlags(rl.FLAG_MSAA_4X_HINT) # NOTE: Try to enable MSAA 4X
rl.InitWindow(screenWidth, screenHeight, b"raylib [audio] example - module playing (streaming)")
rl.InitAudioDevice() # Initialize audio device
colors = [ ORANGE, RED, GOLD, LIME, BLUE, VIOLET, BROWN, LIGHTGRAY, PINK,
YELLOW, GREEN, SKYBLUE, PURPLE, BEIGE ]
# Creates some circles for visual effect
circles = []
for i in range(MAX_CIRCLES):
rad = rl.GetRandomValue(10, 40)
pos = pyray.Vector2(
float(rl.GetRandomValue(rad, int(screenWidth) - rad)),
float(rl.GetRandomValue(rad, int(screenHeight) - rad))
)
c = CircleWave(
alpha=0.0,
radius=float(rad),
position=pos,
speed=float(rl.GetRandomValue(1, 100))/2000.0,
color=colors[rl.GetRandomValue(0, 13)]
)
circles.append(c)
music = rl.LoadMusicStream(b"resources/mini1111.xm")
music.looping = False
pitch = 1.0
rl.PlayMusicStream(music)
timePlayed = 0.0
pause = False
rl.SetTargetFPS(60) # Set our game to run at 60 frames-per-second
# Main game loop
while not rl.WindowShouldClose(): # Detect window close button or ESC key
# Update
#----------------------------------------------------------------------------------
rl.UpdateMusicStream(music) # Update music buffer with new stream data
# Restart music playing (stop and play)
if rl.IsKeyPressed(rl.KEY_SPACE):
rl.StopMusicStream(music)
rl.PlayMusicStream(music)
pause = False
# Pause/Resume music playing
if rl.IsKeyPressed(rl.KEY_P):
pause = not pause
if pause:
rl.PauseMusicStream(music)
else:
rl.ResumeMusicStream(music)
if rl.IsKeyDown(rl.KEY_DOWN):
pitch -= 0.01
elif rl.IsKeyDown(rl.KEY_UP):
pitch += 0.01
rl.SetMusicPitch(music, pitch)
# Get timePlayed scaled to bar dimensions
timePlayed = (rl.GetMusicTimePlayed(music) / rl.GetMusicTimeLength(music))*(screenWidth - 40)
# Color circles animation
for i in range(MAX_CIRCLES):
if pause:
break
circles[i].alpha += circles[i].speed
circles[i].radius += circles[i].speed*10.0
if circles[i].alpha > 1.0:
circles[i].speed *= -1
if circles[i].alpha <= 0.0:
circles[i].alpha = 0.0
rad = rl.GetRandomValue(10, 40)
pos = pyray.Vector2(
float(rl.GetRandomValue(rad, int(screenWidth) - rad)),
float(rl.GetRandomValue(rad, int(screenHeight) - rad))
)
circles[i].position = pos
circles[i].radius = float(rad)
circles[i].speed = float(rl.GetRandomValue(1, 100)) / 2000.0
circles[i].color = colors[rl.GetRandomValue(0, 13)]
#----------------------------------------------------------------------------------
# Draw
#----------------------------------------------------------------------------------
pyray.begin_drawing()
pyray.clear_background(RAYWHITE)
for i in range(MAX_CIRCLES):
pyray.draw_circle_v(circles[i].position, circles[i].radius, rl.Fade(circles[i].color, circles[i].alpha))
# Draw time bar
pyray.draw_rectangle(20, screenHeight - 20 - 12, screenWidth - 40, 12, LIGHTGRAY)
pyray.draw_rectangle(20, screenHeight - 20 - 12, int(timePlayed), 12, MAROON)
pyray.draw_rectangle_lines(20, screenHeight - 20 - 12, screenWidth - 40, 12, GRAY)
# Draw help instructions
pyray.draw_rectangle(20, 20, 425, 145, RAYWHITE)
pyray.draw_rectangle_lines(20, 20, 425, 145, GRAY)
pyray.draw_text("PRESS SPACE TO RESTART MUSIC", 40, 40, 20, BLACK)
pyray.draw_text("PRESS P TO PAUSE/RESUME", 40, 70, 20, BLACK)
pyray.draw_text("PRESS UP/DOWN TO CHANGE SPEED", 40, 100, 20, BLACK)
pyray.draw_text(f"SPEED: {pitch}", 40, 130, 20, MAROON)
pyray.end_drawing()
#----------------------------------------------------------------------------------
# De-Initialization
#--------------------------------------------------------------------------------------
rl.UnloadMusicStream(music) # Unload music stream buffers from RAM
rl.CloseAudioDevice() # Close audio device (music streaming is automatically stopped)
rl.CloseWindow() # Close window and OpenGL context

Binary file not shown.

View file

@ -1,6 +1,6 @@
"""
raylib [core] example - 2d camera
raylib [core] example - 2D Camera System
"""
import pyray

View file

@ -1,6 +1,6 @@
"""
raylib [core] example - 2d camera platformer
raylib [core] example - 2D Camera platformer
"""
from math import sqrt

View file

@ -27,7 +27,7 @@ while not window_should_close(): # Detect window close button or ESC key
# Update
update_camera(camera, pyray.CAMERA_FREE)
if is_key_down(pyray.KEY_Z):
if is_key_pressed(pyray.KEY_Z):
camera.target = Vector3(0.0, 0.0, 0.0)
# Draw
@ -44,8 +44,8 @@ while not window_should_close(): # Detect window close button or ESC key
end_mode_3d()
draw_rectangle(10, 10, 320, 133, Fade(SKYBLUE, 0.5))
draw_rectangle_lines(10, 10, 320, 133, BLUE)
draw_rectangle(10, 10, 320, 93, Fade(SKYBLUE, 0.5))
draw_rectangle_lines(10, 10, 320, 93, BLUE)
draw_text("Free camera default controls:", 20, 20, 10, BLACK)
draw_text("- Mouse Wheel to Zoom in-out", 40, 40, 10, DARKGRAY)

View file

@ -0,0 +1,446 @@
#*******************************************************************************************
#
# raylib [rlgl] example - Using rlgl module as standalone module
#
# rlgl library is an abstraction layer for multiple OpenGL versions (1.1, 2.1, 3.3 Core, ES 2.0)
# that provides a pseudo-OpenGL 1.1 immediate-mode style API (rlVertex, rlTranslate, rlRotate...)
#
# WARNING: This example is intended only for PLATFORM_DESKTOP and OpenGL 3.3 Core profile.
# It could work on other platforms if redesigned for those platforms (out-of-scope)
#
# DEPENDENCIES:
# glfw3 - Windows and context initialization library
# rlgl.h - OpenGL abstraction layer to OpenGL 1.1, 3.3 or ES2
# glad.h - OpenGL extensions initialization library (required by rlgl)
# raymath.h - 3D math library
#
# WINDOWS COMPILATION:
# gcc -o rlgl_standalone.exe rlgl_standalone.c -s -Iexternal\include -I..\..\src \
# -L. -Lexternal\lib -lglfw3 -lopengl32 -lgdi32 -Wall -std=c99 -DGRAPHICS_API_OPENGL_33
#
# APPLE COMPILATION:
# gcc -o rlgl_standalone rlgl_standalone.c -I../../src -Iexternal/include -Lexternal/lib \
# -lglfw3 -framework CoreVideo -framework OpenGL -framework IOKit -framework Cocoa
# -Wno-deprecated-declarations -std=c99 -DGRAPHICS_API_OPENGL_33
#
#
# LICENSE: zlib/libpng
#
# This example is licensed under an unmodified zlib/libpng license, which is an OSI-certified,
# BSD-like license that allows static linking with closed source software:
#
# Copyright (c) 2014-2023 Ramon Santamaria (@raysan5)
#
# This software is provided "as-is", without any express or implied warranty. In no event
# will the authors be held liable for any damages arising from the use of this software.
#
# Permission is granted to anyone to use this software for any purpose, including commercial
# applications, and to alter it and redistribute it freely, subject to the following restrictions:
#
# 1. The origin of this software must not be misrepresented you must not claim that you
# wrote the original software. If you use this software in a product, an acknowledgment
# in the product documentation would be appreciated but is not required.
#
# 2. Altered source versions must be plainly marked as such, and must not be misrepresented
# as being the original software.
#
# 3. This notice may not be removed or altered from any source distribution.
#
#*******************************************************************************************/
# NOTE: rlgl can be configured just re-defining the following values:
# define RL_DEFAULT_BATCH_BUFFER_ELEMENTS 8192 # Default internal render batch elements limits
# define RL_DEFAULT_BATCH_BUFFERS 1 # Default number of batch buffers (multi-buffering)
# define RL_DEFAULT_BATCH_DRAWCALLS 256 # Default number of batch draw calls (by state changes: mode, texture)
# define RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS 4 # Maximum number of textures units that can be activated on batch drawing (SetShaderValueTexture())
# define RL_MAX_MATRIX_STACK_SIZE 32 # Maximum size of internal Matrix stack
# define RL_MAX_SHADER_LOCATIONS 32 # Maximum number of shader locations supported
# define RL_CULL_DISTANCE_NEAR 0.01 # Default projection matrix near cull distance
# define RL_CULL_DISTANCE_FAR 1000.0 # Default projection matrix far cull distance
import sys
import dataclasses
import pyray
from raylib import ffi, rl
from raylib.defines import (
GLFW_TRUE,
GLFW_SAMPLES, GLFW_DEPTH_BITS, GLFW_CONTEXT_VERSION_MAJOR, GLFW_CONTEXT_VERSION_MINOR, GLFW_OPENGL_PROFILE,
GLFW_OPENGL_CORE_PROFILE, GLFW_OPENGL_FORWARD_COMPAT, RL_PROJECTION, RL_MODELVIEW, DEG2RAD, RL_LINES, RL_TRIANGLES,
GLFW_KEY_ESCAPE, GLFW_PRESS,
)
from raylib.colors import (
RAYWHITE,
RED,
DARKGRAY
)
#----------------------------------------------------------------------------------
# Structures Definition
#----------------------------------------------------------------------------------
# Color, 4 components, R8G8B8A8 (32bit)
@dataclasses.dataclass
class Color:
r: int
g: int
b: int
a: int
# Camera type, defines a camera position/orientation in 3d space
@dataclasses.dataclass
class Camera:
position: pyray.Vector3 # Camera position
target: pyray.Vector3 # Camera target it looks-at
up: pyray.Vector3 # Camera up vector (rotation over its axis)
fovy: float # Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic
projection: int # Camera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC
#----------------------------------------------------------------------------------
# Module specific Functions Declaration
#----------------------------------------------------------------------------------
# static void ErrorCallback(int error, const char *description)
# static void KeyCallback(GLFWwindow *window, int key, int scancode, int action, int mods)
# Drawing functions (uses rlgl functionality)
# static void DrawGrid(int slices, float spacing)
# static void DrawCube(Vector3 position, float width, float height, float length, Color color)
# static void DrawCubeWires(Vector3 position, float width, float height, float length, Color color)
# static void DrawRectangleV(Vector2 position, Vector2 size, Color color)
# NOTE: We use raymath to get this functionality but it could be implemented in this module
#static Matrix MatrixIdentity(void)
#static Matrix MatrixOrtho(double left, double right, double bottom, double top, double near, double far)
#static Matrix MatrixPerspective(double fovy, double aspect, double near, double far)
#static Matrix MatrixLookAt(Vector3 eye, Vector3 target, Vector3 up)
# GLFW3: Error callback
@ffi.callback("void(int, const char *)")
def ErrorCallback(error: int, description: bytes):
print("%s" % description, file=sys.stderr)
# GLFW3: Keyboard callback
@ffi.callback("void(GLFWwindow *, int, int, int, int)")
def KeyCallback(window: 'GLFWwindow', key: int, scancode: int, action: int, mods: int):
if key == GLFW_KEY_ESCAPE and action == GLFW_PRESS:
rl.glfwSetWindowShouldClose(window, GLFW_TRUE)
# Draw rectangle using rlgl OpenGL 1.1 style coding (translated to OpenGL 3.3 internally)
def DrawRectangleV(position: 'raylib.Vector2', size: 'raylib.Vector2', color: Color):
rl.rlBegin(RL_TRIANGLES)
rl.rlColor4ub(color.r, color.g, color.b, color.a)
rl.rlVertex2f(position.x, position.y)
rl.rlVertex2f(position.x, position.y + size.y)
rl.rlVertex2f(position.x + size.x, position.y + size.y)
rl.rlVertex2f(position.x, position.y)
rl.rlVertex2f(position.x + size.x, position.y + size.y)
rl.rlVertex2f(position.x + size.x, position.y)
rl.rlEnd()
# Draw a grid centered at (0, 0, 0)
def DrawGrid(slices: int, spacing: float):
half_slices = slices // 2
rl.rlBegin(RL_LINES)
for i in range(half_slices * -1, half_slices+1):
if i == 0:
rl.rlColor3f(0.5, 0.5, 0.5)
rl.rlColor3f(0.5, 0.5, 0.5)
rl.rlColor3f(0.5, 0.5, 0.5)
rl.rlColor3f(0.5, 0.5, 0.5)
else:
rl.rlColor3f(0.75, 0.75, 0.75)
rl.rlColor3f(0.75, 0.75, 0.75)
rl.rlColor3f(0.75, 0.75, 0.75)
rl.rlColor3f(0.75, 0.75, 0.75)
rl.rlVertex3f(float(i)*spacing, 0.0, float(half_slices)*-1.0*spacing)
rl.rlVertex3f(float(i)*spacing, 0.0, float(half_slices)*spacing)
rl.rlVertex3f(float(half_slices)*-1.0*spacing, 0.0, float(i)*spacing)
rl.rlVertex3f(float(half_slices)*spacing, 0.0, float(i)*spacing)
rl.rlEnd()
# Draw cube
# NOTE: Cube position is the center position
def DrawCube(position: 'raylib.Vector3', width: float, height: float, length: float, color: Color):
x: float = 0.0
y: float = 0.0
z: float = 0.0
rl.rlPushMatrix()
# NOTE: Be careful! Function order matters (rotate -> scale -> translate)
rl.rlTranslatef(position.x, position.y, position.z)
#rlScalef(2.0f, 2.0f, 2.0f)
#rlRotatef(45, 0, 1, 0)
rl.rlBegin(RL_TRIANGLES)
rl.rlColor4ub(color.r, color.g, color.b, color.a)
# Front Face -----------------------------------------------------
rl.rlVertex3f(x-width/2, y-height/2, z+length/2) # Bottom Left
rl.rlVertex3f(x+width/2, y-height/2, z+length/2) # Bottom Right
rl.rlVertex3f(x-width/2, y+height/2, z+length/2) # Top Left
rl.rlVertex3f(x+width/2, y+height/2, z+length/2) # Top Right
rl.rlVertex3f(x-width/2, y+height/2, z+length/2) # Top Left
rl.rlVertex3f(x+width/2, y-height/2, z+length/2) # Bottom Right
# Back Face ------------------------------------------------------
rl.rlVertex3f(x-width/2, y-height/2, z-length/2) # Bottom Left
rl.rlVertex3f(x-width/2, y+height/2, z-length/2) # Top Left
rl.rlVertex3f(x+width/2, y-height/2, z-length/2) # Bottom Right
rl.rlVertex3f(x+width/2, y+height/2, z-length/2) # Top Right
rl.rlVertex3f(x+width/2, y-height/2, z-length/2) # Bottom Right
rl.rlVertex3f(x-width/2, y+height/2, z-length/2) # Top Left
# Top Face -------------------------------------------------------
rl.rlVertex3f(x-width/2, y+height/2, z-length/2) # Top Left
rl.rlVertex3f(x-width/2, y+height/2, z+length/2) # Bottom Left
rl.rlVertex3f(x+width/2, y+height/2, z+length/2) # Bottom Right
rl.rlVertex3f(x+width/2, y+height/2, z-length/2) # Top Right
rl.rlVertex3f(x-width/2, y+height/2, z-length/2) # Top Left
rl.rlVertex3f(x+width/2, y+height/2, z+length/2) # Bottom Right
# Bottom Face ----------------------------------------------------
rl.rlVertex3f(x-width/2, y-height/2, z-length/2) # Top Left
rl.rlVertex3f(x+width/2, y-height/2, z+length/2) # Bottom Right
rl.rlVertex3f(x-width/2, y-height/2, z+length/2) # Bottom Left
rl.rlVertex3f(x+width/2, y-height/2, z-length/2) # Top Right
rl.rlVertex3f(x+width/2, y-height/2, z+length/2) # Bottom Right
rl.rlVertex3f(x-width/2, y-height/2, z-length/2) # Top Left
# Right face -----------------------------------------------------
rl.rlVertex3f(x+width/2, y-height/2, z-length/2) # Bottom Right
rl.rlVertex3f(x+width/2, y+height/2, z-length/2) # Top Right
rl.rlVertex3f(x+width/2, y+height/2, z+length/2) # Top Left
rl.rlVertex3f(x+width/2, y-height/2, z+length/2) # Bottom Left
rl.rlVertex3f(x+width/2, y-height/2, z-length/2) # Bottom Right
rl.rlVertex3f(x+width/2, y+height/2, z+length/2) # Top Left
# Left Face ------------------------------------------------------
rl.rlVertex3f(x-width/2, y-height/2, z-length/2) # Bottom Right
rl.rlVertex3f(x-width/2, y+height/2, z+length/2) # Top Left
rl.rlVertex3f(x-width/2, y+height/2, z-length/2) # Top Right
rl.rlVertex3f(x-width/2, y-height/2, z+length/2) # Bottom Left
rl.rlVertex3f(x-width/2, y+height/2, z+length/2) # Top Left
rl.rlVertex3f(x-width/2, y-height/2, z-length/2) # Bottom Right
rl.rlEnd()
rl.rlPopMatrix()
#Draw cube wires
def DrawCubeWires(position: 'raylib.Vector3', width: float, height: float, length: float, color: Color):
x: float = 0.0
y: float = 0.0
z: float = 0.0
rl.rlPushMatrix()
rl.rlTranslatef(position.x, position.y, position.z)
#rlRotatef(45, 0, 1, 0)
rl.rlBegin(RL_LINES)
rl.rlColor4ub(color.r, color.g, color.b, color.a)
# Front Face -----------------------------------------------------
# Bottom Line
rl.rlVertex3f(x-width/2, y-height/2, z+length/2) # Bottom Left
rl.rlVertex3f(x+width/2, y-height/2, z+length/2) # Bottom Right
# Left Line
rl.rlVertex3f(x+width/2, y-height/2, z+length/2) # Bottom Right
rl.rlVertex3f(x+width/2, y+height/2, z+length/2) # Top Right
# Top Line
rl.rlVertex3f(x+width/2, y+height/2, z+length/2) # Top Right
rl.rlVertex3f(x-width/2, y+height/2, z+length/2) # Top Left
# Right Line
rl.rlVertex3f(x-width/2, y+height/2, z+length/2) # Top Left
rl.rlVertex3f(x-width/2, y-height/2, z+length/2) # Bottom Left
# Back Face ------------------------------------------------------
# Bottom Line
rl.rlVertex3f(x-width/2, y-height/2, z-length/2) # Bottom Left
rl.rlVertex3f(x+width/2, y-height/2, z-length/2) # Bottom Right
# Left Line
rl.rlVertex3f(x+width/2, y-height/2, z-length/2) # Bottom Right
rl.rlVertex3f(x+width/2, y+height/2, z-length/2) # Top Right
# Top Line
rl.rlVertex3f(x+width/2, y+height/2, z-length/2) # Top Right
rl.rlVertex3f(x-width/2, y+height/2, z-length/2) # Top Left
# Right Line
rl.rlVertex3f(x-width/2, y+height/2, z-length/2) # Top Left
rl.rlVertex3f(x-width/2, y-height/2, z-length/2) # Bottom Left
# Top Face -------------------------------------------------------
# Left Line
rl.rlVertex3f(x-width/2, y+height/2, z+length/2) # Top Left Front
rl.rlVertex3f(x-width/2, y+height/2, z-length/2) # Top Left Back
# Right Line
rl.rlVertex3f(x+width/2, y+height/2, z+length/2) # Top Right Front
rl.rlVertex3f(x+width/2, y+height/2, z-length/2) # Top Right Back
# Bottom Face ---------------------------------------------------
# Left Line
rl.rlVertex3f(x-width/2, y-height/2, z+length/2) # Top Left Front
rl.rlVertex3f(x-width/2, y-height/2, z-length/2) # Top Left Back
# Right Line
rl.rlVertex3f(x+width/2, y-height/2, z+length/2) # Top Right Front
rl.rlVertex3f(x+width/2, y-height/2, z-length/2) # Top Right Back
rl.rlEnd()
rl.rlPopMatrix()
# Initialization
#--------------------------------------------------------------------------------------
screenWidth: int = 800
screenHeight: int = 450
# GLFW3 Initialization + OpenGL 3.3 Context + Extensions
#--------------------------------------------------------
rl.glfwSetErrorCallback(ErrorCallback)
if not rl.glfwInit():
print("GLFW3: Can not initialize GLFW")
exit(1)
print("GLFW3: GLFW initialized successfully")
rl.glfwWindowHint(GLFW_SAMPLES, 4)
rl.glfwWindowHint(GLFW_DEPTH_BITS, 16)
# WARNING: OpenGL 3.3 Core profile only
rl.glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3)
rl.glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3)
rl.glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE)
#glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE)
#if defined(__APPLE__)
rl.glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_TRUE)
#endif
window = rl.glfwCreateWindow(screenWidth, screenHeight, b"rlgl standalone", ffi.NULL, ffi.NULL)
if not window:
print("Cannot create GLFW3 Window.")
rl.glfwTerminate()
exit(2)
print("GLFW3: Window created successfully")
rl.glfwSetWindowPos(window, 200, 200)
rl.glfwSetKeyCallback(window, KeyCallback)
rl.glfwMakeContextCurrent(window)
rl.glfwSwapInterval(0)
# Load OpenGL 3.3 supported extensions
rl.rlLoadExtensions(ffi.addressof(rl, 'glfwGetProcAddress'))
#--------------------------------------------------------
# Initialize OpenGL context (states and resources)
rl.rlglInit(screenWidth, screenHeight)
# Initialize viewport and internal projection/modelview matrices
rl.rlViewport(0, 0, screenWidth, screenHeight)
rl.rlMatrixMode(RL_PROJECTION) # Switch to PROJECTION matrix
rl.rlLoadIdentity() # Reset current matrix (PROJECTION)
rl.rlOrtho(0, screenWidth, screenHeight, 0, 0.0, 1.0) # Orthographic projection with top-left corner at (0,0)
rl.rlMatrixMode(RL_MODELVIEW) # Switch back to MODELVIEW matrix
rl.rlLoadIdentity() # Reset current matrix (MODELVIEW)
rl.rlClearColor(245, 245, 245, 255) # Define clear color
rl.rlEnableDepthTest() # Enable DEPTH_TEST for 3D
camera = Camera(
position = pyray.Vector3(5.0, 5.0, 5.0), # Camera position
target = pyray.Vector3(0.0, 0.0, 0.0), # Camera looking at point
up = pyray.Vector3(0.0, 1.0, 0.0), # Camera up vector (rotation towards target)
fovy = 45.0, # Camera field-of-view Y
projection=rl.CAMERA_PERSPECTIVE)
cubePosition = pyray.Vector3(0.0, 0.0, 0.0) # Cube default position (center)
#--------------------------------------------------------------------------------------
RLGL_SET_MATRIX_MANUALLY = True
# Main game loop
while not rl.glfwWindowShouldClose(window):
# Update
#----------------------------------------------------------------------------------
#camera.position.x += 0.01f
#----------------------------------------------------------------------------------
# Draw
#----------------------------------------------------------------------------------
rl.rlClearScreenBuffers() # Clear current framebuffer
# Draw '3D' elements in the scene
#-----------------------------------------------
# Calculate projection matrix (from perspective) and view matrix from camera look at
matProj = rl.MatrixPerspective(camera.fovy*DEG2RAD, float(screenWidth)/float(screenHeight), 0.01, 1000.0)
matView = rl.MatrixLookAt(camera.position, camera.target, camera.up)
rl.rlSetMatrixModelview(matView) # Set internal modelview matrix (default shader)
rl.rlSetMatrixProjection(matProj) # Set internal projection matrix (default shader)
DrawCube(cubePosition, 2.0, 2.0, 2.0, Color(*RED))
DrawCubeWires(cubePosition, 2.0, 2.0, 2.0, Color(*RAYWHITE))
DrawGrid(10, 1.0)
# Draw internal render batch buffers (3D data)
rl.rlDrawRenderBatchActive()
#-----------------------------------------------
# Draw '2D' elements in the scene (GUI)
#-----------------------------------------------
if RLGL_SET_MATRIX_MANUALLY:
matProj = rl.MatrixOrtho(0.0, screenWidth, screenHeight, 0.0, 0.0, 1.0)
matView = rl.MatrixIdentity()
rl.rlSetMatrixModelview(matView) # Set internal modelview matrix (default shader)
rl.rlSetMatrixProjection(matProj) # Set internal projection matrix (default shader)
else: # Let rlgl generate and multiply matrix internally
rl.rlMatrixMode(RL_PROJECTION) # Enable internal projection matrix
rl.rlLoadIdentity() # Reset internal projection matrix
rl.rlOrtho(0.0, screenWidth, screenHeight, 0.0, 0.0, 1.0) # Recalculate internal projection matrix
rl.rlMatrixMode(RL_MODELVIEW) # Enable internal modelview matrix
rl.rlLoadIdentity() # Reset internal modelview matrix
DrawRectangleV(pyray.Vector2(10.0, 10.0), pyray.Vector2(780.0, 20.0), Color(*DARKGRAY))
# Draw internal render batch buffers (2D data)
rl.rlDrawRenderBatchActive()
#-----------------------------------------------
rl.glfwSwapBuffers(window)
rl.glfwPollEvents()
#----------------------------------------------------------------------------------
# De-Initialization
#--------------------------------------------------------------------------------------
rl.rlglClose() # Unload rlgl internal buffers and default shader/texture
rl.glfwDestroyWindow(window) # Close window
rl.glfwTerminate() # Free GLFW3 resources
#--------------------------------------------------------------------------------------

View file

@ -1,14 +1,20 @@
#!/usr/bin/env bash
gcc raylib-c/parser/raylib_parser.c
./a.out -i raygui/src/raygui.h -o raygui.json -f JSON
./a.out -i physac/src/physac.h -o physac.json -f JSON
./a.out -i raygui/src/raygui.h -d RAYGUIAPI -o raygui.json -f JSON
./a.out -i physac/src/physac.h -d PHYSACDEF -o physac.json -f JSON
./a.out -i raylib-c/src/raylib.h -o raylib.json -f JSON
./a.out -i raylib-c/src/rlgl.h -o rlgl.json -f JSON
./a.out -i raylib-c/src/raymath.h -d RMAPI -o raymath.json -f JSON
./a.out -i raylib-c/src/external/glfw/include/GLFW/glfw3.h -d GLFWAPI -o glfw3.json -f JSON
sed -i "s|\/\*.*,$|,|g" glfw3.json
python3 raylib/build.py
python3 create_enums.py > raylib/enums.py
python3 create_enums.py > dynamic/raylib/enums.py
python3 create_define_consts.py > raylib/defines.py
python3 create_define_consts.py > dynamic/raylib/defines.py
pip3 install sphinx-autoapi myst_parser sphinx_rtd_theme
python3 create_stub_pyray.py > pyray/__init__.pyi

File diff suppressed because it is too large Load diff

2
raygui

@ -1 +1 @@
Subproject commit 2b45fea4295cd6ff4b425e21706b9c950245b805
Subproject commit 25c8c65a6e5f0f4d4b564a0343861898c6f2778b

@ -1 +1 @@
Subproject commit fec96137e8d10ee6c88914fbe5e5429c13ee1dac
Subproject commit ae50bfa2cc569c0f8d5bc4315d39db64005b1b08

File diff suppressed because it is too large Load diff

View file

@ -125,6 +125,12 @@ def build_unix():
#include "raymath.h"
"""
glfw3_h = get_the_include_path() + "/GLFW/glfw3.h"
if check_header_exists(glfw3_h):
ffi_includes += """
#include "GLFW/glfw3.h"
"""
raygui_h = get_the_include_path() + "/raygui.h"
if check_header_exists(raygui_h):
ffi_includes += """
@ -141,6 +147,7 @@ def build_unix():
"""
ffibuilder.cdef(pre_process_header(raylib_h))
ffibuilder.cdef(pre_process_header(glfw3_h))
ffibuilder.cdef(pre_process_header(rlgl_h))
ffibuilder.cdef(pre_process_header(raymath_h, True))
@ -171,6 +178,7 @@ def build_unix():
def build_windows():
print("BUILDING FOR WINDOWS")
ffibuilder.cdef(open("raylib/raylib.h.modified").read())
ffibuilder.cdef(open("raylib/glfw3.h.modified").read())
ffibuilder.cdef(open("raylib/rlgl.h.modified").read())
ffibuilder.cdef(open("raylib/raygui.h.modified").read())
ffibuilder.cdef(open("raylib/physac.h.modified").read())
@ -179,6 +187,7 @@ def build_windows():
#include "raylib.h"
#include "rlgl.h"
#include "raymath.h"
#include "GLFW/glfw3.h"
#define RAYGUI_IMPLEMENTATION
#define RAYGUI_SUPPORT_RICONS
#include "raygui.h"
@ -188,6 +197,7 @@ def build_windows():
extra_link_args=['/NODEFAULTLIB:MSVCRTD'],
libraries=['raylib', 'gdi32', 'shell32', 'user32', 'OpenGL32', 'winmm'],
include_dirs=['D:\\a\\raylib-python-cffi\\raylib-python-cffi\\raylib-c\\src',
'D:\\a\\raylib-python-cffi\\raylib-python-cffi\\raylib-c\\src\\external\\glfw',
'D:\\a\\raylib-python-cffi\\raylib-python-cffi\\raygui\\src',
'D:\\a\\raylib-python-cffi\\raylib-python-cffi\\physac\\src'],
)

View file

@ -1,9 +1,494 @@
import raylib
MOUSE_LEFT_BUTTON = raylib.MOUSE_BUTTON_LEFT
MOUSE_RIGHT_BUTTON = raylib.MOUSE_BUTTON_RIGHT
RAYLIB_VERSION_MAJOR: int = 5
RAYLIB_VERSION_MINOR: int = 0
RAYLIB_VERSION_PATCH: int = 0
RAYLIB_VERSION: str = "5.0"
PI: float = 3.141592653589793
DEG2RAD = PI / 180.0
RAD2DEG = 180.0 / PI
MOUSE_LEFT_BUTTON = raylib.MOUSE_BUTTON_LEFT
MOUSE_RIGHT_BUTTON = raylib.MOUSE_BUTTON_RIGHT
MOUSE_MIDDLE_BUTTON = raylib.MOUSE_BUTTON_MIDDLE
MATERIAL_MAP_DIFFUSE = raylib.MATERIAL_MAP_ALBEDO
MATERIAL_MAP_SPECULAR = raylib.MATERIAL_MAP_METALNESS
SHADER_LOC_MAP_DIFFUSE = raylib.SHADER_LOC_MAP_ALBEDO
SHADER_LOC_MAP_SPECULAR = raylib.SHADER_LOC_MAP_METALNESS
SHADER_LOC_MAP_DIFFUSE = raylib.SHADER_LOC_MAP_ALBEDO
SHADER_LOC_MAP_SPECULAR = raylib.SHADER_LOC_MAP_METALNESS
PI: float = 3.141592653589793
EPSILON: float = 1e-06
DEG2RAD = PI / 180.0
RAD2DEG = 180.0 / PI
RLGL_VERSION: str = "4.5"
RL_DEFAULT_BATCH_BUFFER_ELEMENTS: int = 8192
RL_DEFAULT_BATCH_BUFFERS: int = 1
RL_DEFAULT_BATCH_DRAWCALLS: int = 256
RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS: int = 4
RL_MAX_MATRIX_STACK_SIZE: int = 32
RL_MAX_SHADER_LOCATIONS: int = 32
RL_TEXTURE_WRAP_S: int = 10242
RL_TEXTURE_WRAP_T: int = 10243
RL_TEXTURE_MAG_FILTER: int = 10240
RL_TEXTURE_MIN_FILTER: int = 10241
RL_TEXTURE_FILTER_NEAREST: int = 9728
RL_TEXTURE_FILTER_LINEAR: int = 9729
RL_TEXTURE_FILTER_MIP_NEAREST: int = 9984
RL_TEXTURE_FILTER_NEAREST_MIP_LINEAR: int = 9986
RL_TEXTURE_FILTER_LINEAR_MIP_NEAREST: int = 9985
RL_TEXTURE_FILTER_MIP_LINEAR: int = 9987
RL_TEXTURE_FILTER_ANISOTROPIC: int = 12288
RL_TEXTURE_MIPMAP_BIAS_RATIO: int = 16384
RL_TEXTURE_WRAP_REPEAT: int = 10497
RL_TEXTURE_WRAP_CLAMP: int = 33071
RL_TEXTURE_WRAP_MIRROR_REPEAT: int = 33648
RL_TEXTURE_WRAP_MIRROR_CLAMP: int = 34626
RL_MODELVIEW: int = 5888
RL_PROJECTION: int = 5889
RL_TEXTURE: int = 5890
RL_LINES: int = 1
RL_TRIANGLES: int = 4
RL_QUADS: int = 7
RL_UNSIGNED_BYTE: int = 5121
RL_FLOAT: int = 5126
RL_STREAM_DRAW: int = 35040
RL_STREAM_READ: int = 35041
RL_STREAM_COPY: int = 35042
RL_STATIC_DRAW: int = 35044
RL_STATIC_READ: int = 35045
RL_STATIC_COPY: int = 35046
RL_DYNAMIC_DRAW: int = 35048
RL_DYNAMIC_READ: int = 35049
RL_DYNAMIC_COPY: int = 35050
RL_FRAGMENT_SHADER: int = 35632
RL_VERTEX_SHADER: int = 35633
RL_COMPUTE_SHADER: int = 37305
RL_ZERO: int = 0
RL_ONE: int = 1
RL_SRC_COLOR: int = 768
RL_ONE_MINUS_SRC_COLOR: int = 769
RL_SRC_ALPHA: int = 770
RL_ONE_MINUS_SRC_ALPHA: int = 771
RL_DST_ALPHA: int = 772
RL_ONE_MINUS_DST_ALPHA: int = 773
RL_DST_COLOR: int = 774
RL_ONE_MINUS_DST_COLOR: int = 775
RL_SRC_ALPHA_SATURATE: int = 776
RL_CONSTANT_COLOR: int = 32769
RL_ONE_MINUS_CONSTANT_COLOR: int = 32770
RL_CONSTANT_ALPHA: int = 32771
RL_ONE_MINUS_CONSTANT_ALPHA: int = 32772
RL_FUNC_ADD: int = 32774
RL_MIN: int = 32775
RL_MAX: int = 32776
RL_FUNC_SUBTRACT: int = 32778
RL_FUNC_REVERSE_SUBTRACT: int = 32779
RL_BLEND_EQUATION: int = 32777
RL_BLEND_EQUATION_RGB: int = 32777
RL_BLEND_EQUATION_ALPHA: int = 34877
RL_BLEND_DST_RGB: int = 32968
RL_BLEND_SRC_RGB: int = 32969
RL_BLEND_DST_ALPHA: int = 32970
RL_BLEND_SRC_ALPHA: int = 32971
RL_BLEND_COLOR: int = 32773
RL_SHADER_LOC_MAP_DIFFUSE = raylib.RL_SHADER_LOC_MAP_ALBEDO
RL_SHADER_LOC_MAP_SPECULAR = raylib.RL_SHADER_LOC_MAP_METALNESS
PI: float = 3.141592653589793
DEG2RAD = PI / 180.0
RAD2DEG = 180.0 / PI
GL_SHADING_LANGUAGE_VERSION: int = 35724
GL_COMPRESSED_RGB_S3TC_DXT1_EXT: int = 33776
GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: int = 33777
GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: int = 33778
GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: int = 33779
GL_ETC1_RGB8_OES: int = 36196
GL_COMPRESSED_RGB8_ETC2: int = 37492
GL_COMPRESSED_RGBA8_ETC2_EAC: int = 37496
GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG: int = 35840
GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG: int = 35842
GL_COMPRESSED_RGBA_ASTC_4x4_KHR: int = 37808
GL_COMPRESSED_RGBA_ASTC_8x8_KHR: int = 37815
GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT: int = 34047
GL_TEXTURE_MAX_ANISOTROPY_EXT: int = 34046
GL_UNSIGNED_SHORT_5_6_5: int = 33635
GL_UNSIGNED_SHORT_5_5_5_1: int = 32820
GL_UNSIGNED_SHORT_4_4_4_4: int = 32819
GL_LUMINANCE: int = 6409
GL_LUMINANCE_ALPHA: int = 6410
RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION: str = "vertexPosition"
RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD: str = "vertexTexCoord"
RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL: str = "vertexNormal"
RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR: str = "vertexColor"
RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT: str = "vertexTangent"
RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2: str = "vertexTexCoord2"
RL_DEFAULT_SHADER_UNIFORM_NAME_MVP: str = "mvp"
RL_DEFAULT_SHADER_UNIFORM_NAME_VIEW: str = "matView"
RL_DEFAULT_SHADER_UNIFORM_NAME_PROJECTION: str = "matProjection"
RL_DEFAULT_SHADER_UNIFORM_NAME_MODEL: str = "matModel"
RL_DEFAULT_SHADER_UNIFORM_NAME_NORMAL: str = "matNormal"
RL_DEFAULT_SHADER_UNIFORM_NAME_COLOR: str = "colDiffuse"
RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE0: str = "texture0"
RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE1: str = "texture1"
RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE2: str = "texture2"
RAYGUI_VERSION_MAJOR: int = 4
RAYGUI_VERSION_MINOR: int = 0
RAYGUI_VERSION_PATCH: int = 0
RAYGUI_VERSION: str = "4.0"
SCROLLBAR_LEFT_SIDE: int = 0
SCROLLBAR_RIGHT_SIDE: int = 1
RAYGUI_ICON_SIZE: int = 16
RAYGUI_ICON_MAX_ICONS: int = 256
RAYGUI_ICON_MAX_NAME_LENGTH: int = 32
RAYGUI_MAX_CONTROLS: int = 16
RAYGUI_MAX_PROPS_BASE: int = 16
RAYGUI_MAX_PROPS_EXTENDED: int = 8
KEY_RIGHT: int = 262
KEY_LEFT: int = 263
KEY_DOWN: int = 264
KEY_UP: int = 265
KEY_BACKSPACE: int = 259
KEY_ENTER: int = 257
MOUSE_LEFT_BUTTON: int = 0
RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT: int = 24
RAYGUI_GROUPBOX_LINE_THICK: int = 1
RAYGUI_LINE_MARGIN_TEXT: int = 12
RAYGUI_LINE_TEXT_PADDING: int = 4
RAYGUI_PANEL_BORDER_WIDTH: int = 1
RAYGUI_TABBAR_ITEM_WIDTH: int = 160
RAYGUI_MIN_SCROLLBAR_WIDTH: int = 40
RAYGUI_MIN_SCROLLBAR_HEIGHT: int = 40
RAYGUI_TOGGLEGROUP_MAX_ITEMS: int = 32
RAYGUI_TEXTBOX_AUTO_CURSOR_COOLDOWN: int = 40
RAYGUI_TEXTBOX_AUTO_CURSOR_DELAY: int = 1
RAYGUI_VALUEBOX_MAX_CHARS: int = 32
RAYGUI_COLORBARALPHA_CHECKED_SIZE: int = 10
RAYGUI_MESSAGEBOX_BUTTON_HEIGHT: int = 24
RAYGUI_MESSAGEBOX_BUTTON_PADDING: int = 12
RAYGUI_TEXTINPUTBOX_BUTTON_HEIGHT: int = 24
RAYGUI_TEXTINPUTBOX_BUTTON_PADDING: int = 12
RAYGUI_TEXTINPUTBOX_HEIGHT: int = 26
RAYGUI_GRID_ALPHA: float = 0.15
MAX_LINE_BUFFER_SIZE: int = 256
ICON_TEXT_PADDING: int = 4
RAYGUI_MAX_TEXT_LINES: int = 128
RAYGUI_TEXTSPLIT_MAX_ITEMS: int = 128
RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE: int = 1024
RAYGUI_TEXTFORMAT_MAX_SIZE: int = 256
PHYSAC_MAX_BODIES: int = 64
PHYSAC_MAX_MANIFOLDS: int = 4096
PHYSAC_MAX_VERTICES: int = 24
PHYSAC_DEFAULT_CIRCLE_VERTICES: int = 24
PHYSAC_COLLISION_ITERATIONS: int = 100
PHYSAC_PENETRATION_ALLOWANCE: float = 0.05
PHYSAC_PENETRATION_CORRECTION: float = 0.4
PHYSAC_PI: float = 3.141592653589793
PHYSAC_DEG2RAD = PHYSAC_PI / 180.0
PHYSAC_FLT_MAX: float = 3.402823466e+38
PHYSAC_EPSILON: float = 1e-06
GLFW_VERSION_MAJOR: int = 3
GLFW_VERSION_MINOR: int = 4
GLFW_VERSION_REVISION: int = 0
GLFW_TRUE: int = 1
GLFW_FALSE: int = 0
GLFW_RELEASE: int = 0
GLFW_PRESS: int = 1
GLFW_REPEAT: int = 2
GLFW_HAT_CENTERED: int = 0
GLFW_HAT_UP: int = 1
GLFW_HAT_RIGHT: int = 2
GLFW_HAT_DOWN: int = 4
GLFW_HAT_LEFT: int = 8
GLFW_HAT_RIGHT_UP = GLFW_HAT_RIGHT | GLFW_HAT_UP
GLFW_HAT_RIGHT_DOWN = GLFW_HAT_RIGHT | GLFW_HAT_DOWN
GLFW_HAT_LEFT_UP = GLFW_HAT_LEFT | GLFW_HAT_UP
GLFW_HAT_LEFT_DOWN = GLFW_HAT_LEFT | GLFW_HAT_DOWN
GLFW_KEY_SPACE: int = 32
GLFW_KEY_APOSTROPHE: int = 39
GLFW_KEY_COMMA: int = 44
GLFW_KEY_MINUS: int = 45
GLFW_KEY_PERIOD: int = 46
GLFW_KEY_SLASH: int = 47
GLFW_KEY_0: int = 48
GLFW_KEY_1: int = 49
GLFW_KEY_2: int = 50
GLFW_KEY_3: int = 51
GLFW_KEY_4: int = 52
GLFW_KEY_5: int = 53
GLFW_KEY_6: int = 54
GLFW_KEY_7: int = 55
GLFW_KEY_8: int = 56
GLFW_KEY_9: int = 57
GLFW_KEY_SEMICOLON: int = 59
GLFW_KEY_EQUAL: int = 61
GLFW_KEY_A: int = 65
GLFW_KEY_B: int = 66
GLFW_KEY_C: int = 67
GLFW_KEY_D: int = 68
GLFW_KEY_E: int = 69
GLFW_KEY_F: int = 70
GLFW_KEY_G: int = 71
GLFW_KEY_H: int = 72
GLFW_KEY_I: int = 73
GLFW_KEY_J: int = 74
GLFW_KEY_K: int = 75
GLFW_KEY_L: int = 76
GLFW_KEY_M: int = 77
GLFW_KEY_N: int = 78
GLFW_KEY_O: int = 79
GLFW_KEY_P: int = 80
GLFW_KEY_Q: int = 81
GLFW_KEY_R: int = 82
GLFW_KEY_S: int = 83
GLFW_KEY_T: int = 84
GLFW_KEY_U: int = 85
GLFW_KEY_V: int = 86
GLFW_KEY_W: int = 87
GLFW_KEY_X: int = 88
GLFW_KEY_Y: int = 89
GLFW_KEY_Z: int = 90
GLFW_KEY_LEFT_BRACKET: int = 91
GLFW_KEY_BACKSLASH: int = 92
GLFW_KEY_RIGHT_BRACKET: int = 93
GLFW_KEY_GRAVE_ACCENT: int = 96
GLFW_KEY_WORLD_1: int = 161
GLFW_KEY_WORLD_2: int = 162
GLFW_KEY_ESCAPE: int = 256
GLFW_KEY_ENTER: int = 257
GLFW_KEY_TAB: int = 258
GLFW_KEY_BACKSPACE: int = 259
GLFW_KEY_INSERT: int = 260
GLFW_KEY_DELETE: int = 261
GLFW_KEY_RIGHT: int = 262
GLFW_KEY_LEFT: int = 263
GLFW_KEY_DOWN: int = 264
GLFW_KEY_UP: int = 265
GLFW_KEY_PAGE_UP: int = 266
GLFW_KEY_PAGE_DOWN: int = 267
GLFW_KEY_HOME: int = 268
GLFW_KEY_END: int = 269
GLFW_KEY_CAPS_LOCK: int = 280
GLFW_KEY_SCROLL_LOCK: int = 281
GLFW_KEY_NUM_LOCK: int = 282
GLFW_KEY_PRINT_SCREEN: int = 283
GLFW_KEY_PAUSE: int = 284
GLFW_KEY_F1: int = 290
GLFW_KEY_F2: int = 291
GLFW_KEY_F3: int = 292
GLFW_KEY_F4: int = 293
GLFW_KEY_F5: int = 294
GLFW_KEY_F6: int = 295
GLFW_KEY_F7: int = 296
GLFW_KEY_F8: int = 297
GLFW_KEY_F9: int = 298
GLFW_KEY_F10: int = 299
GLFW_KEY_F11: int = 300
GLFW_KEY_F12: int = 301
GLFW_KEY_F13: int = 302
GLFW_KEY_F14: int = 303
GLFW_KEY_F15: int = 304
GLFW_KEY_F16: int = 305
GLFW_KEY_F17: int = 306
GLFW_KEY_F18: int = 307
GLFW_KEY_F19: int = 308
GLFW_KEY_F20: int = 309
GLFW_KEY_F21: int = 310
GLFW_KEY_F22: int = 311
GLFW_KEY_F23: int = 312
GLFW_KEY_F24: int = 313
GLFW_KEY_F25: int = 314
GLFW_KEY_KP_0: int = 320
GLFW_KEY_KP_1: int = 321
GLFW_KEY_KP_2: int = 322
GLFW_KEY_KP_3: int = 323
GLFW_KEY_KP_4: int = 324
GLFW_KEY_KP_5: int = 325
GLFW_KEY_KP_6: int = 326
GLFW_KEY_KP_7: int = 327
GLFW_KEY_KP_8: int = 328
GLFW_KEY_KP_9: int = 329
GLFW_KEY_KP_DECIMAL: int = 330
GLFW_KEY_KP_DIVIDE: int = 331
GLFW_KEY_KP_MULTIPLY: int = 332
GLFW_KEY_KP_SUBTRACT: int = 333
GLFW_KEY_KP_ADD: int = 334
GLFW_KEY_KP_ENTER: int = 335
GLFW_KEY_KP_EQUAL: int = 336
GLFW_KEY_LEFT_SHIFT: int = 340
GLFW_KEY_LEFT_CONTROL: int = 341
GLFW_KEY_LEFT_ALT: int = 342
GLFW_KEY_LEFT_SUPER: int = 343
GLFW_KEY_RIGHT_SHIFT: int = 344
GLFW_KEY_RIGHT_CONTROL: int = 345
GLFW_KEY_RIGHT_ALT: int = 346
GLFW_KEY_RIGHT_SUPER: int = 347
GLFW_KEY_MENU: int = 348
GLFW_MOD_SHIFT: int = 1
GLFW_MOD_CONTROL: int = 2
GLFW_MOD_ALT: int = 4
GLFW_MOD_SUPER: int = 8
GLFW_MOD_CAPS_LOCK: int = 16
GLFW_MOD_NUM_LOCK: int = 32
GLFW_MOUSE_BUTTON_1: int = 0
GLFW_MOUSE_BUTTON_2: int = 1
GLFW_MOUSE_BUTTON_3: int = 2
GLFW_MOUSE_BUTTON_4: int = 3
GLFW_MOUSE_BUTTON_5: int = 4
GLFW_MOUSE_BUTTON_6: int = 5
GLFW_MOUSE_BUTTON_7: int = 6
GLFW_MOUSE_BUTTON_8: int = 7
GLFW_JOYSTICK_1: int = 0
GLFW_JOYSTICK_2: int = 1
GLFW_JOYSTICK_3: int = 2
GLFW_JOYSTICK_4: int = 3
GLFW_JOYSTICK_5: int = 4
GLFW_JOYSTICK_6: int = 5
GLFW_JOYSTICK_7: int = 6
GLFW_JOYSTICK_8: int = 7
GLFW_JOYSTICK_9: int = 8
GLFW_JOYSTICK_10: int = 9
GLFW_JOYSTICK_11: int = 10
GLFW_JOYSTICK_12: int = 11
GLFW_JOYSTICK_13: int = 12
GLFW_JOYSTICK_14: int = 13
GLFW_JOYSTICK_15: int = 14
GLFW_JOYSTICK_16: int = 15
GLFW_GAMEPAD_BUTTON_A: int = 0
GLFW_GAMEPAD_BUTTON_B: int = 1
GLFW_GAMEPAD_BUTTON_X: int = 2
GLFW_GAMEPAD_BUTTON_Y: int = 3
GLFW_GAMEPAD_BUTTON_LEFT_BUMPER: int = 4
GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER: int = 5
GLFW_GAMEPAD_BUTTON_BACK: int = 6
GLFW_GAMEPAD_BUTTON_START: int = 7
GLFW_GAMEPAD_BUTTON_GUIDE: int = 8
GLFW_GAMEPAD_BUTTON_LEFT_THUMB: int = 9
GLFW_GAMEPAD_BUTTON_RIGHT_THUMB: int = 10
GLFW_GAMEPAD_BUTTON_DPAD_UP: int = 11
GLFW_GAMEPAD_BUTTON_DPAD_RIGHT: int = 12
GLFW_GAMEPAD_BUTTON_DPAD_DOWN: int = 13
GLFW_GAMEPAD_BUTTON_DPAD_LEFT: int = 14
GLFW_GAMEPAD_AXIS_LEFT_X: int = 0
GLFW_GAMEPAD_AXIS_LEFT_Y: int = 1
GLFW_GAMEPAD_AXIS_RIGHT_X: int = 2
GLFW_GAMEPAD_AXIS_RIGHT_Y: int = 3
GLFW_GAMEPAD_AXIS_LEFT_TRIGGER: int = 4
GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER: int = 5
GLFW_NO_ERROR: int = 0
GLFW_NOT_INITIALIZED: int = 65537
GLFW_NO_CURRENT_CONTEXT: int = 65538
GLFW_INVALID_ENUM: int = 65539
GLFW_INVALID_VALUE: int = 65540
GLFW_OUT_OF_MEMORY: int = 65541
GLFW_API_UNAVAILABLE: int = 65542
GLFW_VERSION_UNAVAILABLE: int = 65543
GLFW_PLATFORM_ERROR: int = 65544
GLFW_FORMAT_UNAVAILABLE: int = 65545
GLFW_NO_WINDOW_CONTEXT: int = 65546
GLFW_CURSOR_UNAVAILABLE: int = 65547
GLFW_FEATURE_UNAVAILABLE: int = 65548
GLFW_FEATURE_UNIMPLEMENTED: int = 65549
GLFW_PLATFORM_UNAVAILABLE: int = 65550
GLFW_FOCUSED: int = 131073
GLFW_ICONIFIED: int = 131074
GLFW_RESIZABLE: int = 131075
GLFW_VISIBLE: int = 131076
GLFW_DECORATED: int = 131077
GLFW_AUTO_ICONIFY: int = 131078
GLFW_FLOATING: int = 131079
GLFW_MAXIMIZED: int = 131080
GLFW_CENTER_CURSOR: int = 131081
GLFW_TRANSPARENT_FRAMEBUFFER: int = 131082
GLFW_HOVERED: int = 131083
GLFW_FOCUS_ON_SHOW: int = 131084
GLFW_MOUSE_PASSTHROUGH: int = 131085
GLFW_POSITION_X: int = 131086
GLFW_POSITION_Y: int = 131087
GLFW_RED_BITS: int = 135169
GLFW_GREEN_BITS: int = 135170
GLFW_BLUE_BITS: int = 135171
GLFW_ALPHA_BITS: int = 135172
GLFW_DEPTH_BITS: int = 135173
GLFW_STENCIL_BITS: int = 135174
GLFW_ACCUM_RED_BITS: int = 135175
GLFW_ACCUM_GREEN_BITS: int = 135176
GLFW_ACCUM_BLUE_BITS: int = 135177
GLFW_ACCUM_ALPHA_BITS: int = 135178
GLFW_AUX_BUFFERS: int = 135179
GLFW_STEREO: int = 135180
GLFW_SAMPLES: int = 135181
GLFW_SRGB_CAPABLE: int = 135182
GLFW_REFRESH_RATE: int = 135183
GLFW_DOUBLEBUFFER: int = 135184
GLFW_CLIENT_API: int = 139265
GLFW_CONTEXT_VERSION_MAJOR: int = 139266
GLFW_CONTEXT_VERSION_MINOR: int = 139267
GLFW_CONTEXT_REVISION: int = 139268
GLFW_CONTEXT_ROBUSTNESS: int = 139269
GLFW_OPENGL_FORWARD_COMPAT: int = 139270
GLFW_CONTEXT_DEBUG: int = 139271
GLFW_OPENGL_PROFILE: int = 139272
GLFW_CONTEXT_RELEASE_BEHAVIOR: int = 139273
GLFW_CONTEXT_NO_ERROR: int = 139274
GLFW_CONTEXT_CREATION_API: int = 139275
GLFW_SCALE_TO_MONITOR: int = 139276
GLFW_COCOA_RETINA_FRAMEBUFFER: int = 143361
GLFW_COCOA_FRAME_NAME: int = 143362
GLFW_COCOA_GRAPHICS_SWITCHING: int = 143363
GLFW_X11_CLASS_NAME: int = 147457
GLFW_X11_INSTANCE_NAME: int = 147458
GLFW_WIN32_KEYBOARD_MENU: int = 151553
GLFW_WAYLAND_APP_ID: int = 155649
GLFW_NO_API: int = 0
GLFW_OPENGL_API: int = 196609
GLFW_OPENGL_ES_API: int = 196610
GLFW_NO_ROBUSTNESS: int = 0
GLFW_NO_RESET_NOTIFICATION: int = 200705
GLFW_LOSE_CONTEXT_ON_RESET: int = 200706
GLFW_OPENGL_ANY_PROFILE: int = 0
GLFW_OPENGL_CORE_PROFILE: int = 204801
GLFW_OPENGL_COMPAT_PROFILE: int = 204802
GLFW_CURSOR: int = 208897
GLFW_STICKY_KEYS: int = 208898
GLFW_STICKY_MOUSE_BUTTONS: int = 208899
GLFW_LOCK_KEY_MODS: int = 208900
GLFW_RAW_MOUSE_MOTION: int = 208901
GLFW_CURSOR_NORMAL: int = 212993
GLFW_CURSOR_HIDDEN: int = 212994
GLFW_CURSOR_DISABLED: int = 212995
GLFW_CURSOR_CAPTURED: int = 212996
GLFW_ANY_RELEASE_BEHAVIOR: int = 0
GLFW_RELEASE_BEHAVIOR_FLUSH: int = 217089
GLFW_RELEASE_BEHAVIOR_NONE: int = 217090
GLFW_NATIVE_CONTEXT_API: int = 221185
GLFW_EGL_CONTEXT_API: int = 221186
GLFW_OSMESA_CONTEXT_API: int = 221187
GLFW_ANGLE_PLATFORM_TYPE_NONE: int = 225281
GLFW_ANGLE_PLATFORM_TYPE_OPENGL: int = 225282
GLFW_ANGLE_PLATFORM_TYPE_OPENGLES: int = 225283
GLFW_ANGLE_PLATFORM_TYPE_D3D9: int = 225284
GLFW_ANGLE_PLATFORM_TYPE_D3D11: int = 225285
GLFW_ANGLE_PLATFORM_TYPE_VULKAN: int = 225287
GLFW_ANGLE_PLATFORM_TYPE_METAL: int = 225288
GLFW_ANY_POSITION: int = 2147483648
GLFW_ARROW_CURSOR: int = 221185
GLFW_IBEAM_CURSOR: int = 221186
GLFW_CROSSHAIR_CURSOR: int = 221187
GLFW_POINTING_HAND_CURSOR: int = 221188
GLFW_RESIZE_EW_CURSOR: int = 221189
GLFW_RESIZE_NS_CURSOR: int = 221190
GLFW_RESIZE_NWSE_CURSOR: int = 221191
GLFW_RESIZE_NESW_CURSOR: int = 221192
GLFW_RESIZE_ALL_CURSOR: int = 221193
GLFW_NOT_ALLOWED_CURSOR: int = 221194
GLFW_CONNECTED: int = 262145
GLFW_DISCONNECTED: int = 262146
GLFW_JOYSTICK_HAT_BUTTONS: int = 327681
GLFW_ANGLE_PLATFORM_TYPE: int = 327682
GLFW_PLATFORM: int = 327683
GLFW_COCOA_CHDIR_RESOURCES: int = 331777
GLFW_COCOA_MENUBAR: int = 331778
GLFW_X11_XCB_VULKAN_SURFACE: int = 335873
GLFW_ANY_PLATFORM: int = 393216
GLFW_PLATFORM_WIN32: int = 393217
GLFW_PLATFORM_COCOA: int = 393218
GLFW_PLATFORM_WAYLAND: int = 393219
GLFW_PLATFORM_X11: int = 393220
GLFW_PLATFORM_NULL: int = 393221

View file

@ -14,6 +14,7 @@ class ConfigFlags(IntEnum):
FLAG_WINDOW_TRANSPARENT = 16
FLAG_WINDOW_HIGHDPI = 8192
FLAG_WINDOW_MOUSE_PASSTHROUGH = 16384
FLAG_BORDERLESS_WINDOWED_MODE = 32768
FLAG_MSAA_4X_HINT = 32
FLAG_INTERLACED_HINT = 65536
@ -258,17 +259,20 @@ class PixelFormat(IntEnum):
PIXELFORMAT_UNCOMPRESSED_R32 = 8
PIXELFORMAT_UNCOMPRESSED_R32G32B32 = 9
PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 = 10
PIXELFORMAT_COMPRESSED_DXT1_RGB = 11
PIXELFORMAT_COMPRESSED_DXT1_RGBA = 12
PIXELFORMAT_COMPRESSED_DXT3_RGBA = 13
PIXELFORMAT_COMPRESSED_DXT5_RGBA = 14
PIXELFORMAT_COMPRESSED_ETC1_RGB = 15
PIXELFORMAT_COMPRESSED_ETC2_RGB = 16
PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 17
PIXELFORMAT_COMPRESSED_PVRT_RGB = 18
PIXELFORMAT_COMPRESSED_PVRT_RGBA = 19
PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 20
PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 21
PIXELFORMAT_UNCOMPRESSED_R16 = 11
PIXELFORMAT_UNCOMPRESSED_R16G16B16 = 12
PIXELFORMAT_UNCOMPRESSED_R16G16B16A16 = 13
PIXELFORMAT_COMPRESSED_DXT1_RGB = 14
PIXELFORMAT_COMPRESSED_DXT1_RGBA = 15
PIXELFORMAT_COMPRESSED_DXT3_RGBA = 16
PIXELFORMAT_COMPRESSED_DXT5_RGBA = 17
PIXELFORMAT_COMPRESSED_ETC1_RGB = 18
PIXELFORMAT_COMPRESSED_ETC2_RGB = 19
PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 20
PIXELFORMAT_COMPRESSED_PVRT_RGB = 21
PIXELFORMAT_COMPRESSED_PVRT_RGBA = 22
PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 23
PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 24
class TextureFilter(IntEnum):
TEXTURE_FILTER_POINT = 0
@ -347,6 +351,16 @@ class GuiTextAlignment(IntEnum):
TEXT_ALIGN_CENTER = 1
TEXT_ALIGN_RIGHT = 2
class GuiTextAlignmentVertical(IntEnum):
TEXT_ALIGN_TOP = 0
TEXT_ALIGN_MIDDLE = 1
TEXT_ALIGN_BOTTOM = 2
class GuiTextWrapMode(IntEnum):
TEXT_WRAP_NONE = 0
TEXT_WRAP_CHAR = 1
TEXT_WRAP_WORD = 2
class GuiControl(IntEnum):
DEFAULT = 0
LABEL = 1
@ -381,13 +395,15 @@ class GuiControlProperty(IntEnum):
BORDER_WIDTH = 12
TEXT_PADDING = 13
TEXT_ALIGNMENT = 14
RESERVED = 15
class GuiDefaultProperty(IntEnum):
TEXT_SIZE = 16
TEXT_SPACING = 17
LINE_COLOR = 18
BACKGROUND_COLOR = 19
TEXT_LINE_SPACING = 20
TEXT_ALIGNMENT_VERTICAL = 21
TEXT_WRAP_MODE = 22
class GuiToggleProperty(IntEnum):
GROUP_PADDING = 16
@ -419,11 +435,7 @@ class GuiDropdownBoxProperty(IntEnum):
DROPDOWN_ITEMS_SPACING = 17
class GuiTextBoxProperty(IntEnum):
TEXT_INNER_PADDING = 16
TEXT_LINES_SPACING = 17
TEXT_ALIGNMENT_VERTICAL = 18
TEXT_MULTILINE = 19
TEXT_WRAP_MODE = 20
TEXT_READONLY = 16
class GuiSpinnerProperty(IntEnum):
SPIN_BUTTON_WIDTH = 16
@ -662,7 +674,7 @@ class GuiIconName(IntEnum):
ICON_REG_EXP = 216
ICON_FOLDER = 217
ICON_FILE = 218
ICON_219 = 219
ICON_SAND_TIMER = 219
ICON_220 = 220
ICON_221 = 221
ICON_222 = 222

5502
raylib/glfw3.h.modified Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,27 +1,35 @@
/*******************************************************************************************
*
* raygui v3.5 - A simple and easy-to-use immediate-mode gui library
* raygui v4.0 - A simple and easy-to-use immediate-mode gui library
*
* DESCRIPTION:
* raygui is a tools-dev-focused immediate-mode-gui library based on raylib but also
* available as a standalone library, as long as input and drawing functions are provided.
*
*
* FEATURES:
* - Immediate-mode gui, minimal retained data
* - +25 controls provided (basic and advanced)
* - Styling system for colors, font and metrics
* - Icons supported, embeds a complete 1-bit icons pack
* - Standalone usage mode option (custom graphics backends)
* - Multiple tools provided for raygui development
*
* - Icons supported, embedded as a 1-bit icons pack
* - Standalone mode option (custom input/graphics backend)
* - Multiple support tools provided for raygui development
*
* POSSIBLE IMPROVEMENTS:
* - Allow some controls to work in exclusive mode: GuiSlider(), GuiScrollBar()
* - Better standalone mode API for easy plug of custom backends
*
* - Externalize required inputs, allow user easier customization
*
* LIMITATIONS:
* - No auto-layout mechanism provided, up to the user to define controls position and size
* - No editable multi-line word-wraped text box supported
* - No auto-layout mechanism, up to the user to define controls position and size
* - Standalone mode requires library modification and some user work to plug another backend
*
* NOTES:
* - WARNING: GuiLoadStyle() and GuiLoadStyle{Custom}() functions, allocate memory for
* font atlas recs and glyphs, freeing that memory is (usually) up to the user,
* no unload function is explicitly provided... but note that GuiLoadStyleDefaulf() unloads
* by default any previously loaded font (texture, recs, glyphs).
* - Global UI alpha (guiAlpha) is applied inside GuiDrawRectangle() and GuiDrawText() functions
*
* CONTROLS PROVIDED:
* # Container/separators Controls
* - WindowBox --> StatusBar, Panel
@ -29,13 +37,15 @@
* - Line
* - Panel --> StatusBar
* - ScrollPanel --> StatusBar
* - TabBar --> Button
*
* # Basic Controls
* - Label
* - Button
* - LabelButton --> Label
* - Button
* - Toggle
* - ToggleGroup --> Toggle
* - ToggleSlider
* - CheckBox
* - ComboBox
* - DropdownBox
@ -105,7 +115,7 @@
* layouts must be defined manually on controls drawing, providing the right bounds Rectangle for it.
*
* TOOL: rGuiLayout is a visual tool to create raygui layouts: github.com/raysan5/rguilayout
*
*
* CONFIGURATION:
* #define RAYGUI_IMPLEMENTATION
* Generates the implementation of the library into the included file.
@ -124,8 +134,54 @@
* Includes custom ricons.h header defining a set of custom icons,
* this file can be generated using rGuiIcons tool
*
* #define RAYGUI_DEBUG_RECS_BOUNDS
* Draw control bounds rectangles for debug
*
* #define RAYGUI_DEBUG_TEXT_BOUNDS
* Draw text bounds rectangles for debug
*
* VERSIONS HISTORY:
* 4.0 (12-Sep-2023) ADDED: GuiToggleSlider()
* ADDED: GuiColorPickerHSV() and GuiColorPanelHSV()
* ADDED: Multiple new icons, mostly compiler related
* ADDED: New DEFAULT properties: TEXT_LINE_SPACING, TEXT_ALIGNMENT_VERTICAL, TEXT_WRAP_MODE
* ADDED: New enum values: GuiTextAlignment, GuiTextAlignmentVertical, GuiTextWrapMode
* ADDED: Support loading styles with custom font charset from external file
* REDESIGNED: GuiTextBox(), support mouse cursor positioning
* REDESIGNED: GuiDrawText(), support multiline and word-wrap modes (read only)
* REDESIGNED: GuiProgressBar() to be more visual, progress affects border color
* REDESIGNED: Global alpha consideration moved to GuiDrawRectangle() and GuiDrawText()
* REDESIGNED: GuiScrollPanel(), get parameters by reference and return result value
* REDESIGNED: GuiToggleGroup(), get parameters by reference and return result value
* REDESIGNED: GuiComboBox(), get parameters by reference and return result value
* REDESIGNED: GuiCheckBox(), get parameters by reference and return result value
* REDESIGNED: GuiSlider(), get parameters by reference and return result value
* REDESIGNED: GuiSliderBar(), get parameters by reference and return result value
* REDESIGNED: GuiProgressBar(), get parameters by reference and return result value
* REDESIGNED: GuiListView(), get parameters by reference and return result value
* REDESIGNED: GuiColorPicker(), get parameters by reference and return result value
* REDESIGNED: GuiColorPanel(), get parameters by reference and return result value
* REDESIGNED: GuiColorBarAlpha(), get parameters by reference and return result value
* REDESIGNED: GuiColorBarHue(), get parameters by reference and return result value
* REDESIGNED: GuiGrid(), get parameters by reference and return result value
* REDESIGNED: GuiGrid(), added extra parameter
* REDESIGNED: GuiListViewEx(), change parameters order
* REDESIGNED: All controls return result as int value
* REVIEWED: GuiScrollPanel() to avoid smallish scroll-bars
* REVIEWED: All examples and specially controls_test_suite
* RENAMED: gui_file_dialog module to gui_window_file_dialog
* UPDATED: All styles to include ISO-8859-15 charset (as much as possible)
*
* 3.6 (10-May-2023) ADDED: New icon: SAND_TIMER
* ADDED: GuiLoadStyleFromMemory() (binary only)
* REVIEWED: GuiScrollBar() horizontal movement key
* REVIEWED: GuiTextBox() crash on cursor movement
* REVIEWED: GuiTextBox(), additional inputs support
* REVIEWED: GuiLabelButton(), avoid text cut
* REVIEWED: GuiTextInputBox(), password input
* REVIEWED: Local GetCodepointNext(), aligned with raylib
* REDESIGNED: GuiSlider*()/GuiScrollBar() to support out-of-bounds
*
* 3.5 (20-Apr-2023) ADDED: GuiTabBar(), based on GuiToggle()
* ADDED: Helper functions to split text in separate lines
* ADDED: Multiple new icons, useful for code editing tools
@ -137,6 +193,7 @@
* REVIEWED: Library header info, more info, better organized
* REDESIGNED: GuiTextBox() to support cursor movement
* REDESIGNED: GuiDrawText() to divide drawing by lines
*
* 3.2 (22-May-2022) RENAMED: Some enum values, for unification, avoiding prefixes
* REMOVED: GuiScrollBar(), only internal
* REDESIGNED: GuiPanel() to support text parameter
@ -146,6 +203,7 @@
* REDESIGNED: GuiColorBarAlpha() to support text parameter
* REDESIGNED: GuiColorBarHue() to support text parameter
* REDESIGNED: GuiTextInputBox() to support password
*
* 3.1 (12-Jan-2022) REVIEWED: Default style for consistency (aligned with rGuiLayout v2.5 tool)
* REVIEWED: GuiLoadStyle() to support compressed font atlas image data and unload previous textures
* REVIEWED: External icons usage logic
@ -153,10 +211,12 @@
* RENAMED: Multiple controls properties definitions to prepend RAYGUI_
* RENAMED: RICON_ references to RAYGUI_ICON_ for library consistency
* Projects updated and multiple tweaks
*
* 3.0 (04-Nov-2021) Integrated ricons data to avoid external file
* REDESIGNED: GuiTextBoxMulti()
* REMOVED: GuiImageButton*()
* Multiple minor tweaks and bugs corrected
*
* 2.9 (17-Mar-2021) REMOVED: Tooltip API
* 2.8 (03-May-2020) Centralized rectangles drawing to GuiDrawRectangle()
* 2.7 (20-Feb-2020) ADDED: Possible tooltips API
@ -166,6 +226,7 @@
* Replaced property INNER_PADDING by TEXT_PADDING, renamed some properties
* ADDED: 8 new custom styles ready to use
* Multiple minor tweaks and bugs corrected
*
* 2.5 (28-May-2019) Implemented extended GuiTextBox(), GuiValueBox(), GuiSpinner()
* 2.3 (29-Apr-2019) ADDED: rIcons auxiliar library and support for it, multiple controls reviewed
* Refactor all controls drawing mechanism to use control state
@ -185,17 +246,43 @@
* 0.8 (27-Aug-2015) Initial release. Implemented by Kevin Gato, Daniel Nicolás and Ramon Santamaria.
*
* DEPENDENCIES:
* raylib 4.5 Inputs reading (keyboard/mouse), shapes drawing, font loading and text drawing
*
* raylib 4.6-dev Inputs reading (keyboard/mouse), shapes drawing, font loading and text drawing
*
* STANDALONE MODE:
* By default raygui depends on raylib mostly for the inputs and the drawing functionality but that dependency can be disabled
* with the config flag RAYGUI_STANDALONE. In that case is up to the user to provide another backend to cover library needs.
*
* The following functions should be redefined for a custom backend:
*
* - Vector2 GetMousePosition(void);
* - float GetMouseWheelMove(void);
* - bool IsMouseButtonDown(int button);
* - bool IsMouseButtonPressed(int button);
* - bool IsMouseButtonReleased(int button);
* - bool IsKeyDown(int key);
* - bool IsKeyPressed(int key);
* - int GetCharPressed(void); // -- GuiTextBox(), GuiValueBox()
*
* - void DrawRectangle(int x, int y, int width, int height, Color color); // -- GuiDrawRectangle()
* - void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); // -- GuiColorPicker()
*
* - Font GetFontDefault(void); // -- GuiLoadStyleDefault()
* - Font LoadFontEx(const char *fileName, int fontSize, int *codepoints, int codepointCount); // -- GuiLoadStyle()
* - Texture2D LoadTextureFromImage(Image image); // -- GuiLoadStyle(), required to load texture from embedded font atlas image
* - void SetShapesTexture(Texture2D tex, Rectangle rec); // -- GuiLoadStyle(), required to set shapes rec to font white rec (optimization)
* - char *LoadFileText(const char *fileName); // -- GuiLoadStyle(), required to load charset data
* - void UnloadFileText(char *text); // -- GuiLoadStyle(), required to unload charset data
* - const char *GetDirectoryPath(const char *filePath); // -- GuiLoadStyle(), required to find charset/font file from text .rgs
* - int *LoadCodepoints(const char *text, int *count); // -- GuiLoadStyle(), required to load required font codepoints list
* - void UnloadCodepoints(int *codepoints); // -- GuiLoadStyle(), required to unload codepoints list
* - unsigned char *DecompressData(const unsigned char *compData, int compDataSize, int *dataSize); // -- GuiLoadStyle()
*
* CONTRIBUTORS:
* Ramon Santamaria: Supervision, review, redesign, update and maintenance
* Vlad Adrian: Complete rewrite of GuiTextBox() to support extended features (2019)
* Sergio Martinez: Review, testing (2015) and redesign of multiple controls (2018)
* Adria Arranz: Testing and Implementation of additional controls (2018)
* Jordi Jorba: Testing and Implementation of additional controls (2018)
* Adria Arranz: Testing and implementation of additional controls (2018)
* Jordi Jorba: Testing and implementation of additional controls (2018)
* Albert Martos: Review and testing of the library (2015)
* Ian Eito: Review and testing of the library (2015)
* Kevin Gato: Initial implementation of basic components (2014)
@ -236,24 +323,51 @@
// NOTE: Some types are required for RAYGUI_STANDALONE usage
//----------------------------------------------------------------------------------
// Style property
// NOTE: Used when exporting style as code for convenience
typedef struct GuiStyleProp {
unsigned short controlId;
unsigned short propertyId;
unsigned int propertyValue;
unsigned short controlId; // Control identifier
unsigned short propertyId; // Property identifier
int propertyValue; // Property value
} GuiStyleProp;
/*
// Controls text style -NOT USED-
// NOTE: Text style is defined by control
typedef struct GuiTextStyle {
unsigned int size;
int charSpacing;
int lineSpacing;
int alignmentH;
int alignmentV;
int padding;
} GuiTextStyle;
*/
// Gui control state
typedef enum {
STATE_NORMAL = 0,
STATE_FOCUSED,
STATE_PRESSED,
STATE_DISABLED,
STATE_DISABLED
} GuiState;
// Gui control text alignment
typedef enum {
TEXT_ALIGN_LEFT = 0,
TEXT_ALIGN_CENTER,
TEXT_ALIGN_RIGHT,
TEXT_ALIGN_RIGHT
} GuiTextAlignment;
// Gui control text alignment vertical
// NOTE: Text vertical position inside the text bounds
typedef enum {
TEXT_ALIGN_TOP = 0,
TEXT_ALIGN_MIDDLE,
TEXT_ALIGN_BOTTOM
} GuiTextAlignmentVertical;
// Gui control text wrap mode
// NOTE: Useful for multiline text
typedef enum {
TEXT_WRAP_NONE = 0,
TEXT_WRAP_CHAR,
TEXT_WRAP_WORD
} GuiTextWrapMode;
// Gui controls
typedef enum {
// Default -> populates to all controls when set
@ -262,7 +376,7 @@ typedef enum {
LABEL, // Used also for: LABELBUTTON
BUTTON,
TOGGLE, // Used also for: TOGGLEGROUP
SLIDER, // Used also for: SLIDERBAR
SLIDER, // Used also for: SLIDERBAR, TOGGLESLIDER
PROGRESSBAR,
CHECKBOX,
COMBOBOX,
@ -278,34 +392,50 @@ typedef enum {
// Gui base properties for every control
// NOTE: RAYGUI_MAX_PROPS_BASE properties (by default 16 properties)
typedef enum {
BORDER_COLOR_NORMAL = 0,
BASE_COLOR_NORMAL,
TEXT_COLOR_NORMAL,
BORDER_COLOR_FOCUSED,
BASE_COLOR_FOCUSED,
TEXT_COLOR_FOCUSED,
BORDER_COLOR_PRESSED,
BASE_COLOR_PRESSED,
TEXT_COLOR_PRESSED,
BORDER_COLOR_DISABLED,
BASE_COLOR_DISABLED,
TEXT_COLOR_DISABLED,
BORDER_WIDTH,
TEXT_PADDING,
TEXT_ALIGNMENT,
RESERVED
BORDER_COLOR_NORMAL = 0, // Control border color in STATE_NORMAL
BASE_COLOR_NORMAL, // Control base color in STATE_NORMAL
TEXT_COLOR_NORMAL, // Control text color in STATE_NORMAL
BORDER_COLOR_FOCUSED, // Control border color in STATE_FOCUSED
BASE_COLOR_FOCUSED, // Control base color in STATE_FOCUSED
TEXT_COLOR_FOCUSED, // Control text color in STATE_FOCUSED
BORDER_COLOR_PRESSED, // Control border color in STATE_PRESSED
BASE_COLOR_PRESSED, // Control base color in STATE_PRESSED
TEXT_COLOR_PRESSED, // Control text color in STATE_PRESSED
BORDER_COLOR_DISABLED, // Control border color in STATE_DISABLED
BASE_COLOR_DISABLED, // Control base color in STATE_DISABLED
TEXT_COLOR_DISABLED, // Control text color in STATE_DISABLED
BORDER_WIDTH, // Control border size, 0 for no border
//TEXT_SIZE, // Control text size (glyphs max height) -> GLOBAL for all controls
//TEXT_SPACING, // Control text spacing between glyphs -> GLOBAL for all controls
//TEXT_LINE_SPACING // Control text spacing between lines -> GLOBAL for all controls
TEXT_PADDING, // Control text padding, not considering border
TEXT_ALIGNMENT, // Control text horizontal alignment inside control text bound (after border and padding)
//TEXT_WRAP_MODE // Control text wrap-mode inside text bounds -> GLOBAL for all controls
} GuiControlProperty;
// TODO: Which text styling properties should be global or per-control?
// At this moment TEXT_PADDING and TEXT_ALIGNMENT is configured and saved per control while
// TEXT_SIZE, TEXT_SPACING, TEXT_LINE_SPACING, TEXT_ALIGNMENT_VERTICAL, TEXT_WRAP_MODE are global and
// should be configured by user as needed while defining the UI layout
// Gui extended properties depend on control
// NOTE: RAYGUI_MAX_PROPS_EXTENDED properties (by default 8 properties)
// NOTE: RAYGUI_MAX_PROPS_EXTENDED properties (by default, max 8 properties)
//----------------------------------------------------------------------------------
// DEFAULT extended properties
// NOTE: Those properties are common to all controls or global
// WARNING: We only have 8 slots for those properties by default!!! -> New global control: TEXT?
typedef enum {
TEXT_SIZE = 16, // Text size (glyphs max height)
TEXT_SPACING, // Text spacing between glyphs
LINE_COLOR, // Line control color
BACKGROUND_COLOR, // Background color
TEXT_LINE_SPACING, // Text spacing between lines
TEXT_ALIGNMENT_VERTICAL, // Text vertical alignment inside text bounds (after border and padding)
TEXT_WRAP_MODE // Text wrap-mode inside text bounds
//TEXT_DECORATION // Text decoration: 0-None, 1-Underline, 2-Line-through, 3-Overline
//TEXT_DECORATION_THICK // Text decoration line thikness
} GuiDefaultProperty;
// Other possible text properties:
// TEXT_WEIGHT // Normal, Italic, Bold -> Requires specific font change
// TEXT_INDENT // Text indentation -> Now using TEXT_PADDING...
// Label
//typedef enum { } GuiLabelProperty;
// Button/Spinner
@ -325,12 +455,12 @@ typedef enum {
} GuiProgressBarProperty;
// ScrollBar
typedef enum {
ARROWS_SIZE = 16,
ARROWS_VISIBLE,
SCROLL_SLIDER_PADDING, // (SLIDERBAR, SLIDER_PADDING)
SCROLL_SLIDER_SIZE,
SCROLL_PADDING,
SCROLL_SPEED,
ARROWS_SIZE = 16, // ScrollBar arrows size
ARROWS_VISIBLE, // ScrollBar arrows visible
SCROLL_SLIDER_PADDING, // ScrollBar slider internal padding
SCROLL_SLIDER_SIZE, // ScrollBar slider size
SCROLL_PADDING, // ScrollBar scroll padding from arrows
SCROLL_SPEED, // ScrollBar scrolling speed
} GuiScrollBarProperty;
// CheckBox
typedef enum {
@ -348,11 +478,7 @@ typedef enum {
} GuiDropdownBoxProperty;
// TextBox/TextBoxMulti/ValueBox/Spinner
typedef enum {
TEXT_INNER_PADDING = 16, // TextBox/TextBoxMulti/ValueBox/Spinner inner text padding
TEXT_LINES_SPACING, // TextBoxMulti lines separation
TEXT_ALIGNMENT_VERTICAL, // TextBoxMulti vertical alignment: 0-CENTERED, 1-UP, 2-DOWN
TEXT_MULTILINE, // TextBox supports multiple lines
TEXT_WRAP_MODE // TextBox wrap mode for multiline: 0-NO_WRAP, 1-CHAR_WRAP, 2-WORD_WRAP
TEXT_READONLY = 16, // TextBox in read-only mode: 0-text editable, 1-text no-editable
} GuiTextBoxProperty;
// Spinner
typedef enum {
@ -364,7 +490,7 @@ typedef enum {
LIST_ITEMS_HEIGHT = 16, // ListView items height
LIST_ITEMS_SPACING, // ListView items separation
SCROLLBAR_WIDTH, // ListView scrollbar size (usually width)
SCROLLBAR_SIDE, // ListView scrollbar side (0-left, 1-right)
SCROLLBAR_SIDE, // ListView scrollbar side (0-SCROLLBAR_LEFT_SIDE, 1-SCROLLBAR_RIGHT_SIDE)
} GuiListViewProperty;
// ColorPicker
typedef enum {
@ -387,7 +513,7 @@ typedef enum {
/* Functions defined as 'extern' by default (implicit specifiers)*/ void GuiLock(void); // Lock gui controls (global state)
/* Functions defined as 'extern' by default (implicit specifiers)*/ void GuiUnlock(void); // Unlock gui controls (global state)
/* Functions defined as 'extern' by default (implicit specifiers)*/ bool GuiIsLocked(void); // Check if gui is locked (global state)
/* Functions defined as 'extern' by default (implicit specifiers)*/ void GuiFade(float alpha); // Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f
/* Functions defined as 'extern' by default (implicit specifiers)*/ void GuiSetAlpha(float alpha); // Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f
/* Functions defined as 'extern' by default (implicit specifiers)*/ void GuiSetState(int state); // Set gui state (global state)
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiGetState(void); // Get gui state (global state)
// Font set/get functions
@ -396,40 +522,6 @@ typedef enum {
// Style set/get functions
/* Functions defined as 'extern' by default (implicit specifiers)*/ void GuiSetStyle(int control, int property, int value); // Set one style property
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiGetStyle(int control, int property); // Get one style property
// Container/separator controls, useful for controls organization
/* Functions defined as 'extern' by default (implicit specifiers)*/ bool GuiWindowBox(Rectangle bounds, const char *title); // Window Box control, shows a window that can be closed
/* Functions defined as 'extern' by default (implicit specifiers)*/ void GuiGroupBox(Rectangle bounds, const char *text); // Group Box control with text name
/* Functions defined as 'extern' by default (implicit specifiers)*/ void GuiLine(Rectangle bounds, const char *text); // Line separator control, could contain text
/* Functions defined as 'extern' by default (implicit specifiers)*/ void GuiPanel(Rectangle bounds, const char *text); // Panel control, useful to group controls
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiTabBar(Rectangle bounds, const char **text, int count, int *active); // Tab Bar control, returns TAB to be closed or -1
/* Functions defined as 'extern' by default (implicit specifiers)*/ Rectangle GuiScrollPanel(Rectangle bounds, const char *text, Rectangle content, Vector2 *scroll); // Scroll Panel control
// Basic controls set
/* Functions defined as 'extern' by default (implicit specifiers)*/ void GuiLabel(Rectangle bounds, const char *text); // Label control, shows text
/* Functions defined as 'extern' by default (implicit specifiers)*/ bool GuiButton(Rectangle bounds, const char *text); // Button control, returns true when clicked
/* Functions defined as 'extern' by default (implicit specifiers)*/ bool GuiLabelButton(Rectangle bounds, const char *text); // Label button control, show true when clicked
/* Functions defined as 'extern' by default (implicit specifiers)*/ bool GuiToggle(Rectangle bounds, const char *text, bool active); // Toggle Button control, returns true when active
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiToggleGroup(Rectangle bounds, const char *text, int active); // Toggle Group control, returns active toggle index
/* Functions defined as 'extern' by default (implicit specifiers)*/ bool GuiCheckBox(Rectangle bounds, const char *text, bool checked); // Check Box control, returns true when active
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiComboBox(Rectangle bounds, const char *text, int active); // Combo Box control, returns selected item index
/* Functions defined as 'extern' by default (implicit specifiers)*/ bool GuiDropdownBox(Rectangle bounds, const char *text, int *active, bool editMode); // Dropdown Box control, returns selected item
/* Functions defined as 'extern' by default (implicit specifiers)*/ bool GuiSpinner(Rectangle bounds, const char *text, int *value, int minValue, int maxValue, bool editMode); // Spinner control, returns selected value
/* Functions defined as 'extern' by default (implicit specifiers)*/ bool GuiValueBox(Rectangle bounds, const char *text, int *value, int minValue, int maxValue, bool editMode); // Value Box control, updates input text with numbers
/* Functions defined as 'extern' by default (implicit specifiers)*/ bool GuiTextBox(Rectangle bounds, char *text, int textSize, bool editMode); // Text Box control, updates input text
/* Functions defined as 'extern' by default (implicit specifiers)*/ float GuiSlider(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue); // Slider control, returns selected value
/* Functions defined as 'extern' by default (implicit specifiers)*/ float GuiSliderBar(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue); // Slider Bar control, returns selected value
/* Functions defined as 'extern' by default (implicit specifiers)*/ float GuiProgressBar(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue); // Progress Bar control, shows current progress value
/* Functions defined as 'extern' by default (implicit specifiers)*/ void GuiStatusBar(Rectangle bounds, const char *text); // Status Bar control, shows info text
/* Functions defined as 'extern' by default (implicit specifiers)*/ void GuiDummyRec(Rectangle bounds, const char *text); // Dummy control for placeholders
/* Functions defined as 'extern' by default (implicit specifiers)*/ Vector2 GuiGrid(Rectangle bounds, const char *text, float spacing, int subdivs); // Grid control, returns mouse cell position
// Advance controls set
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiListView(Rectangle bounds, const char *text, int *scrollIndex, int active); // List View control, returns selected list item index
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiListViewEx(Rectangle bounds, const char **text, int count, int *focus, int *scrollIndex, int active); // List View with extended parameters
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiMessageBox(Rectangle bounds, const char *title, const char *message, const char *buttons); // Message Box control, displays a message
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiTextInputBox(Rectangle bounds, const char *title, const char *message, const char *buttons, char *text, int textMaxSize, int *secretViewActive); // Text Input Box control, ask for text, supports secret
/* Functions defined as 'extern' by default (implicit specifiers)*/ Color GuiColorPicker(Rectangle bounds, const char *text, Color color); // Color Picker control (multiple color controls)
/* Functions defined as 'extern' by default (implicit specifiers)*/ Color GuiColorPanel(Rectangle bounds, const char *text, Color color); // Color Panel control
/* Functions defined as 'extern' by default (implicit specifiers)*/ float GuiColorBarAlpha(Rectangle bounds, const char *text, float alpha); // Color Bar Alpha control
/* Functions defined as 'extern' by default (implicit specifiers)*/ float GuiColorBarHue(Rectangle bounds, const char *text, float value); // Color Bar Hue control
// Styles loading functions
/* Functions defined as 'extern' by default (implicit specifiers)*/ void GuiLoadStyle(const char *fileName); // Load style file over global style variable (.rgs)
/* Functions defined as 'extern' by default (implicit specifiers)*/ void GuiLoadStyleDefault(void); // Load style default over global style
@ -443,6 +535,46 @@ typedef enum {
/* Functions defined as 'extern' by default (implicit specifiers)*/ unsigned int *GuiGetIcons(void); // Get raygui icons data pointer
/* Functions defined as 'extern' by default (implicit specifiers)*/ char **GuiLoadIcons(const char *fileName, bool loadIconsName); // Load raygui icons file (.rgi) into internal icons data
/* Functions defined as 'extern' by default (implicit specifiers)*/ void GuiDrawIcon(int iconId, int posX, int posY, int pixelSize, Color color); // Draw icon using pixel size at specified position
// Controls
//----------------------------------------------------------------------------------------------------------
// Container/separator controls, useful for controls organization
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiWindowBox(Rectangle bounds, const char *title); // Window Box control, shows a window that can be closed
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiGroupBox(Rectangle bounds, const char *text); // Group Box control with text name
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiLine(Rectangle bounds, const char *text); // Line separator control, could contain text
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiPanel(Rectangle bounds, const char *text); // Panel control, useful to group controls
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiTabBar(Rectangle bounds, const char **text, int count, int *active); // Tab Bar control, returns TAB to be closed or -1
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiScrollPanel(Rectangle bounds, const char *text, Rectangle content, Vector2 *scroll, Rectangle *view); // Scroll Panel control
// Basic controls set
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiLabel(Rectangle bounds, const char *text); // Label control, shows text
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiButton(Rectangle bounds, const char *text); // Button control, returns true when clicked
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiLabelButton(Rectangle bounds, const char *text); // Label button control, show true when clicked
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiToggle(Rectangle bounds, const char *text, bool *active); // Toggle Button control, returns true when active
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiToggleGroup(Rectangle bounds, const char *text, int *active); // Toggle Group control, returns active toggle index
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiToggleSlider(Rectangle bounds, const char *text, int *active); // Toggle Slider control, returns true when clicked
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiCheckBox(Rectangle bounds, const char *text, bool *checked); // Check Box control, returns true when active
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiComboBox(Rectangle bounds, const char *text, int *active); // Combo Box control, returns selected item index
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiDropdownBox(Rectangle bounds, const char *text, int *active, bool editMode); // Dropdown Box control, returns selected item
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiSpinner(Rectangle bounds, const char *text, int *value, int minValue, int maxValue, bool editMode); // Spinner control, returns selected value
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiValueBox(Rectangle bounds, const char *text, int *value, int minValue, int maxValue, bool editMode); // Value Box control, updates input text with numbers
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiTextBox(Rectangle bounds, char *text, int textSize, bool editMode); // Text Box control, updates input text
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiSlider(Rectangle bounds, const char *textLeft, const char *textRight, float *value, float minValue, float maxValue); // Slider control, returns selected value
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiSliderBar(Rectangle bounds, const char *textLeft, const char *textRight, float *value, float minValue, float maxValue); // Slider Bar control, returns selected value
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiProgressBar(Rectangle bounds, const char *textLeft, const char *textRight, float *value, float minValue, float maxValue); // Progress Bar control, shows current progress value
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiStatusBar(Rectangle bounds, const char *text); // Status Bar control, shows info text
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiDummyRec(Rectangle bounds, const char *text); // Dummy control for placeholders
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiGrid(Rectangle bounds, const char *text, float spacing, int subdivs, Vector2 *mouseCell); // Grid control, returns mouse cell position
// Advance controls set
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiListView(Rectangle bounds, const char *text, int *scrollIndex, int *active); // List View control, returns selected list item index
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiListViewEx(Rectangle bounds, const char **text, int count, int *scrollIndex, int *active, int *focus); // List View with extended parameters
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiMessageBox(Rectangle bounds, const char *title, const char *message, const char *buttons); // Message Box control, displays a message
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiTextInputBox(Rectangle bounds, const char *title, const char *message, const char *buttons, char *text, int textMaxSize, bool *secretViewActive); // Text Input Box control, ask for text, supports secret
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiColorPicker(Rectangle bounds, const char *text, Color *color); // Color Picker control (multiple color controls)
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiColorPanel(Rectangle bounds, const char *text, Color *color); // Color Panel control
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiColorBarAlpha(Rectangle bounds, const char *text, float *alpha); // Color Bar Alpha control
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiColorBarHue(Rectangle bounds, const char *text, float *value); // Color Bar Hue control
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiColorPickerHSV(Rectangle bounds, const char *text, Vector3 *colorHsv); // Color Picker control that avoids conversion to RGB on each call (multiple color controls)
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiColorPanelHSV(Rectangle bounds, const char *text, Vector3 *colorHsv); // Color Panel control that returns HSV color value, used by GuiColorPickerHSV()
//----------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------
// Icons enumeration
//----------------------------------------------------------------------------------
@ -666,7 +798,7 @@ typedef enum {
ICON_REG_EXP = 216,
ICON_FOLDER = 217,
ICON_FILE = 218,
ICON_219 = 219,
ICON_SAND_TIMER = 219,
ICON_220 = 220,
ICON_221 = 221,
ICON_222 = 222,

View file

@ -1,6 +1,6 @@
/**********************************************************************************************
*
* raylib v4.5 - A simple and easy-to-use library to enjoy videogames programming (www.raylib.com)
* raylib v5.0 - A simple and easy-to-use library to enjoy videogames programming (www.raylib.com)
*
* FEATURES:
* - NO external dependencies, all required libraries included with raylib
@ -84,6 +84,10 @@
// NOTE: Require recompiling raylib sources
// NOTE: MSVC C++ compiler does not support compound literals (C99 feature)
// Plain structures in C++ (without constructors) can be initialized with { }
// This is called aggregate initialization (C++11 feature)
// Some compilers (mostly macos clang) default to C++98,
// where aggregate initialization can't be used
// So, give a more clear error stating how to fix this
// NOTE: We set some defines with some data types declared by raylib
// Other modules (raymath, rlgl) also require some of those types, so,
// to be able to use those other modules as standalone (not depending on raylib)
@ -273,6 +277,7 @@ typedef struct ModelAnimation {
int frameCount; // Number of animation frames
BoneInfo *bones; // Bones information (skeleton)
Transform **framePoses; // Poses array by frame
char name[32]; // Animation name
} ModelAnimation;
// Ray, ray for raycasting
typedef struct Ray {
@ -354,6 +359,18 @@ typedef struct FilePathList {
unsigned int count; // Filepaths entries count
char **paths; // Filepaths entries
} FilePathList;
// Automation event
typedef struct AutomationEvent {
unsigned int frame; // Event frame
unsigned int type; // Event type (AutomationEventType)
int params[4]; // Event parameters (if required)
} AutomationEvent;
// Automation event list
typedef struct AutomationEventList {
unsigned int capacity; // Events max entries (MAX_AUTOMATION_EVENTS)
unsigned int count; // Events entries count
AutomationEvent *events; // Events entries
} AutomationEventList;
//----------------------------------------------------------------------------------
// Enumerators Definition
//----------------------------------------------------------------------------------
@ -374,6 +391,7 @@ typedef enum {
FLAG_WINDOW_TRANSPARENT = 0x00000010, // Set to allow transparent framebuffer
FLAG_WINDOW_HIGHDPI = 0x00002000, // Set to support HighDPI
FLAG_WINDOW_MOUSE_PASSTHROUGH = 0x00004000, // Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED
FLAG_BORDERLESS_WINDOWED_MODE = 0x00008000, // Set to run program in borderless windowed mode
FLAG_MSAA_4X_HINT = 0x00000020, // Set to try enabling MSAA 4X
FLAG_INTERLACED_HINT = 0x00010000 // Set to try enabling interlaced video format (for V3D)
} ConfigFlags;
@ -638,6 +656,9 @@ typedef enum {
PIXELFORMAT_UNCOMPRESSED_R32, // 32 bpp (1 channel - float)
PIXELFORMAT_UNCOMPRESSED_R32G32B32, // 32*3 bpp (3 channels - float)
PIXELFORMAT_UNCOMPRESSED_R32G32B32A32, // 32*4 bpp (4 channels - float)
PIXELFORMAT_UNCOMPRESSED_R16, // 16 bpp (1 channel - half float)
PIXELFORMAT_UNCOMPRESSED_R16G16B16, // 16*3 bpp (3 channels - half float)
PIXELFORMAT_UNCOMPRESSED_R16G16B16A16, // 16*4 bpp (4 channels - half float)
PIXELFORMAT_COMPRESSED_DXT1_RGB, // 4 bpp (no alpha)
PIXELFORMAT_COMPRESSED_DXT1_RGBA, // 4 bpp (1 bit alpha)
PIXELFORMAT_COMPRESSED_DXT3_RGBA, // 8 bpp
@ -731,8 +752,8 @@ typedef enum {
// Callbacks to hook some internal functions
// WARNING: These callbacks are intended for advance users
typedef void (*TraceLogCallback)(int logLevel, const char *text, void * args); // Logging: Redirect trace log messages
typedef unsigned char *(*LoadFileDataCallback)(const char *fileName, unsigned int *bytesRead); // FileIO: Load binary data
typedef bool (*SaveFileDataCallback)(const char *fileName, void *data, unsigned int bytesToWrite); // FileIO: Save binary data
typedef unsigned char *(*LoadFileDataCallback)(const char *fileName, int *dataSize); // FileIO: Load binary data
typedef bool (*SaveFileDataCallback)(const char *fileName, void *data, int dataSize); // FileIO: Save binary data
typedef char *(*LoadFileTextCallback)(const char *fileName); // FileIO: Load text data
typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileIO: Save text data
//------------------------------------------------------------------------------------
@ -744,8 +765,8 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
//------------------------------------------------------------------------------------
// Window-related functions
void InitWindow(int width, int height, const char *title); // Initialize window and OpenGL context
bool WindowShouldClose(void); // Check if KEY_ESCAPE pressed or Close icon pressed
void CloseWindow(void); // Close window and unload OpenGL context
bool WindowShouldClose(void); // Check if application should close (KEY_ESCAPE pressed or windows close icon clicked)
bool IsWindowReady(void); // Check if window has been initialized successfully
bool IsWindowFullscreen(void); // Check if window is currently fullscreen
bool IsWindowHidden(void); // Check if window is currently hidden (only PLATFORM_DESKTOP)
@ -757,17 +778,20 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
void SetWindowState(unsigned int flags); // Set window configuration state using flags (only PLATFORM_DESKTOP)
void ClearWindowState(unsigned int flags); // Clear window configuration state flags
void ToggleFullscreen(void); // Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP)
void ToggleBorderlessWindowed(void); // Toggle window state: borderless windowed (only PLATFORM_DESKTOP)
void MaximizeWindow(void); // Set window state: maximized, if resizable (only PLATFORM_DESKTOP)
void MinimizeWindow(void); // Set window state: minimized, if resizable (only PLATFORM_DESKTOP)
void RestoreWindow(void); // Set window state: not minimized/maximized (only PLATFORM_DESKTOP)
void SetWindowIcon(Image image); // Set icon for window (single image, RGBA 32bit, only PLATFORM_DESKTOP)
void SetWindowIcons(Image *images, int count); // Set icon for window (multiple images, RGBA 32bit, only PLATFORM_DESKTOP)
void SetWindowTitle(const char *title); // Set title for window (only PLATFORM_DESKTOP)
void SetWindowTitle(const char *title); // Set title for window (only PLATFORM_DESKTOP and PLATFORM_WEB)
void SetWindowPosition(int x, int y); // Set window position on screen (only PLATFORM_DESKTOP)
void SetWindowMonitor(int monitor); // Set monitor for the current window (fullscreen mode)
void SetWindowMonitor(int monitor); // Set monitor for the current window
void SetWindowMinSize(int width, int height); // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)
void SetWindowMaxSize(int width, int height); // Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE)
void SetWindowSize(int width, int height); // Set window dimensions
void SetWindowOpacity(float opacity); // Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP)
void SetWindowFocused(void); // Set window focused (only PLATFORM_DESKTOP)
void *GetWindowHandle(void); // Get native window handle
int GetScreenWidth(void); // Get current screen width
int GetScreenHeight(void); // Get current screen height
@ -783,18 +807,11 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
int GetMonitorRefreshRate(int monitor); // Get specified monitor refresh rate
Vector2 GetWindowPosition(void); // Get window position XY on monitor
Vector2 GetWindowScaleDPI(void); // Get window scale DPI factor
const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the primary monitor
const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the specified monitor
void SetClipboardText(const char *text); // Set clipboard text content
const char *GetClipboardText(void); // Get clipboard text content
void EnableEventWaiting(void); // Enable waiting for events on EndDrawing(), no automatic event polling
void DisableEventWaiting(void); // Disable waiting for events on EndDrawing(), automatic events polling
// Custom frame control functions
// NOTE: Those functions are intended for advance users that want full control over the frame processing
// By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timing + PollInputEvents()
// To avoid that behaviour and control frame processes manually, enable in config.h: SUPPORT_CUSTOM_FRAME_CONTROL
void SwapScreenBuffer(void); // Swap back buffer with front buffer (screen drawing)
void PollInputEvents(void); // Register all input events
void WaitTime(double seconds); // Wait for some time (halt program execution)
// Cursor-related functions
void ShowCursor(void); // Shows cursor
void HideCursor(void); // Hides cursor
@ -845,20 +862,32 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera); // Get the screen space position for a 2d camera world space position
// Timing-related functions
void SetTargetFPS(int fps); // Set target FPS (maximum)
int GetFPS(void); // Get current FPS
float GetFrameTime(void); // Get time in seconds for last frame drawn (delta time)
double GetTime(void); // Get elapsed time in seconds since InitWindow()
// Misc. functions
int GetRandomValue(int min, int max); // Get a random value between min and max (both included)
int GetFPS(void); // Get current FPS
// Custom frame control functions
// NOTE: Those functions are intended for advance users that want full control over the frame processing
// By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timing + PollInputEvents()
// To avoid that behaviour and control frame processes manually, enable in config.h: SUPPORT_CUSTOM_FRAME_CONTROL
void SwapScreenBuffer(void); // Swap back buffer with front buffer (screen drawing)
void PollInputEvents(void); // Register all input events
void WaitTime(double seconds); // Wait for some time (halt program execution)
// Random values generation functions
void SetRandomSeed(unsigned int seed); // Set the seed for the random number generator
int GetRandomValue(int min, int max); // Get a random value between min and max (both included)
int *LoadRandomSequence(unsigned int count, int min, int max); // Load random values sequence, no values repeated
void UnloadRandomSequence(int *sequence); // Unload random values sequence
// Misc. functions
void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (filename extension defines format)
void SetConfigFlags(unsigned int flags); // Setup init configuration flags (view FLAGS)
void OpenURL(const char *url); // Open URL with default system browser (if available)
// NOTE: Following functions implemented in module [utils]
//------------------------------------------------------------------
void TraceLog(int logLevel, const char *text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...)
void SetTraceLogLevel(int logLevel); // Set the current threshold (minimum) log level
void *MemAlloc(unsigned int size); // Internal memory allocator
void *MemRealloc(void *ptr, unsigned int size); // Internal memory reallocator
void MemFree(void *ptr); // Internal memory free
void OpenURL(const char *url); // Open URL with default system browser (if available)
// Set custom callbacks
// WARNING: Callbacks setup is intended for advance users
void SetTraceLogCallback(TraceLogCallback callback); // Set custom trace log
@ -867,13 +896,15 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
void SetLoadFileTextCallback(LoadFileTextCallback callback); // Set custom file text data loader
void SetSaveFileTextCallback(SaveFileTextCallback callback); // Set custom file text data saver
// Files management functions
unsigned char *LoadFileData(const char *fileName, unsigned int *bytesRead); // Load file data as byte array (read)
unsigned char *LoadFileData(const char *fileName, int *dataSize); // Load file data as byte array (read)
void UnloadFileData(unsigned char *data); // Unload file data allocated by LoadFileData()
bool SaveFileData(const char *fileName, void *data, unsigned int bytesToWrite); // Save data to file from byte array (write), returns true on success
bool ExportDataAsCode(const unsigned char *data, unsigned int size, const char *fileName); // Export data to code (.h), returns true on success
bool SaveFileData(const char *fileName, void *data, int dataSize); // Save data to file from byte array (write), returns true on success
bool ExportDataAsCode(const unsigned char *data, int dataSize, const char *fileName); // Export data to code (.h), returns true on success
char *LoadFileText(const char *fileName); // Load text data from file (read), returns a '\0' terminated string
void UnloadFileText(char *text); // Unload file text data allocated by LoadFileText()
bool SaveFileText(const char *fileName, char *text); // Save text data to file (write), string must be '\0' terminated, returns true on success
//------------------------------------------------------------------
// File system functions
bool FileExists(const char *fileName); // Check if file exists
bool DirectoryExists(const char *dirPath); // Check if a directory path exists
bool IsFileExtension(const char *fileName, const char *ext); // Check file extension (including point: .png, .wav)
@ -884,7 +915,7 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
const char *GetDirectoryPath(const char *filePath); // Get full path for a given fileName with path (uses static string)
const char *GetPrevDirectoryPath(const char *dirPath); // Get previous directory path for a given path (uses static string)
const char *GetWorkingDirectory(void); // Get current working directory (uses static string)
const char *GetApplicationDirectory(void); // Get the directory if the running application (uses static string)
const char *GetApplicationDirectory(void); // Get the directory of the running application (uses static string)
bool ChangeDirectory(const char *dir); // Change working directory, return true on success
bool IsPathFile(const char *path); // Check if a given path is a file or a directory
FilePathList LoadDirectoryFiles(const char *dirPath); // Load directory filepaths
@ -899,17 +930,27 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
unsigned char *DecompressData(const unsigned char *compData, int compDataSize, int *dataSize); // Decompress data (DEFLATE algorithm), memory must be MemFree()
char *EncodeDataBase64(const unsigned char *data, int dataSize, int *outputSize); // Encode data to Base64 string, memory must be MemFree()
unsigned char *DecodeDataBase64(const unsigned char *data, int *outputSize); // Decode Base64 string data, memory must be MemFree()
// Automation events functionality
AutomationEventList LoadAutomationEventList(const char *fileName); // Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS
void UnloadAutomationEventList(AutomationEventList *list); // Unload automation events list from file
bool ExportAutomationEventList(AutomationEventList list, const char *fileName); // Export automation events list as text file
void SetAutomationEventList(AutomationEventList *list); // Set automation event list to record to
void SetAutomationEventBaseFrame(int frame); // Set automation event internal base frame to start recording
void StartAutomationEventRecording(void); // Start recording automation events (AutomationEventList must be set)
void StopAutomationEventRecording(void); // Stop recording automation events
void PlayAutomationEvent(AutomationEvent event); // Play a recorded automation event
//------------------------------------------------------------------------------------
// Input Handling Functions (Module: core)
//------------------------------------------------------------------------------------
// Input-related functions: keyboard
bool IsKeyPressed(int key); // Check if a key has been pressed once
bool IsKeyPressedRepeat(int key); // Check if a key has been pressed again (Only PLATFORM_DESKTOP)
bool IsKeyDown(int key); // Check if a key is being pressed
bool IsKeyReleased(int key); // Check if a key has been released once
bool IsKeyUp(int key); // Check if a key is NOT being pressed
void SetExitKey(int key); // Set a custom key to exit program (default is ESC)
int GetKeyPressed(void); // Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty
int GetCharPressed(void); // Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty
void SetExitKey(int key); // Set a custom key to exit program (default is ESC)
// Input-related functions: gamepads
bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available
const char *GetGamepadName(int gamepad); // Get gamepad internal name id
@ -946,7 +987,7 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
// Gestures and Touch Handling Functions (Module: rgestures)
//------------------------------------------------------------------------------------
void SetGesturesEnabled(unsigned int flags); // Enable a set of gestures using flags
bool IsGestureDetected(int gesture); // Check if a gesture have been detected
bool IsGestureDetected(unsigned int gesture); // Check if a gesture have been detected
int GetGestureDetected(void); // Get latest detected gesture
float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds
Vector2 GetGestureDragVector(void); // Get gesture drag vector
@ -969,18 +1010,17 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
void DrawPixel(int posX, int posY, Color color); // Draw a pixel
void DrawPixelV(Vector2 position, Color color); // Draw a pixel (Vector version)
void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw a line
void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); // Draw a line (Vector version)
void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line defining thickness
void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line using cubic-bezier curves in-out
void DrawLineBezierQuad(Vector2 startPos, Vector2 endPos, Vector2 controlPos, float thick, Color color); // Draw line using quadratic bezier curves with a control point
void DrawLineBezierCubic(Vector2 startPos, Vector2 endPos, Vector2 startControlPos, Vector2 endControlPos, float thick, Color color); // Draw line using cubic bezier curves with 2 control points
void DrawLineStrip(Vector2 *points, int pointCount, Color color); // Draw lines sequence
void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); // Draw a line (using gl lines)
void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line (using triangles/quads)
void DrawLineStrip(Vector2 *points, int pointCount, Color color); // Draw lines sequence (using gl lines)
void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw line segment cubic-bezier in-out interpolation
void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle
void DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw a piece of a circle
void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw circle sector outline
void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2); // Draw a gradient-filled circle
void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version)
void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline
void DrawCircleLinesV(Vector2 center, float radius, Color color); // Draw circle outline (Vector version)
void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse
void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse outline
void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring
@ -1003,6 +1043,23 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a regular polygon (Vector version)
void DrawPolyLines(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a polygon outline of n sides
void DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, float lineThick, Color color); // Draw a polygon outline of n sides with extended parameters
// Splines drawing functions
void DrawSplineLinear(Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Linear, minimum 2 points
void DrawSplineBasis(Vector2 *points, int pointCount, float thick, Color color); // Draw spline: B-Spline, minimum 4 points
void DrawSplineCatmullRom(Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Catmull-Rom, minimum 4 points
void DrawSplineBezierQuadratic(Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...]
void DrawSplineBezierCubic(Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...]
void DrawSplineSegmentLinear(Vector2 p1, Vector2 p2, float thick, Color color); // Draw spline segment: Linear, 2 points
void DrawSplineSegmentBasis(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color); // Draw spline segment: B-Spline, 4 points
void DrawSplineSegmentCatmullRom(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color); // Draw spline segment: Catmull-Rom, 4 points
void DrawSplineSegmentBezierQuadratic(Vector2 p1, Vector2 c2, Vector2 p3, float thick, Color color); // Draw spline segment: Quadratic Bezier, 2 points, 1 control point
void DrawSplineSegmentBezierCubic(Vector2 p1, Vector2 c2, Vector2 c3, Vector2 p4, float thick, Color color); // Draw spline segment: Cubic Bezier, 2 points, 2 control points
// Spline segment point evaluation functions, for a given t [0.0f .. 1.0f]
Vector2 GetSplinePointLinear(Vector2 startPos, Vector2 endPos, float t); // Get (evaluate) spline point: Linear
Vector2 GetSplinePointBasis(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float t); // Get (evaluate) spline point: B-Spline
Vector2 GetSplinePointCatmullRom(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float t); // Get (evaluate) spline point: Catmull-Rom
Vector2 GetSplinePointBezierQuad(Vector2 p1, Vector2 c2, Vector2 p3, float t); // Get (evaluate) spline point: Quadratic Bezier
Vector2 GetSplinePointBezierCubic(Vector2 p1, Vector2 c2, Vector2 c3, Vector2 p4, float t); // Get (evaluate) spline point: Cubic Bezier
// Basic shapes collision detection functions
bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); // Check collision between two rectangles
bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2); // Check collision between two circles
@ -1021,6 +1078,7 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
// NOTE: These functions do not require GPU access
Image LoadImage(const char *fileName); // Load image from file into CPU memory (RAM)
Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image from RAW file data
Image LoadImageSvg(const char *fileNameOrString, int width, int height); // Load image from SVG file data or string with specified size
Image LoadImageAnim(const char *fileName, int *frames); // Load image sequence from file (frames appended to image.data)
Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load image from memory buffer, fileType refers to extension: i.e. '.png'
Image LoadImageFromTexture(Texture2D texture); // Load image from GPU texture data
@ -1028,12 +1086,13 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
bool IsImageReady(Image image); // Check if an image is ready
void UnloadImage(Image image); // Unload image from CPU memory (RAM)
bool ExportImage(Image image, const char *fileName); // Export image data to file, returns true on success
unsigned char *ExportImageToMemory(Image image, const char *fileType, int *fileSize); // Export image to memory buffer
bool ExportImageAsCode(Image image, const char *fileName); // Export image as code file defining an array of bytes, returns true on success
// Image generation functions
Image GenImageColor(int width, int height, Color color); // Generate image: plain color
Image GenImageGradientV(int width, int height, Color top, Color bottom); // Generate image: vertical gradient
Image GenImageGradientH(int width, int height, Color left, Color right); // Generate image: horizontal gradient
Image GenImageGradientLinear(int width, int height, int direction, Color start, Color end); // Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient
Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer); // Generate image: radial gradient
Image GenImageGradientSquare(int width, int height, float density, Color inner, Color outer); // Generate image: square gradient
Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2); // Generate image: checked
Image GenImageWhiteNoise(int width, int height, float factor); // Generate image: white noise
Image GenImagePerlinNoise(int width, int height, int offsetX, int offsetY, float scale); // Generate image: perlin noise
@ -1059,6 +1118,7 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering)
void ImageFlipVertical(Image *image); // Flip image vertically
void ImageFlipHorizontal(Image *image); // Flip image horizontally
void ImageRotate(Image *image, int degrees); // Rotate image by input angle in degrees (-359 to 359)
void ImageRotateCW(Image *image); // Rotate image clockwise 90deg
void ImageRotateCCW(Image *image); // Rotate image counter-clockwise 90deg
void ImageColorTint(Image *image, Color color); // Modify image color: tint
@ -1136,13 +1196,13 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
// Font loading/unloading functions
Font GetFontDefault(void); // Get the default Font
Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM)
Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int glyphCount); // Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set
Font LoadFontEx(const char *fileName, int fontSize, int *codepoints, int codepointCount); // Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set
Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style)
Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int glyphCount); // Load font from memory buffer, fileType refers to extension: i.e. '.ttf'
Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, int *codepoints, int codepointCount); // Load font from memory buffer, fileType refers to extension: i.e. '.ttf'
bool IsFontReady(Font font); // Check if a font is ready
GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int glyphCount, int type); // Load font data for further use
Image GenImageFontAtlas(const GlyphInfo *chars, Rectangle **recs, int glyphCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info
void UnloadFontData(GlyphInfo *chars, int glyphCount); // Unload font chars info data (RAM)
GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *codepoints, int codepointCount, int type); // Load font data for further use
Image GenImageFontAtlas(const GlyphInfo *glyphs, Rectangle **glyphRecs, int glyphCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info
void UnloadFontData(GlyphInfo *glyphs, int glyphCount); // Unload font chars info data (RAM)
void UnloadFont(Font font); // Unload font from GPU memory (VRAM)
bool ExportFontAsCode(Font font, const char *fileName); // Export font as code file, returns true on success
// Text drawing functions
@ -1151,8 +1211,9 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters
void DrawTextPro(Font font, const char *text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint); // Draw text using Font and pro parameters (rotation)
void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint); // Draw one character (codepoint)
void DrawTextCodepoints(Font font, const int *codepoints, int count, Vector2 position, float fontSize, float spacing, Color tint); // Draw multiple character (codepoint)
void DrawTextCodepoints(Font font, const int *codepoints, int codepointCount, Vector2 position, float fontSize, float spacing, Color tint); // Draw multiple character (codepoint)
// Text font info functions
void SetTextLineSpacing(int spacing); // Set vertical line spacing when drawing with line-breaks
int MeasureText(const char *text, int fontSize); // Measure string width for default font
Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font
int GetGlyphIndex(Font font, int codepoint); // Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found
@ -1257,10 +1318,10 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
void SetMaterialTexture(Material *material, int mapType, Texture2D texture); // Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...)
void SetModelMeshMaterial(Model *model, int meshId, int materialId); // Set material for a mesh
// Model animations loading/unloading functions
ModelAnimation *LoadModelAnimations(const char *fileName, unsigned int *animCount); // Load model animations from file
ModelAnimation *LoadModelAnimations(const char *fileName, int *animCount); // Load model animations from file
void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose
void UnloadModelAnimation(ModelAnimation anim); // Unload animation data
void UnloadModelAnimations(ModelAnimation *animations, unsigned int count); // Unload animation array data
void UnloadModelAnimations(ModelAnimation *animations, int animCount); // Unload animation array data
bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match
// Collision detection functions
bool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, float radius2); // Check collision between two spheres
@ -1280,16 +1341,19 @@ typedef void (*AudioCallback)(void *bufferData, unsigned int frames);
void CloseAudioDevice(void); // Close the audio device and context
bool IsAudioDeviceReady(void); // Check if audio device has been initialized successfully
void SetMasterVolume(float volume); // Set master volume (listener)
float GetMasterVolume(void); // Get master volume (listener)
// Wave/Sound loading/unloading functions
Wave LoadWave(const char *fileName); // Load wave data from file
Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load wave from memory buffer, fileType refers to extension: i.e. '.wav'
bool IsWaveReady(Wave wave); // Checks if wave data is ready
Sound LoadSound(const char *fileName); // Load sound from file
Sound LoadSoundFromWave(Wave wave); // Load sound from wave data
Sound LoadSoundAlias(Sound source); // Create a new sound that shares the same sample data as the source sound, does not own the sound data
bool IsSoundReady(Sound sound); // Checks if a sound is ready
void UpdateSound(Sound sound, const void *data, int sampleCount); // Update sound buffer with new data
void UnloadWave(Wave wave); // Unload wave data
void UnloadSound(Sound sound); // Unload sound
void UnloadSoundAlias(Sound alias); // Unload a sound alias (does not deallocate sample data)
bool ExportWave(Wave wave, const char *fileName); // Export wave data to file, returns true on success
bool ExportWaveAsCode(Wave wave, const char *fileName); // Export wave sample data to code (.h), returns true on success
// Wave/Sound management functions
@ -1339,7 +1403,7 @@ typedef void (*AudioCallback)(void *bufferData, unsigned int frames);
void SetAudioStreamPan(AudioStream stream, float pan); // Set pan for audio stream (0.5 is centered)
void SetAudioStreamBufferSizeDefault(int size); // Default size for new audio streams
void SetAudioStreamCallback(AudioStream stream, AudioCallback callback); // Audio thread callback to request new data
void AttachAudioStreamProcessor(AudioStream stream, AudioCallback processor); // Attach audio stream processor to stream
void AttachAudioStreamProcessor(AudioStream stream, AudioCallback processor); // Attach audio stream processor to stream, receives the samples as <float>s
void DetachAudioStreamProcessor(AudioStream stream, AudioCallback processor); // Detach audio stream processor from stream
void AttachAudioMixedProcessor(AudioCallback processor); // Attach audio stream processor to the entire audio pipeline
void AttachAudioMixedProcessor(AudioCallback processor); // Attach audio stream processor to the entire audio pipeline, receives the samples as <float>s
void DetachAudioMixedProcessor(AudioCallback processor); // Detach audio stream processor from the entire audio pipeline

View file

@ -2,24 +2,29 @@
*
* raymath v1.5 - Math functions to work with Vector2, Vector3, Matrix and Quaternions
*
* CONFIGURATION:
*
* #define RAYMATH_IMPLEMENTATION
* Generates the implementation of the library into the included file.
* If not defined, the library is in header only mode and can be included in other headers
* or source files without problems. But only ONE file should hold the implementation.
*
* #define RAYMATH_STATIC_INLINE
* This may use up lots of memory.
*
* CONVENTIONS:
*
* - Matrix structure is defined as row-major (memory layout) but parameters naming AND all
* math operations performed by the library consider the structure as it was column-major
* It is like transposed versions of the matrices are used for all the maths
* It benefits some functions making them cache-friendly and also avoids matrix
* transpositions sometimes required by OpenGL
* Example: In memory order, row0 is [m0 m4 m8 m12] but in semantic math row0 is [m0 m1 m2 m3]
* - Functions are always self-contained, no function use another raymath function inside,
* required code is directly re-implemented inside
* - Functions input parameters are always received by value (2 unavoidable exceptions)
* - Functions use always a "result" variable for return
* - Functions are always defined inline
* - Angles are always in radians (DEG2RAD/RAD2DEG macros provided for convenience)
* - No compound literals used to make sure libray is compatible with C++
*
* CONFIGURATION:
* #define RAYMATH_IMPLEMENTATION
* Generates the implementation of the library into the included file.
* If not defined, the library is in header only mode and can be included in other headers
* or source files without problems. But only ONE file should hold the implementation.
*
* #define RAYMATH_STATIC_INLINE
* This may use up lots of memory.
*
*
* LICENSE: zlib/libpng
@ -123,7 +128,9 @@ inline /* Functions may be inlined or external definition used*/ float Vector3Di
inline /* Functions may be inlined or external definition used*/ float Vector3Angle(Vector3 v1, Vector3 v2);// Negate provided vector (invert direction)
inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Negate(Vector3 v);// Divide vector by vector
inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Divide(Vector3 v1, Vector3 v2);// Normalize provided vector
inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Normalize(Vector3 v);// Orthonormalize provided vectors
inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Normalize(Vector3 v);//Calculate the projection of the vector v1 on to v2
inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Project(Vector3 v1, Vector3 v2);//Calculate the rejection of the vector v1 on to v2
inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Reject(Vector3 v1, Vector3 v2);// Orthonormalize provided vectors
// Makes vectors normalized and orthogonal to each other
// Gram-Schmidt function implementation
inline /* Functions may be inlined or external definition used*/ void Vector3OrthoNormalize(Vector3 *v1, Vector3 *v2);// Transforms a Vector3 by a given Matrix
@ -143,12 +150,11 @@ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3
// min and max values specified by the given vectors
inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Clamp(Vector3 v, Vector3 min, Vector3 max);// Clamp the magnitude of the vector between two values
inline /* Functions may be inlined or external definition used*/ Vector3 Vector3ClampValue(Vector3 v, float min, float max);// Check whether two given vectors are almost equal
inline /* Functions may be inlined or external definition used*/ int Vector3Equals(Vector3 p, Vector3 q);// Compute the direction of a refracted ray where v specifies the
// normalized direction of the incoming ray, n specifies the
// normalized normal vector of the interface of two optical media,
// and r specifies the ratio of the refractive index of the medium
// from where the ray comes to the refractive index of the medium
// on the other side of the surface
inline /* Functions may be inlined or external definition used*/ int Vector3Equals(Vector3 p, Vector3 q);// Compute the direction of a refracted ray
// v: normalized direction of the incoming ray
// n: normalized normal vector of the interface of two optical media
// r: ratio of the refractive index of the medium from where the ray comes
// to the refractive index of the medium on the other side of the surface
inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Refract(Vector3 v, Vector3 n, float r);//----------------------------------------------------------------------------------
// Module Functions Definition - Matrix math
//----------------------------------------------------------------------------------
@ -178,8 +184,8 @@ inline /* Functions may be inlined or external definition used*/ Matrix MatrixRo
inline /* Functions may be inlined or external definition used*/ Matrix MatrixScale(float x, float y, float z);// Get perspective projection matrix
inline /* Functions may be inlined or external definition used*/ Matrix MatrixFrustum(double left, double right, double bottom, double top, double near, double far);// Get perspective projection matrix
// NOTE: Fovy angle must be provided in radians
inline /* Functions may be inlined or external definition used*/ Matrix MatrixPerspective(double fovy, double aspect, double near, double far);// Get orthographic projection matrix
inline /* Functions may be inlined or external definition used*/ Matrix MatrixOrtho(double left, double right, double bottom, double top, double near, double far);// Get camera look-at matrix (view matrix)
inline /* Functions may be inlined or external definition used*/ Matrix MatrixPerspective(double fovY, double aspect, double nearPlane, double farPlane);// Get orthographic projection matrix
inline /* Functions may be inlined or external definition used*/ Matrix MatrixOrtho(double left, double right, double bottom, double top, double nearPlane, double farPlane);// Get camera look-at matrix (view matrix)
inline /* Functions may be inlined or external definition used*/ Matrix MatrixLookAt(Vector3 eye, Vector3 target, Vector3 up);// Get float array of matrix data
inline /* Functions may be inlined or external definition used*/ float16 MatrixToFloatV(Matrix mat);//----------------------------------------------------------------------------------
// Module Functions Definition - Quaternion math

View file

@ -2,82 +2,83 @@
*
* rlgl v4.5 - A multi-OpenGL abstraction layer with an immediate-mode style API
*
* An abstraction layer for multiple OpenGL versions (1.1, 2.1, 3.3 Core, 4.3 Core, ES 2.0)
* that provides a pseudo-OpenGL 1.1 immediate-mode style API (rlVertex, rlTranslate, rlRotate...)
* DESCRIPTION:
* An abstraction layer for multiple OpenGL versions (1.1, 2.1, 3.3 Core, 4.3 Core, ES 2.0)
* that provides a pseudo-OpenGL 1.1 immediate-mode style API (rlVertex, rlTranslate, rlRotate...)
*
* When choosing an OpenGL backend different than OpenGL 1.1, some internal buffer are
* initialized on rlglInit() to accumulate vertex data.
* ADDITIONAL NOTES:
* When choosing an OpenGL backend different than OpenGL 1.1, some internal buffer are
* initialized on rlglInit() to accumulate vertex data.
*
* When an internal state change is required all the stored vertex data is renderer in batch,
* additionally, rlDrawRenderBatchActive() could be called to force flushing of the batch.
* When an internal state change is required all the stored vertex data is renderer in batch,
* additionally, rlDrawRenderBatchActive() could be called to force flushing of the batch.
*
* Some additional resources are also loaded for convenience, here the complete list:
* - Default batch (RLGL.defaultBatch): RenderBatch system to accumulate vertex data
* - Default texture (RLGL.defaultTextureId): 1x1 white pixel R8G8B8A8
* - Default shader (RLGL.State.defaultShaderId, RLGL.State.defaultShaderLocs)
*
* Internal buffer (and additional resources) must be manually unloaded calling rlglClose().
* Some resources are also loaded for convenience, here the complete list:
* - Default batch (RLGL.defaultBatch): RenderBatch system to accumulate vertex data
* - Default texture (RLGL.defaultTextureId): 1x1 white pixel R8G8B8A8
* - Default shader (RLGL.State.defaultShaderId, RLGL.State.defaultShaderLocs)
*
* Internal buffer (and resources) must be manually unloaded calling rlglClose().
*
* CONFIGURATION:
* #define GRAPHICS_API_OPENGL_11
* #define GRAPHICS_API_OPENGL_21
* #define GRAPHICS_API_OPENGL_33
* #define GRAPHICS_API_OPENGL_43
* #define GRAPHICS_API_OPENGL_ES2
* #define GRAPHICS_API_OPENGL_ES3
* Use selected OpenGL graphics backend, should be supported by platform
* Those preprocessor defines are only used on rlgl module, if OpenGL version is
* required by any other module, use rlGetVersion() to check it
*
* #define GRAPHICS_API_OPENGL_11
* #define GRAPHICS_API_OPENGL_21
* #define GRAPHICS_API_OPENGL_33
* #define GRAPHICS_API_OPENGL_43
* #define GRAPHICS_API_OPENGL_ES2
* Use selected OpenGL graphics backend, should be supported by platform
* Those preprocessor defines are only used on rlgl module, if OpenGL version is
* required by any other module, use rlGetVersion() to check it
* #define RLGL_IMPLEMENTATION
* Generates the implementation of the library into the included file.
* If not defined, the library is in header only mode and can be included in other headers
* or source files without problems. But only ONE file should hold the implementation.
*
* #define RLGL_IMPLEMENTATION
* Generates the implementation of the library into the included file.
* If not defined, the library is in header only mode and can be included in other headers
* or source files without problems. But only ONE file should hold the implementation.
* #define RLGL_RENDER_TEXTURES_HINT
* Enable framebuffer objects (fbo) support (enabled by default)
* Some GPUs could not support them despite the OpenGL version
*
* #define RLGL_RENDER_TEXTURES_HINT
* Enable framebuffer objects (fbo) support (enabled by default)
* Some GPUs could not support them despite the OpenGL version
* #define RLGL_SHOW_GL_DETAILS_INFO
* Show OpenGL extensions and capabilities detailed logs on init
*
* #define RLGL_SHOW_GL_DETAILS_INFO
* Show OpenGL extensions and capabilities detailed logs on init
* #define RLGL_ENABLE_OPENGL_DEBUG_CONTEXT
* Enable debug context (only available on OpenGL 4.3)
*
* #define RLGL_ENABLE_OPENGL_DEBUG_CONTEXT
* Enable debug context (only available on OpenGL 4.3)
* rlgl capabilities could be customized just defining some internal
* values before library inclusion (default values listed):
*
* rlgl capabilities could be customized just defining some internal
* values before library inclusion (default values listed):
* #define RL_DEFAULT_BATCH_BUFFER_ELEMENTS 8192 // Default internal render batch elements limits
* #define RL_DEFAULT_BATCH_BUFFERS 1 // Default number of batch buffers (multi-buffering)
* #define RL_DEFAULT_BATCH_DRAWCALLS 256 // Default number of batch draw calls (by state changes: mode, texture)
* #define RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS 4 // Maximum number of textures units that can be activated on batch drawing (SetShaderValueTexture())
*
* #define RL_DEFAULT_BATCH_BUFFER_ELEMENTS 8192 // Default internal render batch elements limits
* #define RL_DEFAULT_BATCH_BUFFERS 1 // Default number of batch buffers (multi-buffering)
* #define RL_DEFAULT_BATCH_DRAWCALLS 256 // Default number of batch draw calls (by state changes: mode, texture)
* #define RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS 4 // Maximum number of textures units that can be activated on batch drawing (SetShaderValueTexture())
* #define RL_MAX_MATRIX_STACK_SIZE 32 // Maximum size of internal Matrix stack
* #define RL_MAX_SHADER_LOCATIONS 32 // Maximum number of shader locations supported
* #define RL_CULL_DISTANCE_NEAR 0.01 // Default projection matrix near cull distance
* #define RL_CULL_DISTANCE_FAR 1000.0 // Default projection matrix far cull distance
*
* #define RL_MAX_MATRIX_STACK_SIZE 32 // Maximum size of internal Matrix stack
* #define RL_MAX_SHADER_LOCATIONS 32 // Maximum number of shader locations supported
* #define RL_CULL_DISTANCE_NEAR 0.01 // Default projection matrix near cull distance
* #define RL_CULL_DISTANCE_FAR 1000.0 // Default projection matrix far cull distance
* When loading a shader, the following vertex attributes and uniform
* location names are tried to be set automatically:
*
* When loading a shader, the following vertex attribute and uniform
* location names are tried to be set automatically:
*
* #define RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION "vertexPosition" // Bound by default to shader location: 0
* #define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD "vertexTexCoord" // Bound by default to shader location: 1
* #define RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL "vertexNormal" // Bound by default to shader location: 2
* #define RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR "vertexColor" // Bound by default to shader location: 3
* #define RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT "vertexTangent" // Bound by default to shader location: 4
* #define RL_DEFAULT_SHADER_UNIFORM_NAME_MVP "mvp" // model-view-projection matrix
* #define RL_DEFAULT_SHADER_UNIFORM_NAME_VIEW "matView" // view matrix
* #define RL_DEFAULT_SHADER_UNIFORM_NAME_PROJECTION "matProjection" // projection matrix
* #define RL_DEFAULT_SHADER_UNIFORM_NAME_MODEL "matModel" // model matrix
* #define RL_DEFAULT_SHADER_UNIFORM_NAME_NORMAL "matNormal" // normal matrix (transpose(inverse(matModelView))
* #define RL_DEFAULT_SHADER_UNIFORM_NAME_COLOR "colDiffuse" // color diffuse (base tint color, multiplied by texture color)
* #define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE0 "texture0" // texture0 (texture slot active 0)
* #define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE1 "texture1" // texture1 (texture slot active 1)
* #define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE2 "texture2" // texture2 (texture slot active 2)
* #define RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION "vertexPosition" // Bound by default to shader location: 0
* #define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD "vertexTexCoord" // Bound by default to shader location: 1
* #define RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL "vertexNormal" // Bound by default to shader location: 2
* #define RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR "vertexColor" // Bound by default to shader location: 3
* #define RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT "vertexTangent" // Bound by default to shader location: 4
* #define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2 "vertexTexCoord2" // Bound by default to shader location: 5
* #define RL_DEFAULT_SHADER_UNIFORM_NAME_MVP "mvp" // model-view-projection matrix
* #define RL_DEFAULT_SHADER_UNIFORM_NAME_VIEW "matView" // view matrix
* #define RL_DEFAULT_SHADER_UNIFORM_NAME_PROJECTION "matProjection" // projection matrix
* #define RL_DEFAULT_SHADER_UNIFORM_NAME_MODEL "matModel" // model matrix
* #define RL_DEFAULT_SHADER_UNIFORM_NAME_NORMAL "matNormal" // normal matrix (transpose(inverse(matModelView))
* #define RL_DEFAULT_SHADER_UNIFORM_NAME_COLOR "colDiffuse" // color diffuse (base tint color, multiplied by texture color)
* #define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE0 "texture0" // texture0 (texture slot active 0)
* #define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE1 "texture1" // texture1 (texture slot active 1)
* #define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE2 "texture2" // texture2 (texture slot active 2)
*
* DEPENDENCIES:
*
* - OpenGL libraries (depending on platform and OpenGL version selected)
* - GLAD OpenGL extensions loading library (only for OpenGL 3.3 Core, 4.3 Core)
*
@ -112,6 +113,7 @@
// OpenGL 2.1 uses most of OpenGL 3.3 Core functionality
// WARNING: Specific parts are checked with #if defines
// OpenGL 4.3 uses OpenGL 3.3 Core functionality
// OpenGL ES 3.0 uses OpenGL ES 2.0 functionality (and more)
// Support framebuffer objects by default
// NOTE: Some driver implementation do not support it, despite they should
//----------------------------------------------------------------------------------
@ -173,7 +175,8 @@ typedef enum {
RL_OPENGL_21, // OpenGL 2.1 (GLSL 120)
RL_OPENGL_33, // OpenGL 3.3 (GLSL 330)
RL_OPENGL_43, // OpenGL 4.3 (using GLSL 330)
RL_OPENGL_ES_20 // OpenGL ES 2.0 (GLSL 100)
RL_OPENGL_ES_20, // OpenGL ES 2.0 (GLSL 100)
RL_OPENGL_ES_30 // OpenGL ES 3.0 (GLSL 300 es)
} rlGlVersion;
// Trace log level
// NOTE: Organized by priority level
@ -200,6 +203,9 @@ typedef enum {
RL_PIXELFORMAT_UNCOMPRESSED_R32, // 32 bpp (1 channel - float)
RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32, // 32*3 bpp (3 channels - float)
RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32A32, // 32*4 bpp (4 channels - float)
RL_PIXELFORMAT_UNCOMPRESSED_R16, // 16 bpp (1 channel - half float)
RL_PIXELFORMAT_UNCOMPRESSED_R16G16B16, // 16*3 bpp (3 channels - half float)
RL_PIXELFORMAT_UNCOMPRESSED_R16G16B16A16, // 16*4 bpp (4 channels - half float)
RL_PIXELFORMAT_COMPRESSED_DXT1_RGB, // 4 bpp (no alpha)
RL_PIXELFORMAT_COMPRESSED_DXT1_RGBA, // 4 bpp (1 bit alpha)
RL_PIXELFORMAT_COMPRESSED_DXT3_RGBA, // 8 bpp
@ -286,24 +292,24 @@ typedef enum {
// NOTE: By default up to 8 color channels defined, but it can be more
typedef enum {
RL_ATTACHMENT_COLOR_CHANNEL0 = 0, // Framebuffer attachment type: color 0
RL_ATTACHMENT_COLOR_CHANNEL1, // Framebuffer attachment type: color 1
RL_ATTACHMENT_COLOR_CHANNEL2, // Framebuffer attachment type: color 2
RL_ATTACHMENT_COLOR_CHANNEL3, // Framebuffer attachment type: color 3
RL_ATTACHMENT_COLOR_CHANNEL4, // Framebuffer attachment type: color 4
RL_ATTACHMENT_COLOR_CHANNEL5, // Framebuffer attachment type: color 5
RL_ATTACHMENT_COLOR_CHANNEL6, // Framebuffer attachment type: color 6
RL_ATTACHMENT_COLOR_CHANNEL7, // Framebuffer attachment type: color 7
RL_ATTACHMENT_COLOR_CHANNEL1 = 1, // Framebuffer attachment type: color 1
RL_ATTACHMENT_COLOR_CHANNEL2 = 2, // Framebuffer attachment type: color 2
RL_ATTACHMENT_COLOR_CHANNEL3 = 3, // Framebuffer attachment type: color 3
RL_ATTACHMENT_COLOR_CHANNEL4 = 4, // Framebuffer attachment type: color 4
RL_ATTACHMENT_COLOR_CHANNEL5 = 5, // Framebuffer attachment type: color 5
RL_ATTACHMENT_COLOR_CHANNEL6 = 6, // Framebuffer attachment type: color 6
RL_ATTACHMENT_COLOR_CHANNEL7 = 7, // Framebuffer attachment type: color 7
RL_ATTACHMENT_DEPTH = 100, // Framebuffer attachment type: depth
RL_ATTACHMENT_STENCIL = 200, // Framebuffer attachment type: stencil
} rlFramebufferAttachType;
// Framebuffer texture attachment type
typedef enum {
RL_ATTACHMENT_CUBEMAP_POSITIVE_X = 0, // Framebuffer texture attachment type: cubemap, +X side
RL_ATTACHMENT_CUBEMAP_NEGATIVE_X, // Framebuffer texture attachment type: cubemap, -X side
RL_ATTACHMENT_CUBEMAP_POSITIVE_Y, // Framebuffer texture attachment type: cubemap, +Y side
RL_ATTACHMENT_CUBEMAP_NEGATIVE_Y, // Framebuffer texture attachment type: cubemap, -Y side
RL_ATTACHMENT_CUBEMAP_POSITIVE_Z, // Framebuffer texture attachment type: cubemap, +Z side
RL_ATTACHMENT_CUBEMAP_NEGATIVE_Z, // Framebuffer texture attachment type: cubemap, -Z side
RL_ATTACHMENT_CUBEMAP_NEGATIVE_X = 1, // Framebuffer texture attachment type: cubemap, -X side
RL_ATTACHMENT_CUBEMAP_POSITIVE_Y = 2, // Framebuffer texture attachment type: cubemap, +Y side
RL_ATTACHMENT_CUBEMAP_NEGATIVE_Y = 3, // Framebuffer texture attachment type: cubemap, -Y side
RL_ATTACHMENT_CUBEMAP_POSITIVE_Z = 4, // Framebuffer texture attachment type: cubemap, +Z side
RL_ATTACHMENT_CUBEMAP_NEGATIVE_Z = 5, // Framebuffer texture attachment type: cubemap, -Z side
RL_ATTACHMENT_TEXTURE2D = 100, // Framebuffer texture attachment type: texture2d
RL_ATTACHMENT_RENDERBUFFER = 200, // Framebuffer texture attachment type: renderbuffer
} rlFramebufferAttachTextureType;
@ -368,6 +374,7 @@ typedef enum {
void rlEnableFramebuffer(unsigned int id); // Enable render texture (fbo)
void rlDisableFramebuffer(void); // Disable render texture (fbo), return to default framebuffer
void rlActiveDrawBuffers(int count); // Activate multiple draw color buffers
void rlBlitFramebuffer(int srcX, int srcY, int srcWidth, int srcHeight, int dstX, int dstY, int dstWidth, int dstHeight, int bufferMask); // Blit active framebuffer to main framebuffer
// General render state
void rlEnableColorBlend(void); // Enable color blending
void rlDisableColorBlend(void); // Disable color blending
@ -382,7 +389,8 @@ typedef enum {
void rlDisableScissorTest(void); // Disable scissor test
void rlScissor(int x, int y, int width, int height); // Scissor test
void rlEnableWireMode(void); // Enable wire mode
void rlDisableWireMode(void); // Disable wire mode
void rlEnablePointMode(void); // Enable point mode
void rlDisableWireMode(void); // Disable wire mode ( and point ) maybe rename
void rlSetLineWidth(float width); // Set the line drawing width
float rlGetLineWidth(void); // Get the line drawing width
void rlEnableSmoothLines(void); // Enable line aliasing

View file

@ -1 +1 @@
__version__ = "4.5.0.1"
__version__ = "5.0.0"