Sdl backend (#140)

* latest raylib version

* add libwayland-dev

* update headers

* add libxkbcommon-dev

* sdl

* sdl dl

* sdl dl

* sdl2 link flags

* remove glfw header

* try static sdl build

* try to set fpic

* install alsa etc before building sdl

* windows

* fix

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try mac

* try mac

* try mac

* try mac

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* update raylib

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* try

* update to 5.5

* dont link x11 if using DRM

* update to fixed raylib version
This commit is contained in:
Richard Smith 2024-11-19 12:05:28 +00:00 committed by GitHub
parent d28fa38e9f
commit 9e5c9b7f9f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
46 changed files with 4069 additions and 1472 deletions

View file

@ -4,21 +4,45 @@
pi_task:
arm_container:
matrix:
- image: dtcooper/raspberrypi-os:python-bullseye
- image: dtcooper/raspberrypi-os:python3.12-bullseye
- image: dtcooper/raspberrypi-os:python3.11-bullseye
- image: dtcooper/raspberrypi-os:python3.10-bullseye
- image: dtcooper/raspberrypi-os:python3.9-bullseye
env:
matrix:
- RAYLIB_PLATFORM: "Desktop"
RAYLIB_OPENGL: "2.1"
- RAYLIB_PLATFORM: "SDL"
RAYLIB_OPENGL: "2.1"
- RAYLIB_PLATFORM: "DRM"
RAYLIB_OPENGL: "ES 2.0"
setup_script:
- apt update
- apt -y install cmake libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev
- apt -y install cmake libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev libwayland-dev libxkbcommon-dev libgbm-dev libdrm-dev
build_sdl_script:
- wget https://github.com/libsdl-org/SDL/archive/refs/tags/release-2.30.7.tar.gz
- tar xvfz release-2.30.7.tar.gz
- mkdir buildsdl
- cd buildsdl
- cmake ../SDL-release-2.30.7 -DSDL_SHARED=OFF -DSDL_STATIC=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release
- cmake --build . --config Release
- cmake --install .
- cd ..
build_raylib_script:
- git submodule update --init --recursive
- cd raylib-c
- mkdir build
- cd build
- cmake -DPLATFORM="Desktop" -DOPENGL_VERSION=2.1 -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release ..
- cmake -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release ..
- make -j2
- make install
build_raylib_again_script:
- cd raylib-c
- mkdir build2
- cd build2
- cmake -DPLATFORM=${RAYLIB_PLATFORM} -DOPENGL_VERSION="${RAYLIB_OPENGL}" -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release ..
- make -j2
- cp raylib/libraylib.a /usr/local/lib/libraylib.a
build_script:
- cp -r raylib-c/src/external/glfw/include/GLFW /usr/local/include/
- cp physac/src/physac.h /usr/local/include/
@ -28,6 +52,18 @@ pi_task:
- python -m pip install --break-system-packages setuptools
- python -m pip install --break-system-packages wheel
- python setup.py bdist_wheel --plat-name manylinux2014_aarch64
test_script:
- python -m pip install --break-system-packages dist/*.whl
- cd /
- python -c 'import pyray; pyray.init_window(100,100,"test")' >/tmp/output 2>&1 || true
- cat /tmp/output
- if grep -q "INFO: Initializing raylib" /tmp/output; then
- echo "Passed"
- exit 0
- else
- echo "Failed"
- exit 1
- fi
artifacts:
path: "dist/*"
@ -36,14 +72,46 @@ mac_task:
matrix:
- image: ghcr.io/cirruslabs/macos-sonoma-xcode:latest
env:
matrix:
- PY_VER: "3.9"
- PY_VER: "3.10"
- PY_VER: "3.11"
- PY_VER: "3.12"
MACOSX_DEPLOYMENT_TARGET: "11.0"
matrix:
- env:
PY_VER: "3.9"
RAYLIB_PLATFORM: Desktop
- env:
PY_VER: "3.9"
RAYLIB_PLATFORM: SDL
- env:
PY_VER: "3.10"
RAYLIB_PLATFORM: Desktop
- env:
PY_VER: "3.10"
RAYLIB_PLATFORM: SDL
- env:
PY_VER: "3.11"
RAYLIB_PLATFORM: Desktop
- env:
PY_VER: "3.12"
RAYLIB_PLATFORM: SDL
- env:
PY_VER: "3.13"
RAYLIB_PLATFORM: Desktop
- env:
PY_VER: "3.13"
RAYLIB_PLATFORM: SDL
setup_script:
- brew update
- brew install python@${PY_VER}
build_sdl_script:
- wget https://github.com/libsdl-org/SDL/archive/refs/tags/release-2.30.7.tar.gz
- tar xvfz release-2.30.7.tar.gz
- mkdir buildsdl
- cd buildsdl
- cmake ../SDL-release-2.30.7 -DSDL_SHARED=OFF -DSDL_STATIC=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release
- cmake --build . --config Release
- sudo cmake --install .
- cd ..
build_raylib_script:
- git submodule update --init --recursive
- cd raylib-c
@ -52,6 +120,13 @@ mac_task:
- cmake -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release ..
- make -j8
- sudo make install
build_raylib_again_script:
- cd raylib-c
- mkdir build2
- cd build2
- cmake -DPLATFORM=${RAYLIB_PLATFORM} -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release ..
- make -j8
- sudo cp raylib/libraylib.a /usr/local/lib/libraylib.a
build_script:
- sudo cp -r raylib-c/src/external/glfw/include/GLFW /usr/local/include/
- sudo cp physac/src/physac.h /usr/local/include/
@ -61,5 +136,17 @@ mac_task:
- /opt/homebrew/bin/python${PY_VER} -m pip install --break-system-packages setuptools
- /opt/homebrew/bin/python${PY_VER} -m pip install --break-system-packages wheel
- /opt/homebrew/bin/python${PY_VER} setup.py bdist_wheel
test_script:
- /opt/homebrew/bin/python${PY_VER} -m pip install --break-system-packages dist/*.whl
- cd /
- /opt/homebrew/bin/python${PY_VER} -c 'import pyray; pyray.init_window(100,100,"test")' >/tmp/output 2>&1 || true
- cat /tmp/output
- if grep -q "INFO: Initializing raylib" /tmp/output; then
- echo "Passed"
- exit 0
- else
- echo "Failed"
- exit 1
- fi
artifacts:
path: "dist/*"

View file

@ -4,28 +4,39 @@ name: Build
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build-mac:
build-mac-intel:
runs-on: macos-12
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12', '3.13.0-beta - 3.13.0', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10' ]
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.9', 'pypy-3.10' ]
raylib-platform: ['Desktop', 'SDL']
env:
MACOSX_DEPLOYMENT_TARGET: '10.13'
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build SDL
run: |
wget https://github.com/libsdl-org/SDL/archive/refs/tags/release-2.30.7.tar.gz
tar xvfz release-2.30.7.tar.gz
mkdir build
cd build
cmake ../SDL-release-2.30.7 -DSDL_SHARED=OFF -DSDL_STATIC=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
sudo cmake --install .
- name: Setup Python
uses: actions/setup-python@v2.2.2
uses: actions/setup-python@v5
with:
# Version range or exact version of a Python version to use, using SemVer's version range syntax.
python-version: ${{ matrix.python-version }}
@ -33,7 +44,7 @@ jobs:
architecture: x64
# Runs a set of commands using the runners shell
- name: Build raylib
- name: Build raylib without SDL because SDL version has incorrect pkg-config
run: |
cd raylib-c
mkdir build
@ -42,6 +53,15 @@ jobs:
make -j2
sudo make install
- name: Build raylib with SDL if selected
run: |
cd raylib-c
mkdir build2
cd build2
cmake -DPLATFORM=${{ matrix.raylib-platform }} -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release ..
make -j2
sudo cp raylib/libraylib.a /usr/local/lib/libraylib.a
- name: Copy extras
run: |
sudo cp -r raylib-c/src/external/glfw/include/GLFW /usr/local/include/
@ -49,12 +69,28 @@ jobs:
sudo cp raygui/src/raygui.h /usr/local/include/
- name: Build raylib-python-cffi
env:
RAYLIB_PLATFORM: ${{ matrix.raylib-platform }}
run: |
python -m pip install --upgrade pip
pip3 install "cffi>=1.17.1"
pip3 install wheel
pip3 install setuptools
python setup.py bdist_wheel --plat-name macosx_10_15_x86_64
python setup.py bdist_wheel --plat-name macosx_10_13_x86_64
- name: Test
run: |
pip3 install dist/*.whl
cd /
python3 -c 'import pyray; pyray.init_window(100,100,"test")' >/tmp/output 2>&1 || true
cat /tmp/output
if grep -q "INFO: Initializing raylib" /tmp/output; then
echo "Passed"
exit 0
else
echo "Failed"
exit 1
fi
- name: Upload build Artifact wheel
uses: actions/upload-artifact@v3.2.1
@ -62,37 +98,76 @@ jobs:
name: wheel
path: dist/*
# build-mac12-arm64:
# runs-on: macos-12
# build-mac-universal:
# runs-on: macos-14
# strategy:
# matrix:
# python-version: ['3.10', '3.11.0-alpha - 3.11.0' ]
# # Requires universal2 build of python, which we get if we ask for 3.10.5 x86! Pypy not available in universal2
# python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10' ]
# raylib-platform: ['Desktop', 'SDL']
# env:
# MACOSX_DEPLOYMENT_TARGET: 11.0
# steps:
# - uses: actions/checkout@v2
# # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
# - uses: actions/checkout@v4
# with:
# submodules: recursive
#
# - name: Setup Python
# uses: actions/setup-python@v2.2.2
# with:
# python-version: ${{ matrix.python-version }}
# architecture: x64
# - name: Build SDL
# run: |
# wget https://github.com/libsdl-org/SDL/archive/refs/tags/release-2.30.7.tar.gz
# tar xvfz release-2.30.7.tar.gz
# mkdir build
# cd build
# cmake ../SDL-release-2.30.7 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DSDL_SHARED=OFF -DSDL_STATIC=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release
# cmake --build . --config Release
# sudo cmake --install .
#
# # Only build raylib for arm64 (although we could make a fat universal2 binary by asking for x86_64 as well)
# - name: Build raylib
# - name: Setup Python
# uses: actions/setup-python@v5
# with:
# # Version range or exact version of a Python version to use, using SemVer's version range syntax.
# python-version: ${{ matrix.python-version }}
# architecture: arm64
#
# # Runs a set of commands using the runners shell
# - name: Build raylib without SDL because SDL version has incorrect pkg-config
# run: |
# cd raylib-c
# mkdir build
# cd build
# cmake -DBUILD_EXAMPLES=off -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DINCLUDE_EVERYTHING=on -DSUPPORT_FILEFORMAT_JPG=on -DWITH_PIC=on -DCMAKE_BUILD_TYPE=Release ..
# cmake -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release ..
# make -j2
# sudo make install
#
# - name: Build raylib with SDL if selected
# run: |
# cd raylib-c
# mkdir build2
# cd build2
# cmake -DPLATFORM=${{ matrix.raylib-platform }} -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DPLATFORM=SDL -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release ..
# make -j2
# sudo cp raylib/libraylib.a /usr/local/lib/libraylib.a
#
# - 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
# run: |
# python -m pip install --upgrade pip
# pip3 install "cffi>=1.17.1"
# pip3 install wheel
# pip3 install setuptools
# RAYLIB_PLATFORM=${{ matrix.raylib-platform }} python setup.py bdist_wheel
#
# - name: Upload build Artifact wheel
# uses: actions/upload-artifact@v3.2.1
# with:
# name: wheel
# path: dist/*
#
# # Name defaults to universal2 and it technically is, but we override name to arm64. Why don't we make a working universal2 wheel? Because
# # I'd rather have a separate x86_64 that I can test, and I want it to work on 10_15 but I'm not sure a 'macosx_10_15_universal2' is valid
@ -103,62 +178,7 @@ jobs:
# pip3 install cffi
# pip3 install wheel
# python setup.py bdist_wheel --plat-name macosx_12_0_arm64
#
#
# - name: Upload build Artifact wheel
# uses: actions/upload-artifact@v3.2.1
# with:
# name: wheel
# path: dist/*
#
#
# build-mac11-arm64:
# runs-on: macos-11
# strategy:
# matrix:
# python-version: [ '3.10.5' ]
# # Requires universal2 build of python, which we get if we ask for 3.10.5 x86! Pypy not available in universal2
# env:
# MACOSX_DEPLOYMENT_TARGET: 11.6
# steps:
# - uses: actions/checkout@v2
# with:
# submodules: recursive
#
# - name: Setup Python
# uses: actions/setup-python@v2.2.2
# with:
# python-version: ${{ matrix.python-version }}
# architecture: x64
#
# # build raylib for arm64 and x86_64 as well
# - name: Build raylib
# run: |
# cd raylib-c
# mkdir build
# cd build
# cmake -DBUILD_EXAMPLES=off -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DINCLUDE_EVERYTHING=on -DSUPPORT_FILEFORMAT_JPG=on -DWITH_PIC=on -DCMAKE_BUILD_TYPE=Release ..
# make -j2
# sudo make install
# - name: Copy extras
# run: |
# sudo cp physac/src/physac.h /usr/local/include/
# sudo cp raygui/src/raygui.h /usr/local/include/
#
#
# - name: Build raylib-python-cffi
# run: |
# python -m pip install --upgrade pip
# pip3 install cffi
# pip3 install wheel
# python setup.py bdist_wheel --plat-name macosx_11_0_arm64
#
# - name: Upload build Artifact wheel
# uses: actions/upload-artifact@v3.2.1
# with:
# name: wheel
# path: dist/*
#
build-linux:
@ -167,30 +187,43 @@ jobs:
# You can use PyPy versions in python-version.
# For example, pypy2 and pypy3
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12', '3.13.0-beta - 3.13.0', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10' ]
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.9', 'pypy-3.10' ]
raylib-platform: ['Desktop', 'SDL', 'DRM']
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v2.2.2
uses: actions/setup-python@v5
with:
# Version range or exact version of a Python version to use, using SemVer's version range syntax.
python-version: ${{ matrix.python-version }}
# The target architecture (x86, x64) of the Python interpreter.
architecture: x64
- name: install prereqs
run: |
sudo apt update
sudo apt install libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev libwayland-dev libxkbcommon-dev
- name: Build SDL
run: |
wget https://github.com/libsdl-org/SDL/archive/refs/tags/release-2.30.7.tar.gz
tar xvfz release-2.30.7.tar.gz
mkdir build
cd build
cmake ../SDL-release-2.30.7 -DSDL_SHARED=OFF -DSDL_STATIC=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
sudo cmake --install .
# Runs a set of commands using the runners shell
- name: Build raylib
run: |
sudo apt update
sudo apt install libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev
cd raylib-c
mkdir build
cd build
cmake -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release -DOpenGL_GL_PREFERENCE=GLVND ..
cmake -DPLATFORM=${{ matrix.raylib-platform }} -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release -DOpenGL_GL_PREFERENCE=GLVND ..
make -j2
sudo make install
- name: Copy extras
@ -199,12 +232,28 @@ jobs:
sudo cp physac/src/physac.h /usr/local/include/
sudo cp raygui/src/raygui.h /usr/local/include/
- name: Build raylib-python-cffi
env:
RAYLIB_PLATFORM: ${{ matrix.raylib-platform }}
run: |
python -m pip install --upgrade pip
pip3 install "cffi>=1.17.1"
pip3 install wheel
pip3 install setuptools
python setup.py bdist_wheel --plat-name manylinux2014_x86_64
- name: Test
run: |
pip3 install dist/*.whl
cd /
python3 -c 'import pyray; pyray.init_window(100,100,"test")' >/tmp/output 2>&1 || true
cat /tmp/output
if grep -q "INFO: Initializing raylib" /tmp/output; then
echo "Passed"
exit 0
else
echo "Failed"
exit 1
fi
- name: Upload build Artifact wheel
uses: actions/upload-artifact@v3.2.1
@ -213,36 +262,7 @@ jobs:
path: dist/*
# build-rpi:
# runs-on: rpi
# steps:
# # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
# - uses: actions/checkout@v2
# with:
# submodules: recursive
#
# - name: Build raylib
# run: |
# cd raylib-c
# mkdir build
# cd build
# cmake -DBUILD_EXAMPLES=off -DINCLUDE_EVERYTHING=on -DSUPPORT_FILEFORMAT_JPG=on -DWITH_PIC=on -DCMAKE_BUILD_TYPE=Release -DOpenGL_GL_PREFERENCE=GLVND ..
# make -j2
# make install
# - name: Copy extras
# run: |
# cp physac/src/physac.h /usr/local/include/
# cp raygui/src/raygui.h /usr/local/include/
#
# - name: Build raylib-python-cffi
# run: |
# python3 setup.py bdist_wheel
#
# - name: Upload build Artifact wheel
# uses: actions/upload-artifact@v3.2.1
# with:
# name: wheel
# path: dist/*
build-windows:
# The type of runner that the job will run on
@ -251,15 +271,27 @@ jobs:
# You can use PyPy versions in python-version.
# For example, pypy2 and pypy3
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12', '3.13.0-beta - 3.13.0', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10' ]
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.9', 'pypy-3.10' ]
raylib-platform: ['Desktop', 'SDL']
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Download SDL2
run: curl -L -o SDL2.zip https://github.com/libsdl-org/SDL/releases/download/release-2.30.8/SDL2-devel-2.30.8-VC.zip
- name: Create extraction directory
run: mkdir ${{ runner.temp }}\SDL2
- name: Unzip SDL2
run: tar -xf SDL2.zip -C ${{ runner.temp }}\SDL2 --strip-components=1
- name: Set SDL2_DIR environment variable
run: echo SDL2_DIR=${{ runner.temp }}\SDL2\cmake >> $env:GITHUB_ENV
- name: Setup Python
uses: actions/setup-python@v2.2.2
uses: actions/setup-python@v5
with:
# Version range or exact version of a Python version to use, using SemVer's version range syntax.
python-version: ${{ matrix.python-version }}
@ -274,14 +306,18 @@ jobs:
cd raylib-c
mkdir build
cd build
cmake -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release ..
cmake -DPLATFORM=${{ matrix.raylib-platform }} -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release ..
msbuild raylib.sln /target:raylib /property:Configuration=Release
copy raylib\Release\raylib.lib ..\..
cd ..\..
shell: cmd
- name: Build raylib-python-cffi
env:
RAYLIB_PLATFORM: ${{ matrix.raylib-platform }}
run: |
copy ${{ runner.temp }}\SDL2\lib\x64\SDL2.lib .
copy ${{ runner.temp }}\SDL2\lib\x64\SDL2.dll raylib\
python -m pip install --upgrade pip
pip3 install "cffi>=1.17.1"
pip3 install wheel
@ -292,6 +328,21 @@ jobs:
del raylib\dynamic\32bit\* >nul 2>&1
python setup.py bdist_wheel
shell: cmd
- name: Test
shell: bash
run: |
pip3 install --no-deps dist/*.whl
cd /
python3 -c 'import pyray; pyray.init_window(100,100,"test")' >/tmp/output 2>&1 || true
cat /tmp/output
if grep -q "INFO: Initializing raylib" /tmp/output; then
echo "Passed"
exit 0
else
echo "Failed"
exit 1
fi
- name: Upload build Artifact wheel
uses: actions/upload-artifact@v3.2.1
@ -304,12 +355,12 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v2.2.2
uses: actions/setup-python@v5
with:
# Version range or exact version of a Python version to use, using SemVer's version range syntax.
python-version: '3.12'
@ -319,7 +370,7 @@ jobs:
- name: Build raylib
run: |
sudo apt update
sudo apt install libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev
sudo apt install libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev libwayland-dev libxkbcommon-dev
cd raylib-c
mkdir build
cd build
@ -351,12 +402,12 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v2.2.2
uses: actions/setup-python@v5
with:
# Version range or exact version of a Python version to use, using SemVer's version range syntax.
python-version: '3.12'

View file

@ -38,7 +38,7 @@ project.
If the Pip build doesnt work, please submit a bug. (And if you have
fixed it, a PR.)
Manual instructions follow, but may be outdated, so see also how we actually build the wheels
Manual instructions follow, but are probably outdated, so see instead how we actually build the wheels
at https://github.com/electronstudio/raylib-python-cffi/blob/master/.github/workflows/build.yml
Windows manual build

View file

@ -2,6 +2,7 @@ include raylib/*.so
include raylib/*.pyi
include pyray/*.pyi
include raylib/*.pyd
include raylib/*.dll
exclude raylib/*.a
include raylib/*.h
include raylib/*.h.modified

102
README.md
View file

@ -1,6 +1,8 @@
# Python Bindings for Raylib 5.0
# Python Bindings for Raylib 5.5
## Libraries: raymath, raygui, rlgl, physac and GLFW
## Backends: Desktop, SDL, DRM, Web
Chatroom: [Discord](https://discord.gg/fKDwt85aX6) or [Matrix](https://matrix.to/#/#raylib-python-cffi:matrix.org)
Chatroom: [Discord](https://discord.gg/fKDwt85aX6)
New CFFI API static bindings.
* Automatically generated to be as close as possible to
@ -8,23 +10,23 @@ original Raylib.
* Faster, fewer bugs and easier to maintain than ctypes.
* Commercial-friendly license.
* Docstrings and auto-completion.
* **Now includes extra libraries: raymath, raygui, rlgl, physac and GLFW**
[Full documentation](http://electronstudio.github.io/raylib-python-cffi)
# Quickstart
`pip3 install raylib`
from pyray import *
init_window(800, 450, "Hello")
while not window_should_close():
begin_drawing()
clear_background(WHITE)
draw_text("Hello world", 190, 200, 20, VIOLET)
end_drawing()
close_window()
`pip3 install raylib==5.0.0.4`
```python
from pyray import *
init_window(800, 450, "Hello")
while not window_should_close():
begin_drawing()
clear_background(WHITE)
draw_text("Hello world", 190, 200, 20, VIOLET)
end_drawing()
close_window()
```
# Installation
@ -35,13 +37,41 @@ First make sure you have the latest pip installed:
Then install
python3 -m pip install setuptools
python3 -m pip install raylib
python3 -m pip install raylib==5.0.0.4
On most platforms it should install a binary wheel (Windows 10 x64, MacOS 12 x64/arm64, Linux Ubuntu2004 x64/arm64).
If yours isn't available then pip will attempt to build from source, in which case you will need to have Raylib development libs installed, e.g.
On most platforms it should install a binary wheel. If yours isn't 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.
## Windows
Binaries require x64 Windows 10 or newer. (For x86 or older Windows you will have to build from source.)
Use an [official Windows Python release](https://www.python.org/downloads/windows/) rather than WSL, MSYS, etc.
## MacOS
Binaries require:
* arm64 MacOS 14
* x64 MacOS 10.13, or newer.
Older MacOS requires building from source but this is usually simple:
brew install pkg-config
brew install raylib
python3 -m pip install raylib==5.0.0.4
(I do have binaries for arm64 MacOS 11, 12 and 13 but I have no way of testing they work, so post an issue
if you want to test them.)
## Linux
Binaries require OS newer than Ubuntu 2020, x64 or arm64. Otherwise build from source.
(Pip should attempt automatically but will need Raylib itself installed and also pkg-config.)
The arm64 binaries are built on Raspberry Pi arm64 Bullseye with OpenGL 2.0
so may not work on other boards.
## Raspberry Pi
[Using on Rasperry Pi](RPI.rst)
@ -50,38 +80,52 @@ using homebrew, apt, etc.
There is now a separate dynamic version of this binding:
python3 -m pip uninstall raylib
python3 -m pip install raylib_dynamic
It works on some systems where the static version doesn't, [but be sure to read these caveats before using it](https://electronstudio.github.io/raylib-python-cffi/dynamic.html)
## Beta testing
## SDL backend
If you find a bug, it may be fixed in the [latest dev release](https://github.com/electronstudio/raylib-python-cffi/releases).
You can install an alpha or beta version by specifying the exact version number like this:
This is not well tested but has better support for controllers:
python3 -m pip install raylib==4.2.0.0.dev4
python3 -m pip uninstall raylib
python3 -m pip install raylib_sdl
You can't have multiple raylib packages installed at once.
## DRM backend
This uses the Linux framebuffer for devices that don't run X11/Wayland:
python3 -m pip uninstall raylib
python3 -m pip install raylib_drm
You can't have multiple raylib packages installed at once.
## Problems?
If it doesn't work, [try to build manually.](BUILDING.rst). If that works then [submit an issue](https://github.com/electronstudio/raylib-python-cffi/issues)
to let us know what you did.
If you need help you can try asking [on Discord](https://discord.gg/raylib).
If you need help you can try asking on [our discord](https://discord.gg/fKDwt85aX6). There is also a large [Raylib discord](https://discord.gg/raylib)
for issues that are not Python-specific.
If it still doesn't work, [submit an issue](https://github.com/electronstudio/raylib-python-cffi/issues).
# How to use
There are two APIs, you can use either or both:
There are two modules in the raylib package, `raylib` and `pyray`. (There is no separate package for
pyray). You can use either or both:
### If you are familiar with C coding and the Raylib C library and you want to use an exact copy of the C API
Use [the C API](https://electronstudio.github.io/raylib-python-cffi/raylib.html).
Use [the raylib module](https://electronstudio.github.io/raylib-python-cffi/raylib.html).
### If you prefer a slightly more Pythonistic API and don't mind it might be slightly slower
### If you prefer a more Pythonistic API
Use [the Python API](https://electronstudio.github.io/raylib-python-cffi/pyray.html).
Use [the pyray module](https://electronstudio.github.io/raylib-python-cffi/pyray.html).
# Running in a web browser
@ -143,9 +187,9 @@ A related library (that is a work in progress!):
* Converting more examples from C to Python
* Testing on more platforms
# License (updated)
# License
The bindings are now under the Eclipse Public License, so you are free to
Eclipse Public License, so you are free to
statically link and use in non-free / proprietary / commercial projects!
# Performance

View file

@ -12,7 +12,10 @@ We have published binary wheels compiled for 64-bit Raspberry OS Bullseye in X11
python -m pip install --break-system-packages raylib
If it doesn't work, or you're not on Bullseye, or you're 32 bit, or if you want to use Raylib in ``PLATFORM_DRM`` mode, you will need to compile your own raylib. See below.
Alternatively there is a DRM wheel called ``raylib_drm`` to use the framebuffer without X11. You can't have both wheels
installed at once.
If it doesn't work, or you're not on Bullseye, or you're 32 bit, you will need to compile your own raylib. See below.
For full instructions on this, see https://github.com/raysan5/raylib/wiki/Working-on-Raspberry-Pi . If you need help with this ask Raylib.
Option 2: Compile Raylib from source X11 mode
@ -39,7 +42,7 @@ Then have pip compile and install the wheel:
::
python3 -m pip install --break-system-packages setuptools
python3 -m pip install --no-cache-dir --no-binary raylib --upgrade --force-reinstall --break-system-packages raylib==5.0.0.3
python3 -m pip install --no-cache-dir --no-binary raylib --upgrade --force-reinstall --break-system-packages raylib==5.0.0.4
Option 3: Compile Raylib from source DRM mode
---------------------------------------------
@ -82,7 +85,7 @@ Then have pip compile and install the wheel:
::
python3 -m pip install --break-system-packages setuptools
python3 -m pip install --no-cache-dir --no-binary raylib --upgrade --force-reinstall --break-system-packages raylib==5.0.0.3
python3 -m pip install --no-cache-dir --no-binary raylib --upgrade --force-reinstall --break-system-packages raylib==5.0.0.4

View file

@ -158,7 +158,7 @@ for struct in ffi.list_types()[0]:
# elif ffi.typeof(struct).kind == "enum":
# print(f"{struct}: int")
else:
print("ERROR UNKNOWN TYPE", ffi.typeof(struct), file=sys.stderr)
print("WARNING: SKIPPING UNKNOWN TYPE", ffi.typeof(struct), file=sys.stderr)
print("""
LIGHTGRAY : Color

View file

@ -148,7 +148,7 @@ for struct in ffi.list_types()[0]:
elif ffi.typeof(struct).kind == "enum":
print(f"{struct} = int")
else:
print("ERROR UNKNOWN TYPE", ffi.typeof(struct), file=sys.stderr)
print("WARNING: SKIPPING UNKNOWN TYPE", ffi.typeof(struct), file=sys.stderr)
print("""

View file

@ -56,7 +56,6 @@ Example program:
init_window(800, 450, "Raylib texture test")
...
(You don't need to use the PyRay() class anymore.)
`See all examples here <https://github.com/electronstudio/raylib-python-cffi/tree/master/examples>`_

View file

@ -45,7 +45,7 @@
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="README.html">Python Bindings for Raylib 5.0</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html">Python Bindings for Raylib 5.5</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#quickstart">Quickstart</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#installation">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#how-to-use">How to use</a></li>
@ -53,7 +53,7 @@
<li class="toctree-l1"><a class="reference internal" href="README.html#app-showcase">App showcase</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#rlzero">RLZero</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#help-wanted">Help wanted</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#license-updated">License (updated)</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#license">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#performance">Performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#packaging-your-app">Packaging your app</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#advert">Advert</a></li>
@ -127,7 +127,7 @@ project.</p>
<p>If the Pip build doesnt work, please submit a bug. (And if you have
fixed it, a PR.)</p>
</div>
<p>Manual instructions follow, but may be outdated, so see also how we actually build the wheels
<p>Manual instructions follow, but are probably outdated, so see instead 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="Link to this heading"></a></h3>

View file

@ -6,7 +6,7 @@
<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 5.0 &mdash; Raylib Python documentation</title>
<title>Python Bindings for Raylib 5.5 &mdash; Raylib Python documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />
<link rel="stylesheet" type="text/css" href="_static/graphviz.css?v=4ae1632d" />
@ -45,25 +45,33 @@
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">Python Bindings for Raylib 5.0</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Python Bindings for Raylib 5.5</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#libraries-raymath-raygui-rlgl-physac-and-glfw">Libraries: raymath, raygui, rlgl, physac and GLFW</a></li>
<li class="toctree-l2"><a class="reference internal" href="#backends-desktop-sdl-drm-web">Backends: Desktop, SDL, DRM, Web</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="#quickstart">Quickstart</a></li>
<li class="toctree-l1"><a class="reference internal" href="#installation">Installation</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#windows">Windows</a></li>
<li class="toctree-l2"><a class="reference internal" href="#macos">MacOS</a></li>
<li class="toctree-l2"><a class="reference internal" href="#linux">Linux</a></li>
<li class="toctree-l2"><a class="reference internal" href="#raspberry-pi">Raspberry Pi</a></li>
<li class="toctree-l2"><a class="reference internal" href="#dynamic-binding-version">Dynamic binding version</a></li>
<li class="toctree-l2"><a class="reference internal" href="#beta-testing">Beta testing</a></li>
<li class="toctree-l2"><a class="reference internal" href="#sdl-backend">SDL backend</a></li>
<li class="toctree-l2"><a class="reference internal" href="#drm-backend">DRM backend</a></li>
<li class="toctree-l2"><a class="reference internal" href="#problems">Problems?</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="#how-to-use">How to use</a><ul>
<li class="toctree-l2"><a class="reference internal" 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">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></li>
<li class="toctree-l2"><a class="reference internal" href="#if-you-prefer-a-slightly-more-pythonistic-api-and-don-t-mind-it-might-be-slightly-slower">If you prefer a slightly more Pythonistic API and dont mind it might be slightly slower</a></li>
<li class="toctree-l2"><a class="reference internal" href="#if-you-prefer-a-more-pythonistic-api">If you prefer a more Pythonistic API</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="#running-in-a-web-browser">Running in a web browser</a></li>
<li class="toctree-l1"><a class="reference internal" href="#app-showcase">App showcase</a></li>
<li class="toctree-l1"><a class="reference internal" href="#rlzero">RLZero</a></li>
<li class="toctree-l1"><a class="reference internal" href="#help-wanted">Help wanted</a></li>
<li class="toctree-l1"><a class="reference internal" href="#license-updated">License (updated)</a></li>
<li class="toctree-l1"><a class="reference internal" href="#license">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="#performance">Performance</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#bunnymark">Bunnymark</a></li>
</ul>
@ -91,7 +99,7 @@
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Python Bindings for Raylib 5.0</li>
<li class="breadcrumb-item active">Python Bindings for Raylib 5.5</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/README.md.txt" rel="nofollow"> View page source</a>
</li>
@ -101,9 +109,14 @@
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="python-bindings-for-raylib-5-0">
<h1>Python Bindings for Raylib 5.0<a class="headerlink" href="#python-bindings-for-raylib-5-0" title="Link to this heading"></a></h1>
<p>Chatroom: <a class="reference external" href="https://discord.gg/fKDwt85aX6">Discord</a> or <a class="reference external" href="https://matrix.to/#/#raylib-python-cffi:matrix.org">Matrix</a></p>
<section id="python-bindings-for-raylib-5-5">
<h1>Python Bindings for Raylib 5.5<a class="headerlink" href="#python-bindings-for-raylib-5-5" title="Link to this heading"></a></h1>
<section id="libraries-raymath-raygui-rlgl-physac-and-glfw">
<h2>Libraries: raymath, raygui, rlgl, physac and GLFW<a class="headerlink" href="#libraries-raymath-raygui-rlgl-physac-and-glfw" title="Link to this heading"></a></h2>
</section>
<section id="backends-desktop-sdl-drm-web">
<h2>Backends: Desktop, SDL, DRM, Web<a class="headerlink" href="#backends-desktop-sdl-drm-web" title="Link to this heading"></a></h2>
<p>Chatroom: <a class="reference external" href="https://discord.gg/fKDwt85aX6">Discord</a></p>
<p>New CFFI API static bindings.</p>
<ul class="simple">
<li><p>Automatically generated to be as close as possible to
@ -111,21 +124,21 @@ original Raylib.</p></li>
<li><p>Faster, fewer bugs and easier to maintain than ctypes.</p></li>
<li><p>Commercial-friendly license.</p></li>
<li><p>Docstrings and auto-completion.</p></li>
<li><p><strong>Now includes extra libraries: raymath, raygui, rlgl, physac and GLFW</strong></p></li>
</ul>
<p><a class="reference external" href="http://electronstudio.github.io/raylib-python-cffi">Full documentation</a></p>
</section>
</section>
<section id="quickstart">
<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;)
while not window_should_close():
begin_drawing()
clear_background(WHITE)
draw_text(&quot;Hello world&quot;, 190, 200, 20, VIOLET)
end_drawing()
close_window()
<p><code class="docutils literal notranslate"><span class="pre">pip3</span> <span class="pre">install</span> <span class="pre">raylib==5.0.0.4</span></code></p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">pyray</span> <span class="kn">import</span> <span class="o">*</span>
<span class="n">init_window</span><span class="p">(</span><span class="mi">800</span><span class="p">,</span> <span class="mi">450</span><span class="p">,</span> <span class="s2">&quot;Hello&quot;</span><span class="p">)</span>
<span class="k">while</span> <span class="ow">not</span> <span class="n">window_should_close</span><span class="p">():</span>
<span class="n">begin_drawing</span><span class="p">()</span>
<span class="n">clear_background</span><span class="p">(</span><span class="n">WHITE</span><span class="p">)</span>
<span class="n">draw_text</span><span class="p">(</span><span class="s2">&quot;Hello world&quot;</span><span class="p">,</span> <span class="mi">190</span><span class="p">,</span> <span class="mi">200</span><span class="p">,</span> <span class="mi">20</span><span class="p">,</span> <span class="n">VIOLET</span><span class="p">)</span>
<span class="n">end_drawing</span><span class="p">()</span>
<span class="n">close_window</span><span class="p">()</span>
</pre></div>
</div>
</section>
@ -137,12 +150,40 @@ close_window()
</div>
<p>Then install</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>python3 -m pip install setuptools
python3 -m pip install raylib
python3 -m pip install raylib==5.0.0.4
</pre></div>
</div>
<p>On most platforms it should install a binary wheel (Windows 10 x64, MacOS 12 x64/arm64, Linux Ubuntu2004 x64/arm64).</p>
<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.
<p>On most platforms it should install a binary wheel. 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="windows">
<h2>Windows<a class="headerlink" href="#windows" title="Link to this heading"></a></h2>
<p>Binaries require x64 Windows 10 or newer. (For x86 or older Windows you will have to build from source.)</p>
<p>Use an <a class="reference external" href="https://www.python.org/downloads/windows/">official Windows Python release</a> rather than WSL, MSYS, etc.</p>
</section>
<section id="macos">
<h2>MacOS<a class="headerlink" href="#macos" title="Link to this heading"></a></h2>
<p>Binaries require:</p>
<ul class="simple">
<li><p>arm64 MacOS 14</p></li>
<li><p>x64 MacOS 10.13, or newer.</p></li>
</ul>
<p>Older MacOS requires building from source but this is usually simple:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>brew install pkg-config
brew install raylib
python3 -m pip install raylib==5.0.0.4
</pre></div>
</div>
<p>(I do have binaries for arm64 MacOS 11, 12 and 13 but I have no way of testing they work, so post an issue
if you want to test them.)</p>
</section>
<section id="linux">
<h2>Linux<a class="headerlink" href="#linux" title="Link to this heading"></a></h2>
<p>Binaries require OS newer than Ubuntu 2020, x64 or arm64. Otherwise build from source.
(Pip should attempt automatically but will need Raylib itself installed and also pkg-config.)</p>
<p>The arm64 binaries are built on Raspberry Pi arm64 Bullseye with OpenGL 2.0
so may not work on other boards.</p>
</section>
<section id="raspberry-pi">
<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>
@ -150,37 +191,50 @@ using homebrew, apt, etc.</p>
<section id="dynamic-binding-version">
<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
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>python3 -m pip uninstall raylib
python3 -m pip install raylib_dynamic
</pre></div>
</div>
<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="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
<section id="sdl-backend">
<h2>SDL backend<a class="headerlink" href="#sdl-backend" title="Link to this heading"></a></h2>
<p>This is not well tested but has better support for controllers:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>python3 -m pip uninstall raylib
python3 -m pip install raylib_sdl
</pre></div>
</div>
<p>You cant have multiple raylib packages installed at once.</p>
</section>
<section id="drm-backend">
<h2>DRM backend<a class="headerlink" href="#drm-backend" title="Link to this heading"></a></h2>
<p>This uses the Linux framebuffer for devices that dont run X11/Wayland:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>python3 -m pip uninstall raylib
python3 -m pip install raylib_drm
</pre></div>
</div>
<p>You cant have multiple raylib packages installed at once.</p>
</section>
<section id="problems">
<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>
<p>If you need help you can try asking on <a class="reference external" href="https://discord.gg/fKDwt85aX6">our discord</a>. There is also a large <a class="reference external" href="https://discord.gg/raylib">Raylib discord</a>
for issues that are not Python-specific.</p>
<p>If it still doesnt work, <a class="reference external" href="https://github.com/electronstudio/raylib-python-cffi/issues">submit an issue</a>.</p>
</section>
</section>
<section id="how-to-use">
<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>
<p>There are two modules in the raylib package, <code class="docutils literal notranslate"><span class="pre">raylib</span></code> and <code class="docutils literal notranslate"><span class="pre">pyray</span></code>. (There is no separate package for
pyray). 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="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>
<p>Use <a class="reference external" href="https://electronstudio.github.io/raylib-python-cffi/raylib.html">the raylib module</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="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 id="if-you-prefer-a-more-pythonistic-api">
<h2>If you prefer a more Pythonistic API<a class="headerlink" href="#if-you-prefer-a-more-pythonistic-api" title="Link to this heading"></a></h2>
<p>Use <a class="reference external" href="https://electronstudio.github.io/raylib-python-cffi/pyray.html">the pyray module</a>.</p>
</section>
</section>
<section id="running-in-a-web-browser">
@ -239,9 +293,9 @@ Carefully read all their <a class="reference external" href="https://pygame-web.
<li><p>Testing on more platforms</p></li>
</ul>
</section>
<section id="license-updated">
<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
<section id="license">
<h1>License<a class="headerlink" href="#license" title="Link to this heading"></a></h1>
<p>Eclipse Public License, so you are free to
statically link and use in non-free / proprietary / commercial projects!</p>
</section>
<section id="performance">

View file

@ -44,7 +44,7 @@
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="README.html">Python Bindings for Raylib 5.0</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html">Python Bindings for Raylib 5.5</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#quickstart">Quickstart</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#installation">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#how-to-use">How to use</a></li>
@ -52,7 +52,7 @@
<li class="toctree-l1"><a class="reference internal" href="README.html#app-showcase">App showcase</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#rlzero">RLZero</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#help-wanted">Help wanted</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#license-updated">License (updated)</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#license">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#performance">Performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#packaging-your-app">Packaging your app</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#advert">Advert</a></li>
@ -101,7 +101,9 @@
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">python</span> <span class="o">-</span><span class="n">m</span> <span class="n">pip</span> <span class="n">install</span> <span class="o">--</span><span class="k">break</span><span class="o">-</span><span class="n">system</span><span class="o">-</span><span class="n">packages</span> <span class="n">raylib</span>
</pre></div>
</div>
<p>If it doesnt work, or youre not on Bullseye, or youre 32 bit, or if you want to use Raylib in <code class="docutils literal notranslate"><span class="pre">PLATFORM_DRM</span></code> mode, you will need to compile your own raylib. See below.
<p>Alternatively there is a DRM wheel called <code class="docutils literal notranslate"><span class="pre">raylib_drm</span></code> to use the framebuffer without X11. You cant have both wheels
installed at once.</p>
<p>If it doesnt work, or youre not on Bullseye, or youre 32 bit, you will need to compile your own raylib. See below.
For full instructions on this, see <a class="reference external" href="https://github.com/raysan5/raylib/wiki/Working-on-Raspberry-Pi">https://github.com/raysan5/raylib/wiki/Working-on-Raspberry-Pi</a> . If you need help with this ask Raylib.</p>
</section>
<section id="option-2-compile-raylib-from-source-x11-mode">
@ -122,7 +124,7 @@ For full instructions on this, see <a class="reference external" href="https://g
</div>
<p>Then have pip compile and install the wheel:</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="o">--</span><span class="k">break</span><span class="o">-</span><span class="n">system</span><span class="o">-</span><span class="n">packages</span> <span class="n">setuptools</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="o">--</span><span class="n">no</span><span class="o">-</span><span class="n">cache</span><span class="o">-</span><span class="nb">dir</span> <span class="o">--</span><span class="n">no</span><span class="o">-</span><span class="n">binary</span> <span class="n">raylib</span> <span class="o">--</span><span class="n">upgrade</span> <span class="o">--</span><span class="n">force</span><span class="o">-</span><span class="n">reinstall</span> <span class="o">--</span><span class="k">break</span><span class="o">-</span><span class="n">system</span><span class="o">-</span><span class="n">packages</span> <span class="n">raylib</span><span class="o">==</span><span class="mf">5.0.0.3</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="o">--</span><span class="n">no</span><span class="o">-</span><span class="n">cache</span><span class="o">-</span><span class="nb">dir</span> <span class="o">--</span><span class="n">no</span><span class="o">-</span><span class="n">binary</span> <span class="n">raylib</span> <span class="o">--</span><span class="n">upgrade</span> <span class="o">--</span><span class="n">force</span><span class="o">-</span><span class="n">reinstall</span> <span class="o">--</span><span class="k">break</span><span class="o">-</span><span class="n">system</span><span class="o">-</span><span class="n">packages</span> <span class="n">raylib</span><span class="o">==</span><span class="mf">5.0.0.4</span>
</pre></div>
</div>
</section>
@ -155,7 +157,7 @@ For full instructions on this, see <a class="reference external" href="https://g
</div>
<p>Then have pip compile and install the wheel:</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="o">--</span><span class="k">break</span><span class="o">-</span><span class="n">system</span><span class="o">-</span><span class="n">packages</span> <span class="n">setuptools</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="o">--</span><span class="n">no</span><span class="o">-</span><span class="n">cache</span><span class="o">-</span><span class="nb">dir</span> <span class="o">--</span><span class="n">no</span><span class="o">-</span><span class="n">binary</span> <span class="n">raylib</span> <span class="o">--</span><span class="n">upgrade</span> <span class="o">--</span><span class="n">force</span><span class="o">-</span><span class="n">reinstall</span> <span class="o">--</span><span class="k">break</span><span class="o">-</span><span class="n">system</span><span class="o">-</span><span class="n">packages</span> <span class="n">raylib</span><span class="o">==</span><span class="mf">5.0.0.3</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="o">--</span><span class="n">no</span><span class="o">-</span><span class="n">cache</span><span class="o">-</span><span class="nb">dir</span> <span class="o">--</span><span class="n">no</span><span class="o">-</span><span class="n">binary</span> <span class="n">raylib</span> <span class="o">--</span><span class="n">upgrade</span> <span class="o">--</span><span class="n">force</span><span class="o">-</span><span class="n">reinstall</span> <span class="o">--</span><span class="k">break</span><span class="o">-</span><span class="n">system</span><span class="o">-</span><span class="n">packages</span> <span class="n">raylib</span><span class="o">==</span><span class="mf">5.0.0.4</span>
</pre></div>
</div>
<div class="admonition attention">

View file

@ -38,7 +38,7 @@ project.
If the Pip build doesnt work, please submit a bug. (And if you have
fixed it, a PR.)
Manual instructions follow, but may be outdated, so see also how we actually build the wheels
Manual instructions follow, but are probably outdated, so see instead how we actually build the wheels
at https://github.com/electronstudio/raylib-python-cffi/blob/master/.github/workflows/build.yml
Windows manual build

View file

@ -1,6 +1,8 @@
# Python Bindings for Raylib 5.0
# Python Bindings for Raylib 5.5
## Libraries: raymath, raygui, rlgl, physac and GLFW
## Backends: Desktop, SDL, DRM, Web
Chatroom: [Discord](https://discord.gg/fKDwt85aX6) or [Matrix](https://matrix.to/#/#raylib-python-cffi:matrix.org)
Chatroom: [Discord](https://discord.gg/fKDwt85aX6)
New CFFI API static bindings.
* Automatically generated to be as close as possible to
@ -8,23 +10,23 @@ original Raylib.
* Faster, fewer bugs and easier to maintain than ctypes.
* Commercial-friendly license.
* Docstrings and auto-completion.
* **Now includes extra libraries: raymath, raygui, rlgl, physac and GLFW**
[Full documentation](http://electronstudio.github.io/raylib-python-cffi)
# Quickstart
`pip3 install raylib`
from pyray import *
init_window(800, 450, "Hello")
while not window_should_close():
begin_drawing()
clear_background(WHITE)
draw_text("Hello world", 190, 200, 20, VIOLET)
end_drawing()
close_window()
`pip3 install raylib==5.0.0.4`
```python
from pyray import *
init_window(800, 450, "Hello")
while not window_should_close():
begin_drawing()
clear_background(WHITE)
draw_text("Hello world", 190, 200, 20, VIOLET)
end_drawing()
close_window()
```
# Installation
@ -35,13 +37,41 @@ First make sure you have the latest pip installed:
Then install
python3 -m pip install setuptools
python3 -m pip install raylib
python3 -m pip install raylib==5.0.0.4
On most platforms it should install a binary wheel (Windows 10 x64, MacOS 12 x64/arm64, Linux Ubuntu2004 x64/arm64).
If yours isn't available then pip will attempt to build from source, in which case you will need to have Raylib development libs installed, e.g.
On most platforms it should install a binary wheel. If yours isn't 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.
## Windows
Binaries require x64 Windows 10 or newer. (For x86 or older Windows you will have to build from source.)
Use an [official Windows Python release](https://www.python.org/downloads/windows/) rather than WSL, MSYS, etc.
## MacOS
Binaries require:
* arm64 MacOS 14
* x64 MacOS 10.13, or newer.
Older MacOS requires building from source but this is usually simple:
brew install pkg-config
brew install raylib
python3 -m pip install raylib==5.0.0.4
(I do have binaries for arm64 MacOS 11, 12 and 13 but I have no way of testing they work, so post an issue
if you want to test them.)
## Linux
Binaries require OS newer than Ubuntu 2020, x64 or arm64. Otherwise build from source.
(Pip should attempt automatically but will need Raylib itself installed and also pkg-config.)
The arm64 binaries are built on Raspberry Pi arm64 Bullseye with OpenGL 2.0
so may not work on other boards.
## Raspberry Pi
[Using on Rasperry Pi](RPI.rst)
@ -50,38 +80,52 @@ using homebrew, apt, etc.
There is now a separate dynamic version of this binding:
python3 -m pip uninstall raylib
python3 -m pip install raylib_dynamic
It works on some systems where the static version doesn't, [but be sure to read these caveats before using it](https://electronstudio.github.io/raylib-python-cffi/dynamic.html)
## Beta testing
## SDL backend
If you find a bug, it may be fixed in the [latest dev release](https://github.com/electronstudio/raylib-python-cffi/releases).
You can install an alpha or beta version by specifying the exact version number like this:
This is not well tested but has better support for controllers:
python3 -m pip install raylib==4.2.0.0.dev4
python3 -m pip uninstall raylib
python3 -m pip install raylib_sdl
You can't have multiple raylib packages installed at once.
## DRM backend
This uses the Linux framebuffer for devices that don't run X11/Wayland:
python3 -m pip uninstall raylib
python3 -m pip install raylib_drm
You can't have multiple raylib packages installed at once.
## Problems?
If it doesn't work, [try to build manually.](BUILDING.rst). If that works then [submit an issue](https://github.com/electronstudio/raylib-python-cffi/issues)
to let us know what you did.
If you need help you can try asking [on Discord](https://discord.gg/raylib).
If you need help you can try asking on [our discord](https://discord.gg/fKDwt85aX6). There is also a large [Raylib discord](https://discord.gg/raylib)
for issues that are not Python-specific.
If it still doesn't work, [submit an issue](https://github.com/electronstudio/raylib-python-cffi/issues).
# How to use
There are two APIs, you can use either or both:
There are two modules in the raylib package, `raylib` and `pyray`. (There is no separate package for
pyray). You can use either or both:
### If you are familiar with C coding and the Raylib C library and you want to use an exact copy of the C API
Use [the C API](https://electronstudio.github.io/raylib-python-cffi/raylib.html).
Use [the raylib module](https://electronstudio.github.io/raylib-python-cffi/raylib.html).
### If you prefer a slightly more Pythonistic API and don't mind it might be slightly slower
### If you prefer a more Pythonistic API
Use [the Python API](https://electronstudio.github.io/raylib-python-cffi/pyray.html).
Use [the pyray module](https://electronstudio.github.io/raylib-python-cffi/pyray.html).
# Running in a web browser
@ -143,9 +187,9 @@ A related library (that is a work in progress!):
* Converting more examples from C to Python
* Testing on more platforms
# License (updated)
# License
The bindings are now under the Eclipse Public License, so you are free to
Eclipse Public License, so you are free to
statically link and use in non-free / proprietary / commercial projects!
# Performance

View file

@ -12,7 +12,10 @@ We have published binary wheels compiled for 64-bit Raspberry OS Bullseye in X11
python -m pip install --break-system-packages raylib
If it doesn't work, or you're not on Bullseye, or you're 32 bit, or if you want to use Raylib in ``PLATFORM_DRM`` mode, you will need to compile your own raylib. See below.
Alternatively there is a DRM wheel called ``raylib_drm`` to use the framebuffer without X11. You can't have both wheels
installed at once.
If it doesn't work, or you're not on Bullseye, or you're 32 bit, you will need to compile your own raylib. See below.
For full instructions on this, see https://github.com/raysan5/raylib/wiki/Working-on-Raspberry-Pi . If you need help with this ask Raylib.
Option 2: Compile Raylib from source X11 mode
@ -39,7 +42,7 @@ Then have pip compile and install the wheel:
::
python3 -m pip install --break-system-packages setuptools
python3 -m pip install --no-cache-dir --no-binary raylib --upgrade --force-reinstall --break-system-packages raylib==5.0.0.3
python3 -m pip install --no-cache-dir --no-binary raylib --upgrade --force-reinstall --break-system-packages raylib==5.0.0.4
Option 3: Compile Raylib from source DRM mode
---------------------------------------------
@ -82,7 +85,7 @@ Then have pip compile and install the wheel:
::
python3 -m pip install --break-system-packages setuptools
python3 -m pip install --no-cache-dir --no-binary raylib --upgrade --force-reinstall --break-system-packages raylib==5.0.0.3
python3 -m pip install --no-cache-dir --no-binary raylib --upgrade --force-reinstall --break-system-packages raylib==5.0.0.4

View file

@ -56,7 +56,6 @@ Example program:
init_window(800, 450, "Raylib texture test")
...
(You don't need to use the PyRay() class anymore.)
`See all examples here <https://github.com/electronstudio/raylib-python-cffi/tree/master/examples>`_

View file

@ -45,7 +45,7 @@
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="README.html">Python Bindings for Raylib 5.0</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html">Python Bindings for Raylib 5.5</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#quickstart">Quickstart</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#installation">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#how-to-use">How to use</a></li>
@ -53,7 +53,7 @@
<li class="toctree-l1"><a class="reference internal" href="README.html#app-showcase">App showcase</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#rlzero">RLZero</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#help-wanted">Help wanted</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#license-updated">License (updated)</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#license">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#performance">Performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#packaging-your-app">Packaging your app</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#advert">Advert</a></li>

File diff suppressed because it is too large Load diff

View file

@ -20,7 +20,7 @@
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Python Bindings for Raylib 5.0" href="README.html" />
<link rel="next" title="Python Bindings for Raylib 5.5" href="README.html" />
</head>
<body class="wy-body-for-nav">
@ -44,7 +44,7 @@
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="README.html">Python Bindings for Raylib 5.0</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html">Python Bindings for Raylib 5.5</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#quickstart">Quickstart</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#installation">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#how-to-use">How to use</a></li>
@ -52,7 +52,7 @@
<li class="toctree-l1"><a class="reference internal" href="README.html#app-showcase">App showcase</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#rlzero">RLZero</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#help-wanted">Help wanted</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#license-updated">License (updated)</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#license">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#performance">Performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#packaging-your-app">Packaging your app</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#advert">Advert</a></li>
@ -92,7 +92,7 @@
<div class="toctree-wrapper compound">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="README.html">Python Bindings for Raylib 5.0</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html">Python Bindings for Raylib 5.5</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#quickstart">Quickstart</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#installation">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#how-to-use">How to use</a></li>
@ -100,7 +100,7 @@
<li class="toctree-l1"><a class="reference internal" href="README.html#app-showcase">App showcase</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#rlzero">RLZero</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#help-wanted">Help wanted</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#license-updated">License (updated)</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#license">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#performance">Performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#packaging-your-app">Packaging your app</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#advert">Advert</a></li>
@ -120,7 +120,7 @@
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="README.html" class="btn btn-neutral float-right" title="Python Bindings for Raylib 5.0" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="README.html" class="btn btn-neutral float-right" title="Python Bindings for Raylib 5.5" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>

Binary file not shown.

View file

@ -49,7 +49,7 @@
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="README.html">Python Bindings for Raylib 5.0</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html">Python Bindings for Raylib 5.5</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#quickstart">Quickstart</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#installation">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#how-to-use">How to use</a></li>
@ -57,7 +57,7 @@
<li class="toctree-l1"><a class="reference internal" href="README.html#app-showcase">App showcase</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#rlzero">RLZero</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#help-wanted">Help wanted</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#license-updated">License (updated)</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#license">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#performance">Performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#packaging-your-app">Packaging your app</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#advert">Advert</a></li>

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

View file

@ -45,7 +45,7 @@
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="README.html">Python Bindings for Raylib 5.0</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html">Python Bindings for Raylib 5.5</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#quickstart">Quickstart</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#installation">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#how-to-use">How to use</a></li>
@ -53,7 +53,7 @@
<li class="toctree-l1"><a class="reference internal" href="README.html#app-showcase">App showcase</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#rlzero">RLZero</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#help-wanted">Help wanted</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#license-updated">License (updated)</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#license">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#performance">Performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#packaging-your-app">Packaging your app</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#advert">Advert</a></li>

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

View file

@ -1,9 +1,9 @@
import raylib
RAYLIB_VERSION_MAJOR: int = 5
RAYLIB_VERSION_MINOR: int = 0
RAYLIB_VERSION_MINOR: int = 5
RAYLIB_VERSION_PATCH: int = 0
RAYLIB_VERSION: str = "5.0"
RAYLIB_VERSION: str = "5.5"
PI: float = 3.141592653589793
DEG2RAD = PI / 180.0
RAD2DEG = 180.0 / PI
@ -15,7 +15,7 @@ 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
EPSILON: float = 1e-06
RLGL_VERSION: str = "4.5"
RLGL_VERSION: str = "5.0"
RL_DEFAULT_BATCH_BUFFER_ELEMENTS: int = 8192
RL_DEFAULT_BATCH_BUFFERS: int = 1
RL_DEFAULT_BATCH_DRAWCALLS: int = 256
@ -86,6 +86,17 @@ RL_BLEND_SRC_RGB: int = 32969
RL_BLEND_DST_ALPHA: int = 32970
RL_BLEND_SRC_ALPHA: int = 32971
RL_BLEND_COLOR: int = 32773
RL_READ_FRAMEBUFFER: int = 36008
RL_DRAW_FRAMEBUFFER: int = 36009
RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION: int = 0
RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD: int = 1
RL_DEFAULT_SHADER_ATTRIB_LOCATION_NORMAL: int = 2
RL_DEFAULT_SHADER_ATTRIB_LOCATION_COLOR: int = 3
RL_DEFAULT_SHADER_ATTRIB_LOCATION_TANGENT: int = 4
RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2: int = 5
RL_DEFAULT_SHADER_ATTRIB_LOCATION_INDICES: int = 6
RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEIDS: int = 7
RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEWEIGHTS: int = 8
RL_SHADER_LOC_MAP_DIFFUSE = raylib.RL_SHADER_LOC_MAP_ALBEDO
RL_SHADER_LOC_MAP_SPECULAR = raylib.RL_SHADER_LOC_MAP_METALNESS
GL_SHADING_LANGUAGE_VERSION: int = 35724
@ -102,6 +113,8 @@ 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_PROGRAM_POINT_SIZE: int = 34370
GL_LINE_WIDTH: int = 2849
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
@ -113,19 +126,22 @@ 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_ATTRIB_NAME_BONEIDS: str = "vertexBoneIds"
RL_DEFAULT_SHADER_ATTRIB_NAME_BONEWEIGHTS: str = "vertexBoneWeights"
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_UNIFORM_NAME_BONE_MATRICES: str = "boneMatrices"
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_MINOR: int = 5
RAYGUI_VERSION_PATCH: int = 0
RAYGUI_VERSION: str = "4.0"
RAYGUI_VERSION: str = "4.5-dev"
SCROLLBAR_LEFT_SIDE: int = 0
SCROLLBAR_RIGHT_SIDE: int = 1
RAYGUI_ICON_SIZE: int = 16
@ -149,6 +165,7 @@ 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_MIN_MOUSE_WHEEL_SPEED: int = 20
RAYGUI_TOGGLEGROUP_MAX_ITEMS: int = 32
RAYGUI_TEXTBOX_AUTO_CURSOR_COOLDOWN: int = 40
RAYGUI_TEXTBOX_AUTO_CURSOR_DELAY: int = 1
@ -423,12 +440,14 @@ 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_SCALE_FRAMEBUFFER: int = 139277
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_WIN32_SHOWDEFAULT: int = 151554
GLFW_WAYLAND_APP_ID: int = 155649
GLFW_NO_API: int = 0
GLFW_OPENGL_API: int = 196609
@ -461,6 +480,8 @@ 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_WAYLAND_PREFER_LIBDECOR: int = 229377
GLFW_WAYLAND_DISABLE_LIBDECOR: int = 229378
GLFW_ANY_POSITION: int = 2147483648
GLFW_ARROW_CURSOR: int = 221185
GLFW_IBEAM_CURSOR: int = 221186
@ -480,6 +501,7 @@ GLFW_PLATFORM: int = 327683
GLFW_COCOA_CHDIR_RESOURCES: int = 331777
GLFW_COCOA_MENUBAR: int = 331778
GLFW_X11_XCB_VULKAN_SURFACE: int = 335873
GLFW_WAYLAND_LIBDECOR: int = 339969
GLFW_ANY_PLATFORM: int = 393216
GLFW_PLATFORM_WIN32: int = 393217
GLFW_PLATFORM_COCOA: int = 393218

View file

@ -136,7 +136,7 @@ class KeyboardKey(IntEnum):
KEY_KP_ENTER = 335
KEY_KP_EQUAL = 336
KEY_BACK = 4
KEY_MENU = 82
KEY_MENU = 5
KEY_VOLUME_UP = 24
KEY_VOLUME_DOWN = 25
@ -230,6 +230,9 @@ class ShaderLocationIndex(IntEnum):
SHADER_LOC_MAP_IRRADIANCE = 23
SHADER_LOC_MAP_PREFILTER = 24
SHADER_LOC_MAP_BRDF = 25
SHADER_LOC_VERTEX_BONEIDS = 26
SHADER_LOC_VERTEX_BONEWEIGHTS = 27
SHADER_LOC_BONE_MATRICES = 28
class ShaderUniformDataType(IntEnum):
SHADER_UNIFORM_FLOAT = 0
@ -294,7 +297,6 @@ class CubemapLayout(IntEnum):
CUBEMAP_LAYOUT_LINE_HORIZONTAL = 2
CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR = 3
CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE = 4
CUBEMAP_LAYOUT_PANORAMA = 5
class FontType(IntEnum):
FONT_DEFAULT = 0
@ -433,6 +435,8 @@ class GuiComboBoxProperty(IntEnum):
class GuiDropdownBoxProperty(IntEnum):
ARROW_PADDING = 16
DROPDOWN_ITEMS_SPACING = 17
DROPDOWN_ARROW_HIDDEN = 18
DROPDOWN_ROLL_UP = 19
class GuiTextBoxProperty(IntEnum):
TEXT_READONLY = 16
@ -446,6 +450,7 @@ class GuiListViewProperty(IntEnum):
LIST_ITEMS_SPACING = 17
SCROLLBAR_WIDTH = 18
SCROLLBAR_SIDE = 19
LIST_ITEMS_BORDER_WIDTH = 20
class GuiColorPickerProperty(IntEnum):
COLOR_SELECTOR_SIZE = 16
@ -675,15 +680,15 @@ class GuiIconName(IntEnum):
ICON_FOLDER = 217
ICON_FILE = 218
ICON_SAND_TIMER = 219
ICON_220 = 220
ICON_221 = 221
ICON_222 = 222
ICON_223 = 223
ICON_224 = 224
ICON_225 = 225
ICON_226 = 226
ICON_227 = 227
ICON_228 = 228
ICON_WARNING = 220
ICON_HELP_BOX = 221
ICON_INFO_BOX = 222
ICON_PRIORITY = 223
ICON_LAYERS_ISO = 224
ICON_LAYERS2 = 225
ICON_MLAYERS = 226
ICON_MAPS = 227
ICON_HOT = 228
ICON_229 = 229
ICON_230 = 230
ICON_231 = 231

View file

@ -21,7 +21,7 @@ model.materials.maps[pr.MATERIAL_MAP_ALBEDO].texture = texture
pr.unload_image(image)
pos = pr.get_mouse_position()
ray = pr.get_mouse_ray(pos, camera)
ray = pr.get_screen_to_world_ray(pos, camera)
while not pr.window_should_close():
@ -36,6 +36,6 @@ while not pr.window_should_close():
pr.end_drawing()
pos = pr.get_mouse_position()
ray = pr.get_mouse_ray(pos, camera)
ray = pr.get_screen_to_world_ray(pos, camera)
pr.close_window()

View file

@ -2,6 +2,7 @@
echo "building and installing raylib"
cd raylib-c
rm -rf build
mkdir build
cd build
cmake -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release ..
@ -16,7 +17,7 @@ sudo cp -v ./raylib-c/src/rlgl.h /usr/local/include/
sudo cp -v ./raylib-c/src/raymath.h /usr/local/include/
sudo cp -v ./raygui/src/raygui.h /usr/local/include/
sudo cp -v ./physac/src/physac.h /usr/local/include/
sudo cp -rv raylib-c/src/external/glfw/include/GLFW /usr/local/include
sudo cp -rv ./raylib-c/src/external/glfw/include/GLFW /usr/local/include/
echo "building raylib_parser"
@ -38,6 +39,7 @@ python3 raylib/build.py
echo "creating enums.py"
python3 -m pip install inflection --break-system-packages # TODO: venv
python3 create_enums.py > raylib/enums.py
python3 create_enums.py > dynamic/raylib/enums.py

File diff suppressed because it is too large Load diff

2
raygui

@ -1 +1 @@
Subproject commit 25c8c65a6e5f0f4d4b564a0343861898c6f2778b
Subproject commit 1e03efca48c50c5ea4b4a053d5bf04bad58d3e43

@ -1 +1 @@
Subproject commit ae50bfa2cc569c0f8d5bc4315d39db64005b1b08
Subproject commit 26548c10620c4ae6937cf8b506c777a006b33c16

File diff suppressed because it is too large Load diff

View file

@ -25,12 +25,13 @@ import sys
import subprocess
import time
RAYLIB_PLATFORM = os.getenv("RAYLIB_PLATFORM", "Desktop")
def check_raylib_installed():
return subprocess.run(['pkg-config', '--exists', 'raylib'], text=True, stdout=subprocess.PIPE).returncode == 0
def check_SDL_installed():
return subprocess.run(['pkg-config', '--exists', 'sdl2'], text=True, stdout=subprocess.PIPE).returncode == 0
def get_the_include_path():
return subprocess.run(['pkg-config', '--variable=includedir', 'raylib'], text=True,
@ -106,6 +107,9 @@ def build_unix():
if not check_raylib_installed():
raise Exception("ERROR: raylib not found by pkg-config. Please install pkg-config and Raylib.")
if RAYLIB_PLATFORM=="SDL" and not check_SDL_installed():
raise Exception("ERROR: SDL2 not found by pkg-config. Please install pkg-config and SDL2.")
raylib_h = get_the_include_path() + "/raylib.h"
rlgl_h = get_the_include_path() + "/rlgl.h"
raymath_h = get_the_include_path() + "/raymath.h"
@ -126,7 +130,7 @@ def build_unix():
"""
glfw3_h = get_the_include_path() + "/GLFW/glfw3.h"
if check_header_exists(glfw3_h):
if RAYLIB_PLATFORM=="Desktop" and check_header_exists(glfw3_h):
ffi_includes += """
#include "GLFW/glfw3.h"
"""
@ -154,7 +158,7 @@ def build_unix():
ffibuilder.cdef(pre_process_header(raygui_h))
if os.path.isfile(physac_h):
ffibuilder.cdef(pre_process_header(physac_h))
if os.path.isfile(glfw3_h):
if RAYLIB_PLATFORM=="Desktop" and os.path.isfile(glfw3_h):
ffibuilder.cdef(pre_process_header(glfw3_h))
@ -163,15 +167,28 @@ def build_unix():
extra_link_args = [get_the_lib_path() + '/libraylib.a', '-framework', 'OpenGL', '-framework', 'Cocoa',
'-framework', 'IOKit', '-framework', 'CoreFoundation', '-framework',
'CoreVideo']
if RAYLIB_PLATFORM=="SDL":
extra_link_args += ['/usr/local/lib/libSDL2.a', '-framework', 'CoreHaptics', '-framework', 'ForceFeedback',
'-framework', 'GameController']
libraries = []
extra_compile_args = ["-Wno-error=incompatible-function-pointer-types", "-D_CFFI_NO_LIMITED_API"]
else: #platform.system() == "Linux":
print("BUILDING FOR LINUX")
extra_link_args = get_lib_flags() + [ '-lm', '-lpthread', '-lGL',
'-lrt', '-lm', '-ldl', '-lX11', '-lpthread', '-latomic']
'-lrt', '-lm', '-ldl', '-lpthread', '-latomic']
if RAYLIB_PLATFORM=="SDL":
extra_link_args += ['-lX11','-lSDL2']
elif RAYLIB_PLATFORM=="DRM":
extra_link_args += ['-lEGL', '-lgbm']
else:
extra_link_args += ['-lX11']
extra_compile_args = ["-Wno-incompatible-pointer-types", "-D_CFFI_NO_LIMITED_API"]
libraries = ['GL', 'm', 'pthread', 'dl', 'rt', 'X11', 'atomic']
libraries = [] # Not sure why but we put them in extra_link_args instead so *shouldnt* be needed here
print("extra_link_args: "+str(extra_link_args))
print("extra_compile_args: "+str(extra_compile_args))
print("libraries: "+str(libraries))
ffibuilder.set_source("raylib._raylib_cffi",
ffi_includes,
py_limited_api=False,
@ -184,26 +201,41 @@ 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())
if RAYLIB_PLATFORM=="Desktop":
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())
ffibuilder.cdef(open("raylib/raymath.h.modified").read())
ffibuilder.set_source("raylib._raylib_cffi", """
ffi_includes = """
#include "raylib.h"
#include "rlgl.h"
#include "rlgl.h"
#include "raymath.h"
#include "GLFW/glfw3.h"
"""
if RAYLIB_PLATFORM=="Desktop":
ffi_includes += """
#include "GLFW/glfw3.h"
"""
ffi_includes += """
#define RAYGUI_IMPLEMENTATION
#define RAYGUI_SUPPORT_RICONS
#include "raygui.h"
#define PHYSAC_IMPLEMENTATION
#include "physac.h"
""",
#include "physac.h"
"""
libraries = ['raylib', 'gdi32', 'shell32', 'user32', 'OpenGL32', 'winmm']
if RAYLIB_PLATFORM=="SDL":
libraries += ['SDL2']
print("libraries: "+str(libraries))
ffibuilder.set_source("raylib._raylib_cffi", ffi_includes,
extra_link_args=['/NODEFAULTLIB:MSVCRTD'],
extra_compile_args="/D_CFFI_NO_LIMITED_API",
extra_compile_args=["/D_CFFI_NO_LIMITED_API"],
py_limited_api=False,
libraries=['raylib', 'gdi32', 'shell32', 'user32', 'OpenGL32', 'winmm'],
libraries=libraries,
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\\include',
'D:\\a\\raylib-python-cffi\\raylib-python-cffi\\raygui\\src',

View file

@ -1,9 +1,9 @@
import raylib
RAYLIB_VERSION_MAJOR: int = 5
RAYLIB_VERSION_MINOR: int = 0
RAYLIB_VERSION_MINOR: int = 5
RAYLIB_VERSION_PATCH: int = 0
RAYLIB_VERSION: str = "5.0"
RAYLIB_VERSION: str = "5.5"
PI: float = 3.141592653589793
DEG2RAD = PI / 180.0
RAD2DEG = 180.0 / PI
@ -15,7 +15,7 @@ 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
EPSILON: float = 1e-06
RLGL_VERSION: str = "4.5"
RLGL_VERSION: str = "5.0"
RL_DEFAULT_BATCH_BUFFER_ELEMENTS: int = 8192
RL_DEFAULT_BATCH_BUFFERS: int = 1
RL_DEFAULT_BATCH_DRAWCALLS: int = 256
@ -86,6 +86,17 @@ RL_BLEND_SRC_RGB: int = 32969
RL_BLEND_DST_ALPHA: int = 32970
RL_BLEND_SRC_ALPHA: int = 32971
RL_BLEND_COLOR: int = 32773
RL_READ_FRAMEBUFFER: int = 36008
RL_DRAW_FRAMEBUFFER: int = 36009
RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION: int = 0
RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD: int = 1
RL_DEFAULT_SHADER_ATTRIB_LOCATION_NORMAL: int = 2
RL_DEFAULT_SHADER_ATTRIB_LOCATION_COLOR: int = 3
RL_DEFAULT_SHADER_ATTRIB_LOCATION_TANGENT: int = 4
RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2: int = 5
RL_DEFAULT_SHADER_ATTRIB_LOCATION_INDICES: int = 6
RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEIDS: int = 7
RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEWEIGHTS: int = 8
RL_SHADER_LOC_MAP_DIFFUSE = raylib.RL_SHADER_LOC_MAP_ALBEDO
RL_SHADER_LOC_MAP_SPECULAR = raylib.RL_SHADER_LOC_MAP_METALNESS
GL_SHADING_LANGUAGE_VERSION: int = 35724
@ -102,6 +113,8 @@ 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_PROGRAM_POINT_SIZE: int = 34370
GL_LINE_WIDTH: int = 2849
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
@ -113,19 +126,22 @@ 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_ATTRIB_NAME_BONEIDS: str = "vertexBoneIds"
RL_DEFAULT_SHADER_ATTRIB_NAME_BONEWEIGHTS: str = "vertexBoneWeights"
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_UNIFORM_NAME_BONE_MATRICES: str = "boneMatrices"
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_MINOR: int = 5
RAYGUI_VERSION_PATCH: int = 0
RAYGUI_VERSION: str = "4.0"
RAYGUI_VERSION: str = "4.5-dev"
SCROLLBAR_LEFT_SIDE: int = 0
SCROLLBAR_RIGHT_SIDE: int = 1
RAYGUI_ICON_SIZE: int = 16
@ -149,6 +165,7 @@ 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_MIN_MOUSE_WHEEL_SPEED: int = 20
RAYGUI_TOGGLEGROUP_MAX_ITEMS: int = 32
RAYGUI_TEXTBOX_AUTO_CURSOR_COOLDOWN: int = 40
RAYGUI_TEXTBOX_AUTO_CURSOR_DELAY: int = 1
@ -423,12 +440,14 @@ 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_SCALE_FRAMEBUFFER: int = 139277
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_WIN32_SHOWDEFAULT: int = 151554
GLFW_WAYLAND_APP_ID: int = 155649
GLFW_NO_API: int = 0
GLFW_OPENGL_API: int = 196609
@ -461,6 +480,8 @@ 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_WAYLAND_PREFER_LIBDECOR: int = 229377
GLFW_WAYLAND_DISABLE_LIBDECOR: int = 229378
GLFW_ANY_POSITION: int = 2147483648
GLFW_ARROW_CURSOR: int = 221185
GLFW_IBEAM_CURSOR: int = 221186
@ -480,6 +501,7 @@ GLFW_PLATFORM: int = 327683
GLFW_COCOA_CHDIR_RESOURCES: int = 331777
GLFW_COCOA_MENUBAR: int = 331778
GLFW_X11_XCB_VULKAN_SURFACE: int = 335873
GLFW_WAYLAND_LIBDECOR: int = 339969
GLFW_ANY_PLATFORM: int = 393216
GLFW_PLATFORM_WIN32: int = 393217
GLFW_PLATFORM_COCOA: int = 393218

View file

@ -136,7 +136,7 @@ class KeyboardKey(IntEnum):
KEY_KP_ENTER = 335
KEY_KP_EQUAL = 336
KEY_BACK = 4
KEY_MENU = 82
KEY_MENU = 5
KEY_VOLUME_UP = 24
KEY_VOLUME_DOWN = 25
@ -230,6 +230,9 @@ class ShaderLocationIndex(IntEnum):
SHADER_LOC_MAP_IRRADIANCE = 23
SHADER_LOC_MAP_PREFILTER = 24
SHADER_LOC_MAP_BRDF = 25
SHADER_LOC_VERTEX_BONEIDS = 26
SHADER_LOC_VERTEX_BONEWEIGHTS = 27
SHADER_LOC_BONE_MATRICES = 28
class ShaderUniformDataType(IntEnum):
SHADER_UNIFORM_FLOAT = 0
@ -294,7 +297,6 @@ class CubemapLayout(IntEnum):
CUBEMAP_LAYOUT_LINE_HORIZONTAL = 2
CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR = 3
CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE = 4
CUBEMAP_LAYOUT_PANORAMA = 5
class FontType(IntEnum):
FONT_DEFAULT = 0
@ -433,6 +435,8 @@ class GuiComboBoxProperty(IntEnum):
class GuiDropdownBoxProperty(IntEnum):
ARROW_PADDING = 16
DROPDOWN_ITEMS_SPACING = 17
DROPDOWN_ARROW_HIDDEN = 18
DROPDOWN_ROLL_UP = 19
class GuiTextBoxProperty(IntEnum):
TEXT_READONLY = 16
@ -446,6 +450,7 @@ class GuiListViewProperty(IntEnum):
LIST_ITEMS_SPACING = 17
SCROLLBAR_WIDTH = 18
SCROLLBAR_SIDE = 19
LIST_ITEMS_BORDER_WIDTH = 20
class GuiColorPickerProperty(IntEnum):
COLOR_SELECTOR_SIZE = 16
@ -675,15 +680,15 @@ class GuiIconName(IntEnum):
ICON_FOLDER = 217
ICON_FILE = 218
ICON_SAND_TIMER = 219
ICON_220 = 220
ICON_221 = 221
ICON_222 = 222
ICON_223 = 223
ICON_224 = 224
ICON_225 = 225
ICON_226 = 226
ICON_227 = 227
ICON_228 = 228
ICON_WARNING = 220
ICON_HELP_BOX = 221
ICON_INFO_BOX = 222
ICON_PRIORITY = 223
ICON_LAYERS_ISO = 224
ICON_LAYERS2 = 225
ICON_MLAYERS = 226
ICON_MAPS = 227
ICON_HOT = 228
ICON_229 = 229
ICON_230 = 230
ICON_231 = 231

View file

@ -169,9 +169,11 @@
*
* @ingroup input
* @{ */
/*! @ingroup input
*/
/*! @} */
/*! @defgroup keys Keyboard keys
* @brief Keyboard key IDs.
/*! @defgroup keys Keyboard key tokens
* @brief Keyboard key tokens.
*
* See [key input](@ref input_key) for how these are used.
*
@ -193,7 +195,6 @@
* @ingroup input
* @{
*/
/* The unknown key */
/* Printable keys */
/* Function keys */
/*! @} */
@ -420,11 +421,11 @@
*/
/*! @brief Platform unavailable or no matching platform was found.
*
* If emitted during initialization, no matching platform was found. If @ref
* GLFW_PLATFORM is set to `GLFW_ANY_PLATFORM`, GLFW could not detect any of the
* platforms supported by this library binary, except for the Null platform. If set to
* a specific platform, it is either not supported by this library binary or GLFW was not
* able to detect it.
* If emitted during initialization, no matching platform was found. If the @ref
* GLFW_PLATFORM init hint was set to `GLFW_ANY_PLATFORM`, GLFW could not detect any of
* the platforms supported by this library binary, except for the Null platform. If the
* init hint was set to a specific platform, it is either not supported by this library
* binary or GLFW was not able to detect it.
*
* If emitted by a native access function, GLFW was initialized for a different platform
* than the function is for.
@ -640,8 +641,14 @@
/*! @brief Window content area scaling window
* [window hint](@ref GLFW_SCALE_TO_MONITOR).
*/
/*! @brief macOS specific
* [window hint](@ref GLFW_COCOA_RETINA_FRAMEBUFFER_hint).
/*! @brief Window framebuffer scaling
* [window hint](@ref GLFW_SCALE_FRAMEBUFFER_hint).
*/
/*! @brief Legacy name for compatibility.
*
* This is an alias for the
* [GLFW_SCALE_FRAMEBUFFER](@ref GLFW_SCALE_FRAMEBUFFER_hint) window hint for
* compatibility with earlier versions.
*/
/*! @brief macOS specific
* [window hint](@ref GLFW_COCOA_FRAME_NAME_hint).
@ -655,6 +662,8 @@
/*! @brief X11 specific
* [window hint](@ref GLFW_X11_CLASS_NAME_hint).
*/
/*! @brief Win32 specific [window hint](@ref GLFW_WIN32_SHOWDEFAULT_hint).
*/
/*! @brief Wayland specific
* [window hint](@ref GLFW_WAYLAND_APP_ID_hint).
*
@ -703,11 +712,11 @@
* @note @macos This shape is provided by a private system API and may fail
* with @ref GLFW_CURSOR_UNAVAILABLE in the future.
*
* @note @x11 This shape is provided by a newer standard not supported by all
* cursor themes.
*
* @note @wayland This shape is provided by a newer standard not supported by
* all cursor themes.
*
* @note @x11 This shape is provided by a newer standard not supported by all
* cursor themes.
*/
/*! @brief The top-right to bottom-left diagonal resize/move arrow shape.
*
@ -717,11 +726,11 @@
* @note @macos This shape is provided by a private system API and may fail
* with @ref GLFW_CURSOR_UNAVAILABLE in the future.
*
* @note @x11 This shape is provided by a newer standard not supported by all
* cursor themes.
*
* @note @wayland This shape is provided by a newer standard not supported by
* all cursor themes.
*
* @note @x11 This shape is provided by a newer standard not supported by all
* cursor themes.
*/
/*! @brief The omni-directional resize/move cursor shape.
*
@ -733,11 +742,11 @@
* The operation-not-allowed shape. This is usually a circle with a diagonal
* line through it.
*
* @note @x11 This shape is provided by a newer standard not supported by all
* cursor themes.
*
* @note @wayland This shape is provided by a newer standard not supported by
* all cursor themes.
*
* @note @x11 This shape is provided by a newer standard not supported by all
* cursor themes.
*/
/*! @brief Legacy name for compatibility.
*
@ -778,6 +787,10 @@
*
* X11 specific [init hint](@ref GLFW_X11_XCB_VULKAN_SURFACE_hint).
*/
/*! @brief Wayland specific init hint.
*
* Wayland specific [init hint](@ref GLFW_WAYLAND_LIBDECOR_hint).
*/
/*! @} */
/*! @addtogroup init
* @{ */
@ -860,16 +873,25 @@ typedef struct GLFWcursor GLFWcursor;
* or `NULL` if allocation failed. Note that not all parts of GLFW handle allocation
* failures gracefully yet.
*
* This function may be called during @ref glfwInit but before the library is
* flagged as initialized, as well as during @ref glfwTerminate after the
* library is no longer flagged as initialized.
* This function must support being called during @ref glfwInit but before the library is
* flagged as initialized, as well as during @ref glfwTerminate after the library is no
* longer flagged as initialized.
*
* Any memory allocated by this function will be deallocated during library
* termination or earlier.
* Any memory allocated via this function will be deallocated via the same allocator
* during library termination or earlier.
*
* Any memory allocated via this function must be suitably aligned for any object type.
* If you are using C99 or earlier, this alignment is platform-dependent but will be the
* same as what `malloc` provides. If you are using C11 or later, this is the value of
* `alignof(max_align_t)`.
*
* The size will always be greater than zero. Allocations of size zero are filtered out
* before reaching the custom allocator.
*
* If this function returns `NULL`, GLFW will emit @ref GLFW_OUT_OF_MEMORY.
*
* This function must not call any GLFW function.
*
* @param[in] size The minimum size, in bytes, of the memory block.
* @param[in] user The user-defined pointer from the allocator.
* @return The address of the newly allocated memory block, or `NULL` if an
@ -880,7 +902,8 @@ typedef struct GLFWcursor GLFWcursor;
*
* @reentrancy This function should not call any GLFW function.
*
* @thread_safety This function may be called from any thread that calls GLFW functions.
* @thread_safety This function must support being called from any thread that calls GLFW
* functions.
*
* @sa @ref init_allocator
* @sa @ref GLFWallocator
@ -902,16 +925,26 @@ typedef void* (* GLFWallocatefun)(size_t size, void* user);
* `NULL` if allocation failed. Note that not all parts of GLFW handle allocation
* failures gracefully yet.
*
* This function may be called during @ref glfwInit but before the library is
* flagged as initialized, as well as during @ref glfwTerminate after the
* library is no longer flagged as initialized.
* This function must support being called during @ref glfwInit but before the library is
* flagged as initialized, as well as during @ref glfwTerminate after the library is no
* longer flagged as initialized.
*
* Any memory allocated by this function will be deallocated during library
* termination or earlier.
* Any memory allocated via this function will be deallocated via the same allocator
* during library termination or earlier.
*
* Any memory allocated via this function must be suitably aligned for any object type.
* If you are using C99 or earlier, this alignment is platform-dependent but will be the
* same as what `realloc` provides. If you are using C11 or later, this is the value of
* `alignof(max_align_t)`.
*
* The block address will never be `NULL` and the size will always be greater than zero.
* Reallocations of a block to size zero are converted into deallocations. Reallocations
* of `NULL` to a non-zero size are converted into regular allocations.
* Reallocations of a block to size zero are converted into deallocations before reaching
* the custom allocator. Reallocations of `NULL` to a non-zero size are converted into
* regular allocations before reaching the custom allocator.
*
* If this function returns `NULL`, GLFW will emit @ref GLFW_OUT_OF_MEMORY.
*
* This function must not call any GLFW function.
*
* @param[in] block The address of the memory block to reallocate.
* @param[in] size The new minimum size, in bytes, of the memory block.
@ -924,7 +957,8 @@ typedef void* (* GLFWallocatefun)(size_t size, void* user);
*
* @reentrancy This function should not call any GLFW function.
*
* @thread_safety This function may be called from any thread that calls GLFW functions.
* @thread_safety This function must support being called from any thread that calls GLFW
* functions.
*
* @sa @ref init_allocator
* @sa @ref GLFWallocator
@ -945,13 +979,17 @@ typedef void* (* GLFWreallocatefun)(void* block, size_t size, void* user);
* This function may deallocate the specified memory block. This memory block
* will have been allocated with the same allocator.
*
* This function may be called during @ref glfwInit but before the library is
* flagged as initialized, as well as during @ref glfwTerminate after the
* library is no longer flagged as initialized.
* This function must support being called during @ref glfwInit but before the library is
* flagged as initialized, as well as during @ref glfwTerminate after the library is no
* longer flagged as initialized.
*
* The block address will never be `NULL`. Deallocations of `NULL` are filtered out
* before reaching the custom allocator.
*
* If this function returns `NULL`, GLFW will emit @ref GLFW_OUT_OF_MEMORY.
*
* This function must not call any GLFW function.
*
* @param[in] block The address of the memory block to deallocate.
* @param[in] user The user-defined pointer from the allocator.
*
@ -960,7 +998,8 @@ typedef void* (* GLFWreallocatefun)(void* block, size_t size, void* user);
*
* @reentrancy This function should not call any GLFW function.
*
* @thread_safety This function may be called from any thread that calls GLFW functions.
* @thread_safety This function must support being called from any thread that calls GLFW
* functions.
*
* @sa @ref init_allocator
* @sa @ref GLFWallocator
@ -1503,7 +1542,10 @@ typedef struct GLFWgamepadstate
*/
float axes[6];
} GLFWgamepadstate;
/*! @brief
/*! @brief Custom heap memory allocator.
*
* This describes a custom heap memory allocator for GLFW. To set an allocator, pass it
* to @ref glfwInitAllocator before initializing the library.
*
* @sa @ref init_allocator
* @sa @ref glfwInitAllocator
@ -1514,9 +1556,21 @@ typedef struct GLFWgamepadstate
*/
typedef struct GLFWallocator
{
/*! The memory allocation function. See @ref GLFWallocatefun for details about
* allocation function.
*/
GLFWallocatefun allocate;
/*! The memory reallocation function. See @ref GLFWreallocatefun for details about
* reallocation function.
*/
GLFWreallocatefun reallocate;
/*! The memory deallocation function. See @ref GLFWdeallocatefun for details about
* deallocation function.
*/
GLFWdeallocatefun deallocate;
/*! The user pointer for this custom allocator. This value will be passed to the
* allocator functions.
*/
void* user;
} GLFWallocator;
/*************************************************************************
@ -1558,6 +1612,13 @@ typedef struct GLFWallocator
* and dock icon can be disabled entirely with the @ref GLFW_COCOA_MENUBAR init
* hint.
*
* @remark __Wayland, X11:__ If the library was compiled with support for both
* Wayland and X11, and the @ref GLFW_PLATFORM init hint is set to
* `GLFW_ANY_PLATFORM`, the `XDG_SESSION_TYPE` environment variable affects
* which platform is picked. If the environment variable is not set, or is set
* to something other than `wayland` or `x11`, the regular detection mechanism
* will be used instead.
*
* @remark @x11 This function will set the `LC_CTYPE` category of the
* application locale according to the current environment if that category is
* still "C". This is because the "C" locale breaks Unicode text input.
@ -1643,8 +1704,12 @@ typedef struct GLFWallocator
* To use the default allocator, call this function with a `NULL` argument.
*
* If you specify an allocator struct, every member must be a valid function
* pointer. If any member is `NULL`, this function emits @ref
* GLFW_INVALID_VALUE and the init allocator is unchanged.
* pointer. If any member is `NULL`, this function will emit @ref
* GLFW_INVALID_VALUE and the init allocator will be unchanged.
*
* The functions in the allocator must fulfil a number of requirements. See the
* documentation for @ref GLFWallocatefun, @ref GLFWreallocatefun and @ref
* GLFWdeallocatefun for details.
*
* @param[in] allocator The allocator to use at the next initialization, or
* `NULL` to use the default one.
@ -1952,9 +2017,10 @@ typedef struct GLFWallocator
* specified monitor.
*
* Some platforms do not provide accurate monitor size information, either
* because the monitor
* [EDID](https://en.wikipedia.org/wiki/Extended_display_identification_data)
* data is incorrect or because the driver does not report it accurately.
* because the monitor [EDID][] data is incorrect or because the driver does
* not report it accurately.
*
* [EDID]: https://en.wikipedia.org/wiki/Extended_display_identification_data
*
* Any or all of the size arguments may be `NULL`. If an error occurs, all
* non-`NULL` size arguments will be set to zero.
@ -2000,6 +2066,9 @@ typedef struct GLFWallocator
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @remark @wayland Fractional scaling information is not yet available for
* monitors, so this function only returns integer content scales.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref monitor_scale
@ -2189,11 +2258,11 @@ typedef struct GLFWallocator
* @param[in] monitor The monitor whose gamma ramp to set.
* @param[in] gamma The desired exponent.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref GLFW_INVALID_VALUE,
* @ref GLFW_PLATFORM_ERROR and @ref GLFW_FEATURE_UNAVAILABLE (see remarks).
*
* @remark @wayland Gamma handling is a privileged protocol, this function
* will thus never be implemented and emits @ref GLFW_PLATFORM_ERROR.
* will thus never be implemented and emits @ref GLFW_FEATURE_UNAVAILABLE.
*
* @thread_safety This function must only be called from the main thread.
*
@ -2212,11 +2281,11 @@ typedef struct GLFWallocator
* @return The current gamma ramp, or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref GLFW_PLATFORM_ERROR
* and @ref GLFW_FEATURE_UNAVAILABLE (see remarks).
*
* @remark @wayland Gamma handling is a privileged protocol, this function
* will thus never be implemented and emits @ref GLFW_PLATFORM_ERROR while
* will thus never be implemented and emits @ref GLFW_FEATURE_UNAVAILABLE while
* returning `NULL`.
*
* @pointer_lifetime The returned structure and its arrays are allocated and
@ -2250,8 +2319,8 @@ typedef struct GLFWallocator
* @param[in] monitor The monitor whose gamma ramp to set.
* @param[in] ramp The gamma ramp to use.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref GLFW_PLATFORM_ERROR
* and @ref GLFW_FEATURE_UNAVAILABLE (see remarks).
*
* @remark The size of the specified gamma ramp should match the size of the
* current ramp for that monitor.
@ -2259,7 +2328,7 @@ typedef struct GLFWallocator
* @remark @win32 The gamma ramp size must be 256.
*
* @remark @wayland Gamma handling is a privileged protocol, this function
* will thus never be implemented and emits @ref GLFW_PLATFORM_ERROR.
* will thus never be implemented and emits @ref GLFW_FEATURE_UNAVAILABLE.
*
* @pointer_lifetime The specified gamma ramp is copied before this function
* returns.
@ -2427,8 +2496,8 @@ typedef struct GLFWallocator
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_INVALID_ENUM, @ref GLFW_INVALID_VALUE, @ref GLFW_API_UNAVAILABLE, @ref
* GLFW_VERSION_UNAVAILABLE, @ref GLFW_FORMAT_UNAVAILABLE and @ref
* GLFW_PLATFORM_ERROR.
* GLFW_VERSION_UNAVAILABLE, @ref GLFW_FORMAT_UNAVAILABLE, @ref
* GLFW_NO_WINDOW_CONTEXT and @ref GLFW_PLATFORM_ERROR.
*
* @remark @win32 Window creation will fail if the Microsoft GDI software
* OpenGL implementation is the only one available.
@ -2450,23 +2519,35 @@ typedef struct GLFWallocator
* @remark @macos The GLFW window has no icon, as it is not a document
* window, but the dock icon will be the same as the application bundle's icon.
* For more information on bundles, see the
* [Bundle Programming Guide](https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/)
* in the Mac Developer Library.
* [Bundle Programming Guide][bundle-guide] in the Mac Developer Library.
*
* [bundle-guide]: https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/
*
* @remark @macos On OS X 10.10 and later the window frame will not be rendered
* at full resolution on Retina displays unless the
* [GLFW_COCOA_RETINA_FRAMEBUFFER](@ref GLFW_COCOA_RETINA_FRAMEBUFFER_hint)
* [GLFW_SCALE_FRAMEBUFFER](@ref GLFW_SCALE_FRAMEBUFFER_hint)
* hint is `GLFW_TRUE` and the `NSHighResolutionCapable` key is enabled in the
* application bundle's `Info.plist`. For more information, see
* [High Resolution Guidelines for OS X](https://developer.apple.com/library/mac/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Explained/Explained.html)
* in the Mac Developer Library. The GLFW test and example programs use
* a custom `Info.plist` template for this, which can be found as
* `CMake/Info.plist.in` in the source tree.
* [High Resolution Guidelines for OS X][hidpi-guide] in the Mac Developer
* Library. The GLFW test and example programs use a custom `Info.plist`
* template for this, which can be found as `CMake/Info.plist.in` in the source
* tree.
*
* [hidpi-guide]: https://developer.apple.com/library/mac/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Explained/Explained.html
*
* @remark @macos When activating frame autosaving with
* [GLFW_COCOA_FRAME_NAME](@ref GLFW_COCOA_FRAME_NAME_hint), the specified
* window size and position may be overridden by previously saved values.
*
* @remark @wayland GLFW uses [libdecor][] where available to create its window
* decorations. This in turn uses server-side XDG decorations where available
* and provides high quality client-side decorations on compositors like GNOME.
* If both XDG decorations and libdecor are unavailable, GLFW falls back to
* a very simple set of window decorations that only support moving, resizing
* and the window manager's right-click menu.
*
* [libdecor]: https://gitlab.freedesktop.org/libdecor/libdecor
*
* @remark @x11 Some window managers will not respect the placement of
* initially hidden windows.
*
@ -2483,20 +2564,6 @@ typedef struct GLFWallocator
* [GLFW_X11_INSTANCE_NAME](@ref GLFW_X11_INSTANCE_NAME_hint) window hints to
* override this.
*
* @remark @wayland Compositors should implement the xdg-decoration protocol
* for GLFW to decorate the window properly. If this protocol isn't
* supported, or if the compositor prefers client-side decorations, a very
* simple fallback frame will be drawn using the wp_viewporter protocol. A
* compositor can still emit close, maximize or fullscreen events, using for
* instance a keybind mechanism. If neither of these protocols is supported,
* the window won't be decorated.
*
* @remark @wayland A full screen window will not attempt to change the mode,
* no matter what the requested size or refresh rate.
*
* @remark @wayland Screensaver inhibition requires the idle-inhibit protocol
* to be implemented in the user's compositor.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_creation
@ -2575,6 +2642,37 @@ typedef struct GLFWallocator
* @ingroup window
*/
void glfwSetWindowShouldClose(GLFWwindow* window, int value);
/*! @brief Returns the title of the specified window.
*
* This function returns the window title, encoded as UTF-8, of the specified
* window. This is the title set previously by @ref glfwCreateWindow
* or @ref glfwSetWindowTitle.
*
* @param[in] window The window to query.
* @return The UTF-8 encoded window title, or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @remark The returned title is currently a copy of the title last set by @ref
* glfwCreateWindow or @ref glfwSetWindowTitle. It does not include any
* additional text which may be appended by the platform or another program.
*
* @pointer_lifetime The returned string is allocated and freed by GLFW. You
* should not free it yourself. It is valid until the next call to @ref
* glfwGetWindowTitle or @ref glfwSetWindowTitle, or until the library is
* terminated.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_title
* @sa @ref glfwSetWindowTitle
*
* @since Added in version 3.4.
*
* @ingroup window
*/
const char* glfwGetWindowTitle(GLFWwindow* window);
/*! @brief Sets the title of the specified window.
*
* This function sets the window title, encoded as UTF-8, of the specified
@ -2592,6 +2690,7 @@ typedef struct GLFWallocator
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_title
* @sa @ref glfwGetWindowTitle
*
* @since Added in version 1.0.
* @glfw3 Added window handle parameter.
@ -2630,8 +2729,9 @@ typedef struct GLFWallocator
* @remark @macos Regular windows do not have icons on macOS. This function
* will emit @ref GLFW_FEATURE_UNAVAILABLE. The dock icon will be the same as
* the application bundle's icon. For more information on bundles, see the
* [Bundle Programming Guide](https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/)
* in the Mac Developer Library.
* [Bundle Programming Guide][bundle-guide] in the Mac Developer Library.
*
* [bundle-guide]: https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/
*
* @remark @wayland There is no existing protocol to change an icon, the
* window will thus inherit the one defined in the application's desktop file.
@ -2849,9 +2949,6 @@ typedef struct GLFWallocator
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @remark @wayland A full screen window will not attempt to change the mode,
* no matter what the requested size.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_size
@ -3172,11 +3269,11 @@ typedef struct GLFWallocator
*
* @param[in] window The window to give input focus.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_PLATFORM_ERROR and @ref GLFW_FEATURE_UNAVAILABLE (see remarks).
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @remark @wayland It is not possible for an application to set the input
* focus. This function will emit @ref GLFW_FEATURE_UNAVAILABLE.
* @remark @wayland The compositor will likely ignore focus requests unless
* another window created by the same application already has input focus.
*
* @thread_safety This function must only be called from the main thread.
*
@ -3278,9 +3375,6 @@ typedef struct GLFWallocator
* @remark @wayland The desired window position is ignored, as there is no way
* for an application to set this property.
*
* @remark @wayland Setting the window to full screen will not attempt to
* change the mode, no matter what the requested size or refresh rate.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_monitor
@ -3351,11 +3445,15 @@ typedef struct GLFWallocator
* @param[in] value `GLFW_TRUE` or `GLFW_FALSE`.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_INVALID_ENUM, @ref GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.
* GLFW_INVALID_ENUM, @ref GLFW_INVALID_VALUE, @ref GLFW_PLATFORM_ERROR and @ref
* GLFW_FEATURE_UNAVAILABLE (see remarks).
*
* @remark Calling @ref glfwGetWindowAttrib will always return the latest
* value, even if that value is ignored by the current mode of the window.
*
* @remark @wayland The [GLFW_FLOATING](@ref GLFW_FLOATING_attrib) window attribute is
* not supported. Setting this will emit @ref GLFW_FEATURE_UNAVAILABLE.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_attribs
@ -4011,8 +4109,8 @@ typedef struct GLFWallocator
* @param[in] scancode The scancode of the key to query.
* @return The UTF-8 encoded, layout-specific name of the key, or `NULL`.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_INVALID_VALUE, @ref GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
*
* @remark The contents of the returned string may change when a keyboard
* layout change event is received.
@ -4033,15 +4131,18 @@ typedef struct GLFWallocator
*
* This function returns the platform-specific scancode of the specified key.
*
* If the key is `GLFW_KEY_UNKNOWN` or does not exist on the keyboard this
* method will return `-1`.
* If the specified [key token](@ref keys) corresponds to a physical key not
* supported on the current platform then this method will return `-1`.
* Calling this function with anything other than a key token will return `-1`
* and generate a @ref GLFW_INVALID_ENUM error.
*
* @param[in] key Any [named key](@ref keys).
* @return The platform-specific scancode for the key, or `-1` if an
* [error](@ref error_handling) occurred.
* @param[in] key Any [key token](@ref keys).
* @return The platform-specific scancode for the key, or `-1` if the key is
* not supported on the current platform or an [error](@ref error_handling)
* occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_INVALID_ENUM.
*
* @thread_safety This function may be called from any thread.
*
@ -4178,11 +4279,11 @@ typedef struct GLFWallocator
* @param[in] ypos The desired y-coordinate, relative to the top edge of the
* content area.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_PLATFORM_ERROR and @ref GLFW_FEATURE_UNAVAILABLE (see remarks).
*
* @remark @wayland This function will only work when the cursor mode is
* `GLFW_CURSOR_DISABLED`, otherwise it will do nothing.
* `GLFW_CURSOR_DISABLED`, otherwise it will emit @ref GLFW_FEATURE_UNAVAILABLE.
*
* @thread_safety This function must only be called from the main thread.
*
@ -4341,9 +4442,9 @@ typedef struct GLFWallocator
* [character callback](@ref glfwSetCharCallback) instead.
*
* When a window loses input focus, it will generate synthetic key release
* events for all pressed keys. You can tell these events from user-generated
* events by the fact that the synthetic ones are generated after the focus
* loss event has been processed, i.e. after the
* events for all pressed keys with associated key tokens. You can tell these
* events from user-generated events by the fact that the synthetic ones are
* generated after the focus loss event has been processed, i.e. after the
* [window focus callback](@ref glfwSetWindowFocusCallback) has been called.
*
* The scancode of a key is specific to that platform or sometimes even to that
@ -4617,8 +4718,6 @@ typedef struct GLFWallocator
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @remark @wayland File drop is currently unimplemented.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref path_drop
@ -5071,6 +5170,11 @@ typedef struct GLFWallocator
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @remark @win32 The clipboard on Windows has a single global lock for reading and
* writing. GLFW tries to acquire it a few times, which is almost always enough. If it
* cannot acquire the lock then this function emits @ref GLFW_PLATFORM_ERROR and returns.
* It is safe to try this multiple times.
*
* @pointer_lifetime The specified string is copied before this function
* returns.
*
@ -5098,6 +5202,11 @@ typedef struct GLFWallocator
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_FORMAT_UNAVAILABLE and @ref GLFW_PLATFORM_ERROR.
*
* @remark @win32 The clipboard on Windows has a single global lock for reading and
* writing. GLFW tries to acquire it a few times, which is almost always enough. If it
* cannot acquire the lock then this function emits @ref GLFW_PLATFORM_ERROR and returns.
* It is safe to try this multiple times.
*
* @pointer_lifetime The returned string is allocated and freed by GLFW. You
* should not free it yourself. It is valid until the next call to @ref
* glfwGetClipboardString or @ref glfwSetClipboardString, or until the library
@ -5215,12 +5324,15 @@ typedef struct GLFWallocator
* thread.
*
* This function makes the OpenGL or OpenGL ES context of the specified window
* current on the calling thread. A context must only be made current on
* a single thread at a time and each thread can have only a single current
* context at a time.
* current on the calling thread. It can also detach the current context from
* the calling thread without making a new one current by passing in `NULL`.
*
* When moving a context between threads, you must make it non-current on the
* old thread before making it current on the new one.
* A context must only be made current on a single thread at a time and each
* thread can have only a single current context at a time. Making a context
* current detaches any previously current context on the calling thread.
*
* When moving a context between threads, you must detach it (make it
* non-current) on the old thread before making it current on the new one.
*
* By default, making a context non-current implicitly forces a pipeline flush.
* On machines that support `GL_KHR_context_flush_control`, you can control
@ -5235,6 +5347,10 @@ typedef struct GLFWallocator
* @param[in] window The window whose context to make current, or `NULL` to
* detach the current context.
*
* @remarks If the previously current context was created via a different
* context creation API than the one passed to this function, GLFW will still
* detach the previous one from its API before making the new one current.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_NO_WINDOW_CONTEXT and @ref GLFW_PLATFORM_ERROR.
*

View file

@ -1,6 +1,6 @@
/*******************************************************************************************
*
* raygui v4.0 - A simple and easy-to-use immediate-mode gui library
* raygui v4.5-dev - 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
@ -26,7 +26,7 @@
* 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
* no unload function is explicitly provided... but note that GuiLoadStyleDefault() unloads
* by default any previously loaded font (texture, recs, glyphs).
* - Global UI alpha (guiAlpha) is applied inside GuiDrawRectangle() and GuiDrawText() functions
*
@ -136,11 +136,29 @@
*
* #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.5-dev (Sep-2024) Current dev version...
* ADDED: guiControlExclusiveMode and guiControlExclusiveRec for exclusive modes
* ADDED: GuiValueBoxFloat()
* ADDED: GuiDropdonwBox() properties: DROPDOWN_ARROW_HIDDEN, DROPDOWN_ROLL_UP
* ADDED: GuiListView() property: LIST_ITEMS_BORDER_WIDTH
* ADDED: Multiple new icons
* REVIEWED: GuiTabBar(), close tab with mouse middle button
* REVIEWED: GuiScrollPanel(), scroll speed proportional to content
* REVIEWED: GuiDropdownBox(), support roll up and hidden arrow
* REVIEWED: GuiTextBox(), cursor position initialization
* REVIEWED: GuiSliderPro(), control value change check
* REVIEWED: GuiGrid(), simplified implementation
* REVIEWED: GuiIconText(), increase buffer size and reviewed padding
* REVIEWED: GuiDrawText(), improved wrap mode drawing
* REVIEWED: GuiScrollBar(), minor tweaks
* REVIEWED: Functions descriptions, removed wrong return value reference
* REDESIGNED: GuiColorPanel(), improved HSV <-> RGBA convertion
*
* 4.0 (12-Sep-2023) ADDED: GuiToggleSlider()
* ADDED: GuiColorPickerHSV() and GuiColorPanelHSV()
* ADDED: Multiple new icons, mostly compiler related
@ -246,7 +264,7 @@
* 0.8 (27-Aug-2015) Initial release. Implemented by Kevin Gato, Daniel Nicolás and Ramon Santamaria.
*
* DEPENDENCIES:
* raylib 4.6-dev Inputs reading (keyboard/mouse), shapes drawing, font loading and text drawing
* raylib 5.0 - 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
@ -291,7 +309,7 @@
*
* LICENSE: zlib/libpng
*
* Copyright (c) 2014-2023 Ramon Santamaria (@raysan5)
* Copyright (c) 2014-2024 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.
@ -431,11 +449,11 @@ typedef enum {
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
//TEXT_DECORATION_THICK // Text decoration line thickness
} GuiDefaultProperty;
// Other possible text properties:
// TEXT_WEIGHT // Normal, Italic, Bold -> Requires specific font change
// TEXT_INDENT // Text indentation -> Now using TEXT_PADDING...
// TEXT_INDENT // Text indentation -> Now using TEXT_PADDING...
// Label
//typedef enum { } GuiLabelProperty;
// Button/Spinner
@ -474,7 +492,9 @@ typedef enum {
// DropdownBox
typedef enum {
ARROW_PADDING = 16, // DropdownBox arrow separation from border and items
DROPDOWN_ITEMS_SPACING // DropdownBox items separation
DROPDOWN_ITEMS_SPACING, // DropdownBox items separation
DROPDOWN_ARROW_HIDDEN, // DropdownBox arrow hidden
DROPDOWN_ROLL_UP // DropdownBox roll up flag (default rolls down)
} GuiDropdownBoxProperty;
// TextBox/TextBoxMulti/ValueBox/Spinner
typedef enum {
@ -491,6 +511,7 @@ typedef enum {
LIST_ITEMS_SPACING, // ListView items separation
SCROLLBAR_WIDTH, // ListView scrollbar size (usually width)
SCROLLBAR_SIDE, // ListView scrollbar side (0-SCROLLBAR_LEFT_SIDE, 1-SCROLLBAR_RIGHT_SIDE)
LIST_ITEMS_BORDER_WIDTH // ListView items border width
} GuiListViewProperty;
// ColorPicker
typedef enum {
@ -545,26 +566,27 @@ typedef enum {
/* 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 GuiLabel(Rectangle bounds, const char *text); // Label control
/* 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 GuiLabelButton(Rectangle bounds, const char *text); // Label button control, returns true when clicked
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiToggle(Rectangle bounds, const char *text, bool *active); // Toggle Button control
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiToggleGroup(Rectangle bounds, const char *text, int *active); // Toggle Group control
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiToggleSlider(Rectangle bounds, const char *text, int *active); // Toggle Slider control
/* 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 GuiComboBox(Rectangle bounds, const char *text, int *active); // Combo Box control
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiDropdownBox(Rectangle bounds, const char *text, int *active, bool editMode); // Dropdown Box control
/* 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
/* 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 GuiValueBoxFloat(Rectangle bounds, const char *text, char *textValue, float *value, bool editMode); // Value box control for float values
/* 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 GuiSlider(Rectangle bounds, const char *textLeft, const char *textRight, float *value, float minValue, float maxValue); // Slider control
/* 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
/* 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
/* 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
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiGrid(Rectangle bounds, const char *text, float spacing, int subdivs, Vector2 *mouseCell); // Grid control
// 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 GuiListView(Rectangle bounds, const char *text, int *scrollIndex, int *active); // List View control
/* 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
@ -573,7 +595,7 @@ typedef enum {
/* 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()
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiColorPanelHSV(Rectangle bounds, const char *text, Vector3 *colorHsv); // Color Panel control that updates Hue-Saturation-Value color value, used by GuiColorPickerHSV()
//----------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------
// Icons enumeration
@ -799,15 +821,15 @@ typedef enum {
ICON_FOLDER = 217,
ICON_FILE = 218,
ICON_SAND_TIMER = 219,
ICON_220 = 220,
ICON_221 = 221,
ICON_222 = 222,
ICON_223 = 223,
ICON_224 = 224,
ICON_225 = 225,
ICON_226 = 226,
ICON_227 = 227,
ICON_228 = 228,
ICON_WARNING = 220,
ICON_HELP_BOX = 221,
ICON_INFO_BOX = 222,
ICON_PRIORITY = 223,
ICON_LAYERS_ISO = 224,
ICON_LAYERS2 = 225,
ICON_MLAYERS = 226,
ICON_MAPS = 227,
ICON_HOT = 228,
ICON_229 = 229,
ICON_230 = 230,
ICON_231 = 231,

View file

@ -1,22 +1,22 @@
/**********************************************************************************************
*
* raylib v5.0 - A simple and easy-to-use library to enjoy videogames programming (www.raylib.com)
* raylib v5.5 - A simple and easy-to-use library to enjoy videogames programming (www.raylib.com)
*
* FEATURES:
* - NO external dependencies, all required libraries included with raylib
* - Multiplatform: Windows, Linux, FreeBSD, OpenBSD, NetBSD, DragonFly,
* MacOS, Haiku, Android, Raspberry Pi, DRM native, HTML5.
* - Written in plain C code (C99) in PascalCase/camelCase notation
* - Hardware accelerated with OpenGL (1.1, 2.1, 3.3, 4.3 or ES2 - choose at compile)
* - Hardware accelerated with OpenGL (1.1, 2.1, 3.3, 4.3, ES2, ES3 - choose at compile)
* - Unique OpenGL abstraction layer (usable as standalone module): [rlgl]
* - Multiple Fonts formats supported (TTF, XNA fonts, AngelCode fonts)
* - Multiple Fonts formats supported (TTF, OTF, FNT, BDF, Sprite fonts)
* - Outstanding texture formats support, including compressed formats (DXT, ETC, ASTC)
* - Full 3d support for 3d Shapes, Models, Billboards, Heightmaps and more!
* - Flexible Materials system, supporting classic maps and PBR maps
* - Animated 3D models supported (skeletal bones animation) (IQM)
* - Animated 3D models supported (skeletal bones animation) (IQM, M3D, GLTF)
* - Shaders support, including Model shaders and Postprocessing shaders
* - Powerful math module for Vector, Matrix and Quaternion operations: [raymath]
* - Audio loading and playing with streaming support (WAV, OGG, MP3, FLAC, XM, MOD)
* - Audio loading and playing with streaming support (WAV, OGG, MP3, FLAC, QOA, XM, MOD)
* - VR stereo rendering with configurable HMD device parameters
* - Bindings to multiple programming languages available!
*
@ -27,29 +27,35 @@
* - One default RenderBatch is loaded on rlglInit()->rlLoadRenderBatch() [rlgl] (OpenGL 3.3 or ES2)
*
* DEPENDENCIES (included):
* [rcore] rglfw (Camilla Löwy - github.com/glfw/glfw) for window/context management and input (PLATFORM_DESKTOP)
* [rlgl] glad (David Herberth - github.com/Dav1dde/glad) for OpenGL 3.3 extensions loading (PLATFORM_DESKTOP)
* [rcore][GLFW] rglfw (Camilla Löwy - github.com/glfw/glfw) for window/context management and input
* [rcore][RGFW] rgfw (ColleagueRiley - github.com/ColleagueRiley/RGFW) for window/context management and input
* [rlgl] glad/glad_gles2 (David Herberth - github.com/Dav1dde/glad) for OpenGL 3.3 extensions loading
* [raudio] miniaudio (David Reid - github.com/mackron/miniaudio) for audio device/context management
*
* OPTIONAL DEPENDENCIES (included):
* [rcore] msf_gif (Miles Fogle) for GIF recording
* [rcore] sinfl (Micha Mettke) for DEFLATE decompression algorithm
* [rcore] sdefl (Micha Mettke) for DEFLATE compression algorithm
* [rcore] rprand (Ramon Snatamaria) for pseudo-random numbers generation
* [rtextures] qoi (Dominic Szablewski - https://phoboslab.org) for QOI image manage
* [rtextures] stb_image (Sean Barret) for images loading (BMP, TGA, PNG, JPEG, HDR...)
* [rtextures] stb_image_write (Sean Barret) for image writing (BMP, TGA, PNG, JPG)
* [rtextures] stb_image_resize (Sean Barret) for image resizing algorithms
* [rtextures] stb_image_resize2 (Sean Barret) for image resizing algorithms
* [rtextures] stb_perlin (Sean Barret) for Perlin Noise image generation
* [rtext] stb_truetype (Sean Barret) for ttf fonts loading
* [rtext] stb_rect_pack (Sean Barret) for rectangles packing
* [rmodels] par_shapes (Philip Rideout) for parametric 3d shapes generation
* [rmodels] tinyobj_loader_c (Syoyo Fujita) for models loading (OBJ, MTL)
* [rmodels] cgltf (Johannes Kuhlmann) for models loading (glTF)
* [rmodels] Model3D (bzt) for models loading (M3D, https://bztsrc.gitlab.io/model3d)
* [rmodels] m3d (bzt) for models loading (M3D, https://bztsrc.gitlab.io/model3d)
* [rmodels] vox_loader (Johann Nadalutti) for models loading (VOX)
* [raudio] dr_wav (David Reid) for WAV audio file loading
* [raudio] dr_flac (David Reid) for FLAC audio file loading
* [raudio] dr_mp3 (David Reid) for MP3 audio file loading
* [raudio] stb_vorbis (Sean Barret) for OGG audio loading
* [raudio] jar_xm (Joshua Reisenauer) for XM audio module loading
* [raudio] jar_mod (Joshua Reisenauer) for MOD audio module loading
* [raudio] qoa (Dominic Szablewski - https://phoboslab.org) for QOA audio manage
*
*
* LICENSE: zlib/libpng
@ -57,7 +63,7 @@
* raylib 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) 2013-2023 Ramon Santamaria (@raysan5)
* Copyright (c) 2013-2024 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.
@ -75,8 +81,9 @@
* 3. This notice may not be removed or altered from any source distribution.
*
**********************************************************************************************/
// Function specifiers in case library is build/used as a shared library (Windows)
// Function specifiers in case library is build/used as a shared library
// NOTE: Microsoft specifiers to tell compiler that symbols are imported/exported from a .dll
// NOTE: visibility("default") attribute makes symbols "visible" when compiled with -fvisibility=hidden
//----------------------------------------------------------------------------------
// Some basic Defines
//----------------------------------------------------------------------------------
@ -224,8 +231,10 @@ typedef struct Mesh {
// Animation vertex data
float *animVertices; // Animated vertex positions (after bones transformations)
float *animNormals; // Animated normals (after bones transformations)
unsigned char *boneIds; // Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning)
float *boneWeights; // Vertex bone weight, up to 4 bones influence by vertex (skinning)
unsigned char *boneIds; // Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning) (shader-location = 6)
float *boneWeights; // Vertex bone weight, up to 4 bones influence by vertex (skinning) (shader-location = 7)
Matrix *boneMatrices; // Bones animated transformation matrices
int boneCount; // Number of bones
// OpenGL identifiers
unsigned int vaoId; // OpenGL Vertex Array Object id
unsigned int *vboId; // OpenGL Vertex Buffer Objects id (default vertex data)
@ -282,7 +291,7 @@ typedef struct ModelAnimation {
// Ray, ray for raycasting
typedef struct Ray {
Vector3 position; // Ray position (origin)
Vector3 direction; // Ray direction
Vector3 direction; // Ray direction (normalized)
} Ray;
// RayCollision, ray hit information
typedef struct RayCollision {
@ -335,7 +344,6 @@ typedef struct VrDeviceInfo {
int vResolution; // Vertical resolution in pixels
float hScreenSize; // Horizontal size in meters
float vScreenSize; // Vertical size in meters
float vScreenCenter; // Screen center in meters
float eyeToScreenDistance; // Distance between eye and display in meters
float lensSeparationDistance; // Lens separation distance in meters
float interpupillaryDistance; // IPD (distance between pupils) in meters
@ -522,7 +530,7 @@ typedef enum {
KEY_KP_EQUAL = 336, // Key: Keypad =
// Android key buttons
KEY_BACK = 4, // Key: Android back button
KEY_MENU = 82, // Key: Android menu button
KEY_MENU = 5, // Key: Android menu button
KEY_VOLUME_UP = 24, // Key: Android volume up button
KEY_VOLUME_DOWN = 25 // Key: Android volume down button
} KeyboardKey;
@ -559,12 +567,12 @@ typedef enum {
GAMEPAD_BUTTON_LEFT_FACE_DOWN, // Gamepad left DPAD down button
GAMEPAD_BUTTON_LEFT_FACE_LEFT, // Gamepad left DPAD left button
GAMEPAD_BUTTON_RIGHT_FACE_UP, // Gamepad right button up (i.e. PS3: Triangle, Xbox: Y)
GAMEPAD_BUTTON_RIGHT_FACE_RIGHT, // Gamepad right button right (i.e. PS3: Square, Xbox: X)
GAMEPAD_BUTTON_RIGHT_FACE_RIGHT, // Gamepad right button right (i.e. PS3: Circle, Xbox: B)
GAMEPAD_BUTTON_RIGHT_FACE_DOWN, // Gamepad right button down (i.e. PS3: Cross, Xbox: A)
GAMEPAD_BUTTON_RIGHT_FACE_LEFT, // Gamepad right button left (i.e. PS3: Circle, Xbox: B)
GAMEPAD_BUTTON_RIGHT_FACE_LEFT, // Gamepad right button left (i.e. PS3: Square, Xbox: X)
GAMEPAD_BUTTON_LEFT_TRIGGER_1, // Gamepad top/back trigger left (first), it could be a trailing button
GAMEPAD_BUTTON_LEFT_TRIGGER_2, // Gamepad top/back trigger left (second), it could be a trailing button
GAMEPAD_BUTTON_RIGHT_TRIGGER_1, // Gamepad top/back trigger right (one), it could be a trailing button
GAMEPAD_BUTTON_RIGHT_TRIGGER_1, // Gamepad top/back trigger right (first), it could be a trailing button
GAMEPAD_BUTTON_RIGHT_TRIGGER_2, // Gamepad top/back trigger right (second), it could be a trailing button
GAMEPAD_BUTTON_MIDDLE_LEFT, // Gamepad center buttons, left one (i.e. PS3: Select)
GAMEPAD_BUTTON_MIDDLE, // Gamepad center buttons, middle one (i.e. PS3: PS, Xbox: XBOX)
@ -622,7 +630,10 @@ typedef enum {
SHADER_LOC_MAP_CUBEMAP, // Shader location: samplerCube texture: cubemap
SHADER_LOC_MAP_IRRADIANCE, // Shader location: samplerCube texture: irradiance
SHADER_LOC_MAP_PREFILTER, // Shader location: samplerCube texture: prefilter
SHADER_LOC_MAP_BRDF // Shader location: sampler2d texture: brdf
SHADER_LOC_MAP_BRDF, // Shader location: sampler2d texture: brdf
SHADER_LOC_VERTEX_BONEIDS, // Shader location: vertex attribute: boneIds
SHADER_LOC_VERTEX_BONEWEIGHTS, // Shader location: vertex attribute: boneWeights
SHADER_LOC_BONE_MATRICES // Shader location: array of matrices uniform: boneMatrices
} ShaderLocationIndex;
// Shader uniform data type
typedef enum {
@ -695,8 +706,7 @@ typedef enum {
CUBEMAP_LAYOUT_LINE_VERTICAL, // Layout is defined by a vertical line with faces
CUBEMAP_LAYOUT_LINE_HORIZONTAL, // Layout is defined by a horizontal line with faces
CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR, // Layout is defined by a 3x4 cross with cubemap faces
CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE, // Layout is defined by a 4x3 cross with cubemap faces
CUBEMAP_LAYOUT_PANORAMA // Layout is defined by a panorama image (equirrectangular map)
CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE // Layout is defined by a 4x3 cross with cubemap faces
} CubemapLayout;
// Font type, defines generation method
typedef enum {
@ -732,11 +742,11 @@ typedef enum {
} Gesture;
// Camera system modes
typedef enum {
CAMERA_CUSTOM = 0, // Custom camera
CAMERA_FREE, // Free camera
CAMERA_ORBITAL, // Orbital camera
CAMERA_FIRST_PERSON, // First person camera
CAMERA_THIRD_PERSON // Third person camera
CAMERA_CUSTOM = 0, // Camera custom, controlled by user (UpdateCamera() does nothing)
CAMERA_FREE, // Camera free mode
CAMERA_ORBITAL, // Camera orbital, around target, zoom supported
CAMERA_FIRST_PERSON, // Camera first person
CAMERA_THIRD_PERSON // Camera third person
} CameraMode;
// Camera projection
typedef enum {
@ -750,7 +760,7 @@ typedef enum {
NPATCH_THREE_PATCH_HORIZONTAL // Npatch layout: 3x1 tiles
} NPatchLayout;
// Callbacks to hook some internal functions
// WARNING: These callbacks are intended for advance users
// WARNING: These callbacks are intended for advanced users
typedef void (*TraceLogCallback)(int logLevel, const char *text, void * args); // Logging: Redirect trace log messages
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
@ -769,36 +779,36 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
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)
bool IsWindowMinimized(void); // Check if window is currently minimized (only PLATFORM_DESKTOP)
bool IsWindowMaximized(void); // Check if window is currently maximized (only PLATFORM_DESKTOP)
bool IsWindowFocused(void); // Check if window is currently focused (only PLATFORM_DESKTOP)
bool IsWindowHidden(void); // Check if window is currently hidden
bool IsWindowMinimized(void); // Check if window is currently minimized
bool IsWindowMaximized(void); // Check if window is currently maximized
bool IsWindowFocused(void); // Check if window is currently focused
bool IsWindowResized(void); // Check if window has been resized last frame
bool IsWindowState(unsigned int flag); // Check if one specific window flag is enabled
void SetWindowState(unsigned int flags); // Set window configuration state using flags (only PLATFORM_DESKTOP)
void SetWindowState(unsigned int flags); // Set window configuration state using flags
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 and PLATFORM_WEB)
void SetWindowPosition(int x, int y); // Set window position on screen (only PLATFORM_DESKTOP)
void ToggleFullscreen(void); // Toggle window state: fullscreen/windowed, resizes monitor to match window resolution
void ToggleBorderlessWindowed(void); // Toggle window state: borderless windowed, resizes window to match monitor resolution
void MaximizeWindow(void); // Set window state: maximized, if resizable
void MinimizeWindow(void); // Set window state: minimized, if resizable
void RestoreWindow(void); // Set window state: not minimized/maximized
void SetWindowIcon(Image image); // Set icon for window (single image, RGBA 32bit)
void SetWindowIcons(Image *images, int count); // Set icon for window (multiple images, RGBA 32bit)
void SetWindowTitle(const char *title); // Set title for window
void SetWindowPosition(int x, int y); // Set window position on screen
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 SetWindowOpacity(float opacity); // Set window opacity [0.0f..1.0f]
void SetWindowFocused(void); // Set window focused
void *GetWindowHandle(void); // Get native window handle
int GetScreenWidth(void); // Get current screen width
int GetScreenHeight(void); // Get current screen height
int GetRenderWidth(void); // Get current render width (it considers HiDPI)
int GetRenderHeight(void); // Get current render height (it considers HiDPI)
int GetMonitorCount(void); // Get number of connected monitors
int GetCurrentMonitor(void); // Get current connected monitor
int GetCurrentMonitor(void); // Get current monitor where window is placed
Vector2 GetMonitorPosition(int monitor); // Get specified monitor position
int GetMonitorWidth(int monitor); // Get specified monitor width (current video mode used by monitor)
int GetMonitorHeight(int monitor); // Get specified monitor height (current video mode used by monitor)
@ -810,6 +820,7 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
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
Image GetClipboardImage(void); // Get clipboard image 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
// Cursor-related functions
@ -844,7 +855,7 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
// NOTE: Shader functionality is not available on OpenGL 1.1
Shader LoadShader(const char *vsFileName, const char *fsFileName); // Load shader from files and bind default locations
Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode); // Load shader from code strings and bind default locations
bool IsShaderReady(Shader shader); // Check if a shader is ready
bool IsShaderValid(Shader shader); // Check if a shader is valid (loaded on GPU)
int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location
int GetShaderLocationAttrib(Shader shader, const char *attribName); // Get shader attribute location
void SetShaderValue(Shader shader, int locIndex, const void *value, int uniformType); // Set shader uniform value
@ -853,20 +864,21 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
void SetShaderValueTexture(Shader shader, int locIndex, Texture2D texture); // Set shader uniform value for texture (sampler2d)
void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM)
// Screen-space-related functions
Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Get a ray trace from mouse position
Matrix GetCameraMatrix(Camera camera); // Get camera transform matrix (view matrix)
Matrix GetCameraMatrix2D(Camera2D camera); // Get camera 2d transform matrix
Ray GetScreenToWorldRay(Vector2 position, Camera camera); // Get a ray trace from screen position (i.e mouse)
Ray GetScreenToWorldRayEx(Vector2 position, Camera camera, int width, int height); // Get a ray trace from screen position (i.e mouse) in a viewport
Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Get the screen space position for a 3d world space position
Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera); // Get the world space position for a 2d camera screen space position
Vector2 GetWorldToScreenEx(Vector3 position, Camera camera, int width, int height); // Get size position for a 3d world space position
Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera); // Get the screen space position for a 2d camera world space position
Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera); // Get the world space position for a 2d camera screen space position
Matrix GetCameraMatrix(Camera camera); // Get camera transform matrix (view matrix)
Matrix GetCameraMatrix2D(Camera2D camera); // Get camera 2d transform matrix
// Timing-related functions
void SetTargetFPS(int fps); // Set target FPS (maximum)
float GetFrameTime(void); // Get time in seconds for last frame drawn (delta time)
double GetTime(void); // Get elapsed time in seconds since InitWindow()
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
// NOTE: Those functions are intended for advanced 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)
@ -889,7 +901,7 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
void *MemRealloc(void *ptr, unsigned int size); // Internal memory reallocator
void MemFree(void *ptr); // Internal memory free
// Set custom callbacks
// WARNING: Callbacks setup is intended for advance users
// WARNING: Callbacks setup is intended for advanced users
void SetTraceLogCallback(TraceLogCallback callback); // Set custom trace log
void SetLoadFileDataCallback(LoadFileDataCallback callback); // Set custom file binary data loader
void SetSaveFileDataCallback(SaveFileDataCallback callback); // Set custom file binary data saver
@ -916,10 +928,12 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
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 of the running application (uses static string)
int MakeDirectory(const char *dirPath); // Create directories (including full path requested), returns 0 on success
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
bool IsFileNameValid(const char *fileName); // Check if fileName is valid for the platform/OS
FilePathList LoadDirectoryFiles(const char *dirPath); // Load directory filepaths
FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdirs); // Load directory filepaths with extension filtering and recursive directory scan
FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdirs); // Load directory filepaths with extension filtering and recursive directory scan. Use 'DIR' in the filter string to include directories in the result
void UnloadDirectoryFiles(FilePathList files); // Unload filepaths
bool IsFileDropped(void); // Check if a file has been dropped into window
FilePathList LoadDroppedFiles(void); // Load dropped filepaths
@ -930,9 +944,12 @@ 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()
unsigned int ComputeCRC32(unsigned char *data, int dataSize); // Compute CRC32 hash code
unsigned int *ComputeMD5(unsigned char *data, int dataSize); // Compute MD5 hash code, returns static int[4] (16 bytes)
unsigned int *ComputeSHA1(unsigned char *data, int dataSize); // Compute SHA1 hash code, returns static int[5] (20 bytes)
// 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
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
@ -944,7 +961,7 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
//------------------------------------------------------------------------------------
// 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 IsKeyPressedRepeat(int key); // Check if a key has been pressed again
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
@ -962,6 +979,7 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
int GetGamepadAxisCount(int gamepad); // Get gamepad axis count for a gamepad
float GetGamepadAxisMovement(int gamepad, int axis); // Get axis movement value for a gamepad axis
int SetGamepadMappings(const char *mappings); // Set internal gamepad mappings (SDL_GameControllerDB)
void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration); // Set gamepad vibration for both motors (duration in seconds)
// Input-related functions: mouse
bool IsMouseButtonPressed(int button); // Check if a mouse button has been pressed once
bool IsMouseButtonDown(int button); // Check if a mouse button is being pressed
@ -989,7 +1007,7 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
void SetGesturesEnabled(unsigned int flags); // Enable a set of gestures using flags
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
float GetGestureHoldDuration(void); // Get gesture hold time in seconds
Vector2 GetGestureDragVector(void); // Get gesture drag vector
float GetGestureDragAngle(void); // Get gesture drag angle
Vector2 GetGesturePinchVector(void); // Get gesture pinch delta
@ -1006,18 +1024,20 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
// NOTE: It can be useful when using basic shapes and one single font,
// defining a font char white rectangle would allow drawing everything in a single draw call
void SetShapesTexture(Texture2D texture, Rectangle source); // Set texture and rectangle to be used on shapes drawing
Texture2D GetShapesTexture(void); // Get texture that is used for shapes drawing
Rectangle GetShapesTextureRectangle(void); // Get texture source rectangle that is used for shapes drawing
// Basic shapes drawing functions
void DrawPixel(int posX, int posY, Color color); // Draw a pixel
void DrawPixelV(Vector2 position, Color color); // Draw a pixel (Vector version)
void DrawPixel(int posX, int posY, Color color); // Draw a pixel using geometry [Can be slow, use with care]
void DrawPixelV(Vector2 position, Color color); // Draw a pixel using geometry (Vector version) [Can be slow, use with care]
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 (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 DrawLineStrip(const 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 DrawCircleGradient(int centerX, int centerY, float radius, Color inner, Color outer); // 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)
@ -1029,26 +1049,27 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version)
void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle
void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters
void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a vertical-gradient-filled rectangle
void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a horizontal-gradient-filled rectangle
void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); // Draw a gradient-filled rectangle with custom vertex colors
void DrawRectangleGradientV(int posX, int posY, int width, int height, Color top, Color bottom); // Draw a vertical-gradient-filled rectangle
void DrawRectangleGradientH(int posX, int posY, int width, int height, Color left, Color right); // Draw a horizontal-gradient-filled rectangle
void DrawRectangleGradientEx(Rectangle rec, Color topLeft, Color bottomLeft, Color topRight, Color bottomRight); // Draw a gradient-filled rectangle with custom vertex colors
void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline
void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color); // Draw rectangle outline with extended parameters
void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges
void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, float lineThick, Color color); // Draw rectangle with rounded edges outline
void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle lines with rounded edges
void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, float lineThick, Color color); // Draw rectangle with rounded edges outline
void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!)
void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline (vertex in counter-clockwise order!)
void DrawTriangleFan(Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points (first vertex is the center)
void DrawTriangleStrip(Vector2 *points, int pointCount, Color color); // Draw a triangle strip defined by points
void DrawTriangleFan(const Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points (first vertex is the center)
void DrawTriangleStrip(const Vector2 *points, int pointCount, Color color); // Draw a triangle strip defined by points
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 DrawSplineLinear(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Linear, minimum 2 points
void DrawSplineBasis(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: B-Spline, minimum 4 points
void DrawSplineCatmullRom(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Catmull-Rom, minimum 4 points
void DrawSplineBezierQuadratic(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...]
void DrawSplineBezierCubic(const 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
@ -1064,12 +1085,13 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
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
bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec); // Check collision between circle and rectangle
bool CheckCollisionCircleLine(Vector2 center, float radius, Vector2 p1, Vector2 p2); // Check if circle collides with a line created betweeen two points [p1] and [p2]
bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle
bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius); // Check if point is inside circle
bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); // Check if point is inside a triangle
bool CheckCollisionPointPoly(Vector2 point, Vector2 *points, int pointCount); // Check if point is within a polygon described by array of vertices
bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2 *collisionPoint); // Check the collision between two lines defined by two points each, returns collision point by reference
bool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int threshold); // Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold]
bool CheckCollisionPointPoly(Vector2 point, const Vector2 *points, int pointCount); // Check if point is within a polygon described by array of vertices
bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2 *collisionPoint); // Check the collision between two lines defined by two points each, returns collision point by reference
Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // Get collision rectangle for two rectangles collision
//------------------------------------------------------------------------------------
// Texture Loading and Drawing Functions (Module: textures)
@ -1078,12 +1100,12 @@ 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 LoadImageAnimFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int *frames); // Load image sequence from memory buffer
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
Image LoadImageFromScreen(void); // Load image from screen buffer and (screenshot)
bool IsImageReady(Image image); // Check if an image is ready
bool IsImageValid(Image image); // Check if an image is valid (data and parameters)
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
@ -1101,6 +1123,7 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
// Image manipulation functions
Image ImageCopy(Image image); // Create an image duplicate (useful for transformations)
Image ImageFromImage(Image image, Rectangle rec); // Create an image from another image piece
Image ImageFromChannel(Image image, int selectedChannel); // Create an image from a selected channel of another image (GRAYSCALE)
Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font)
Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Color tint); // Create an image from text (custom sprite font)
void ImageFormat(Image *image, int newFormat); // Convert image data to desired format
@ -1111,6 +1134,7 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image
void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel
void ImageBlurGaussian(Image *image, int blurSize); // Apply Gaussian blur using a box blur approximation
void ImageKernelConvolution(Image *image, const float *kernel, int kernelSize); // Apply custom square convolution kernel to image
void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm)
void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm)
void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); // Resize canvas and fill with color
@ -1140,6 +1164,7 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
void ImageDrawPixelV(Image *dst, Vector2 position, Color color); // Draw pixel within an image (Vector version)
void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw line within an image
void ImageDrawLineV(Image *dst, Vector2 start, Vector2 end, Color color); // Draw line within an image (Vector version)
void ImageDrawLineEx(Image *dst, Vector2 start, Vector2 end, int thick, Color color); // Draw a line defining thickness within an image
void ImageDrawCircle(Image *dst, int centerX, int centerY, int radius, Color color); // Draw a filled circle within an image
void ImageDrawCircleV(Image *dst, Vector2 center, int radius, Color color); // Draw a filled circle within an image (Vector version)
void ImageDrawCircleLines(Image *dst, int centerX, int centerY, int radius, Color color); // Draw circle outline within an image
@ -1148,6 +1173,11 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
void ImageDrawRectangleV(Image *dst, Vector2 position, Vector2 size, Color color); // Draw rectangle within an image (Vector version)
void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color); // Draw rectangle within an image
void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image
void ImageDrawTriangle(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle within an image
void ImageDrawTriangleEx(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color c1, Color c2, Color c3); // Draw triangle with interpolated colors within an image
void ImageDrawTriangleLines(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline within an image
void ImageDrawTriangleFan(Image *dst, Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points within an image (first vertex is the center)
void ImageDrawTriangleStrip(Image *dst, Vector2 *points, int pointCount, Color color); // Draw a triangle strip defined by points within an image
void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); // Draw a source image within a destination image (tint applied to source)
void ImageDrawText(Image *dst, const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) within an image (destination)
void ImageDrawTextEx(Image *dst, Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text (custom sprite font) within an image (destination)
@ -1157,9 +1187,9 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
Texture2D LoadTextureFromImage(Image image); // Load texture from image data
TextureCubemap LoadTextureCubemap(Image image, int layout); // Load cubemap from image, multiple image cubemap layouts supported
RenderTexture2D LoadRenderTexture(int width, int height); // Load texture for rendering (framebuffer)
bool IsTextureReady(Texture2D texture); // Check if a texture is ready
bool IsTextureValid(Texture2D texture); // Check if a texture is valid (loaded in GPU)
void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM)
bool IsRenderTextureReady(RenderTexture2D target); // Check if a render texture is ready
bool IsRenderTextureValid(RenderTexture2D target); // Check if a render texture is valid (loaded in GPU)
void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM)
void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data
void UpdateTextureRec(Texture2D texture, Rectangle rec, const void *pixels); // Update GPU texture rectangle with new data
@ -1175,8 +1205,9 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters
void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draws a texture (or part of it) that stretches or shrinks nicely
// Color/pixel related functions
bool ColorIsEqual(Color col1, Color col2); // Check if two colors are equal
Color Fade(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f
int ColorToInt(Color color); // Get hexadecimal value for a Color
int ColorToInt(Color color); // Get hexadecimal value for a Color (0xRRGGBBAA)
Vector4 ColorNormalize(Color color); // Get Color normalized as float [0..1]
Color ColorFromNormalized(Vector4 normalized); // Get Color from normalized values [0..1]
Vector3 ColorToHSV(Color color); // Get HSV values for a Color, hue [0..360], saturation/value [0..1]
@ -1186,6 +1217,7 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
Color ColorContrast(Color color, float contrast); // Get color with contrast correction, contrast values between -1.0f and 1.0f
Color ColorAlpha(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f
Color ColorAlphaBlend(Color dst, Color src, Color tint); // Get src alpha-blended into dst color with tint
Color ColorLerp(Color color1, Color color2, float factor); // Get color lerp interpolation between two colors, factor [0.0f..1.0f]
Color GetColor(unsigned int hexValue); // Get Color structure from hexadecimal value
Color GetPixelColor(void *srcPtr, int format); // Get Color from a source pixel pointer of certain format
void SetPixelColor(void *dstPtr, Color color, int format); // Set color formatted into destination pixel pointer
@ -1196,10 +1228,10 @@ 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 *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 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 size is provided in pixels height
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 *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
bool IsFontValid(Font font); // Check if a font is valid (font data loaded, WARNING: GPU texture not checked)
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)
@ -1236,7 +1268,7 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
unsigned int TextLength(const char *text); // Get text length, checks for '\0' ending
const char *TextFormat(const char *text, ...); // Text formatting with variables (sprintf() style)
const char *TextSubtext(const char *text, int position, int length); // Get a piece of a text string
char *TextReplace(char *text, const char *replace, const char *by); // Replace text string (WARNING: memory must be freed!)
char *TextReplace(const char *text, const char *replace, const char *by); // Replace text string (WARNING: memory must be freed!)
char *TextInsert(const char *text, const char *insert, int position); // Insert text in a position (WARNING: memory must be freed!)
const char *TextJoin(const char **textList, int count, const char *delimiter); // Join text strings with delimiter
const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings
@ -1245,7 +1277,10 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
const char *TextToUpper(const char *text); // Get upper case version of provided string
const char *TextToLower(const char *text); // Get lower case version of provided string
const char *TextToPascal(const char *text); // Get Pascal case notation version of provided string
const char *TextToSnake(const char *text); // Get Snake case notation version of provided string
const char *TextToCamel(const char *text); // Get Camel case notation version of provided string
int TextToInteger(const char *text); // Get integer value from text (negative values not supported)
float TextToFloat(const char *text); // Get float value from text (negative values not supported)
//------------------------------------------------------------------------------------
// Basic 3d Shapes Drawing Functions (Module: models)
//------------------------------------------------------------------------------------
@ -1254,7 +1289,7 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
void DrawPoint3D(Vector3 position, Color color); // Draw a point in 3D space, actually a small line
void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color); // Draw a circle in 3D world space
void DrawTriangle3D(Vector3 v1, Vector3 v2, Vector3 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!)
void DrawTriangleStrip3D(Vector3 *points, int pointCount, Color color); // Draw a triangle strip defined by points
void DrawTriangleStrip3D(const Vector3 *points, int pointCount, Color color); // Draw a triangle strip defined by points
void DrawCube(Vector3 position, float width, float height, float length, Color color); // Draw cube
void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version)
void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); // Draw cube wires
@ -1277,7 +1312,7 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
// Model management functions
Model LoadModel(const char *fileName); // Load model from files (meshes and materials)
Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh (default material)
bool IsModelReady(Model model); // Check if a model is ready
bool IsModelValid(Model model); // Check if a model is valid (loaded in GPU, VAO/VBOs)
void UnloadModel(Model model); // Unload model (including meshes) from memory (RAM and/or VRAM)
BoundingBox GetModelBoundingBox(Model model); // Compute model bounding box limits (considers all meshes)
// Model drawing functions
@ -1285,8 +1320,10 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters
void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set)
void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters
void DrawModelPoints(Model model, Vector3 position, float scale, Color tint); // Draw a model as points
void DrawModelPointsEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model as points with extended parameters
void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires)
void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float size, Color tint); // Draw a billboard texture
void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float scale, Color tint); // Draw a billboard texture
void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint); // Draw a billboard texture defined by source
void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint); // Draw a billboard texture defined by source and rotation
// Mesh management functions
@ -1295,9 +1332,10 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
void UnloadMesh(Mesh mesh); // Unload mesh data from CPU and GPU
void DrawMesh(Mesh mesh, Material material, Matrix transform); // Draw a 3d mesh with material and transform
void DrawMeshInstanced(Mesh mesh, Material material, const Matrix *transforms, int instances); // Draw multiple mesh instances with material and different transforms
bool ExportMesh(Mesh mesh, const char *fileName); // Export mesh data to file, returns true on success
BoundingBox GetMeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits
void GenMeshTangents(Mesh *mesh); // Compute mesh tangents
bool ExportMesh(Mesh mesh, const char *fileName); // Export mesh data to file, returns true on success
bool ExportMeshAsCode(Mesh mesh, const char *fileName); // Export mesh as code file (.h) defining multiple arrays of vertex attributes
// Mesh generation functions
Mesh GenMeshPoly(int sides, float radius); // Generate polygonal mesh
Mesh GenMeshPlane(float width, float length, int resX, int resZ); // Generate plane mesh (with subdivisions)
@ -1313,13 +1351,14 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
// Material loading/unloading functions
Material *LoadMaterials(const char *fileName, int *materialCount); // Load materials from model file
Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps)
bool IsMaterialReady(Material material); // Check if a material is ready
bool IsMaterialValid(Material material); // Check if a material is valid (shader assigned, map textures loaded in GPU)
void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM)
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, int *animCount); // Load model animations from file
void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose
void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose (CPU)
void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame); // Update model animation mesh bone matrices (GPU skinning)
void UnloadModelAnimation(ModelAnimation anim); // Unload animation data
void UnloadModelAnimations(ModelAnimation *animations, int animCount); // Unload animation array data
bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match
@ -1345,11 +1384,11 @@ typedef void (*AudioCallback)(void *bufferData, unsigned int frames);
// 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
bool IsWaveValid(Wave wave); // Checks if wave data is valid (data loaded and parameters)
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
bool IsSoundValid(Sound sound); // Checks if a sound is valid (data loaded and buffers initialized)
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
@ -1366,14 +1405,14 @@ typedef void (*AudioCallback)(void *bufferData, unsigned int frames);
void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level)
void SetSoundPan(Sound sound, float pan); // Set pan for a sound (0.5 is center)
Wave WaveCopy(Wave wave); // Copy a wave to a new wave
void WaveCrop(Wave *wave, int initSample, int finalSample); // Crop a wave to defined samples range
void WaveCrop(Wave *wave, int initFrame, int finalFrame); // Crop a wave to defined frames range
void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format
float *LoadWaveSamples(Wave wave); // Load samples data from wave as a 32bit float data array
void UnloadWaveSamples(float *samples); // Unload samples data loaded with LoadWaveSamples()
// Music management functions
Music LoadMusicStream(const char *fileName); // Load music stream from file
Music LoadMusicStreamFromMemory(const char *fileType, const unsigned char *data, int dataSize); // Load music stream from data
bool IsMusicReady(Music music); // Checks if a music stream is ready
bool IsMusicValid(Music music); // Checks if a music stream is valid (context and buffers initialized)
void UnloadMusicStream(Music music); // Unload music stream
void PlayMusicStream(Music music); // Start music playing
bool IsMusicStreamPlaying(Music music); // Check if music is playing
@ -1389,7 +1428,7 @@ typedef void (*AudioCallback)(void *bufferData, unsigned int frames);
float GetMusicTimePlayed(Music music); // Get current music time played (in seconds)
// AudioStream management functions
AudioStream LoadAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); // Load audio stream (to stream raw audio pcm data)
bool IsAudioStreamReady(AudioStream stream); // Checks if an audio stream is ready
bool IsAudioStreamValid(AudioStream stream); // Checks if an audio stream is valid (buffers initialized)
void UnloadAudioStream(AudioStream stream); // Unload audio stream and free memory
void UpdateAudioStream(AudioStream stream, const void *data, int frameCount); // Update audio stream buffers with data
bool IsAudioStreamProcessed(AudioStream stream); // Check if any audio stream buffers requires refill
@ -1403,7 +1442,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, receives the samples as <float>s
void AttachAudioStreamProcessor(AudioStream stream, AudioCallback processor); // Attach audio stream processor to stream, receives the samples as 'float'
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, receives the samples as <float>s
void AttachAudioMixedProcessor(AudioCallback processor); // Attach audio stream processor to the entire audio pipeline, receives the samples as 'float'
void DetachAudioMixedProcessor(AudioCallback processor); // Detach audio stream processor from the entire audio pipeline

View file

@ -1,6 +1,6 @@
/**********************************************************************************************
*
* raymath v1.5 - Math functions to work with Vector2, Vector3, Matrix and Quaternions
* raymath v2.0 - Math functions to work with Vector2, Vector3, Matrix and Quaternions
*
* CONVENTIONS:
* - Matrix structure is defined as row-major (memory layout) but parameters naming AND all
@ -12,7 +12,7 @@
* - 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 use always a "result" variable for return (except C++ operators)
* - 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++
@ -26,10 +26,12 @@
* #define RAYMATH_STATIC_INLINE
* This may use up lots of memory.
*
* #define RAYMATH_DISABLE_CPP_OPERATORS
* Disables C++ operator overloads for raymath types.
*
* LICENSE: zlib/libpng
*
* Copyright (c) 2015-2023 Ramon Santamaria (@raysan5)
* Copyright (c) 2015-2024 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.
@ -99,14 +101,21 @@ inline /* Functions may be inlined or external definition used*/ Vector2 Vector2
inline /* Functions may be inlined or external definition used*/ Vector2 Vector2Normalize(Vector2 v);// Transforms a Vector2 by a given Matrix
inline /* Functions may be inlined or external definition used*/ Vector2 Vector2Transform(Vector2 v, Matrix mat);// Calculate linear interpolation between two vectors
inline /* Functions may be inlined or external definition used*/ Vector2 Vector2Lerp(Vector2 v1, Vector2 v2, float amount);// Calculate reflected vector to normal
inline /* Functions may be inlined or external definition used*/ Vector2 Vector2Reflect(Vector2 v, Vector2 normal);// Rotate vector by angle
inline /* Functions may be inlined or external definition used*/ Vector2 Vector2Reflect(Vector2 v, Vector2 normal);// Get min value for each pair of components
inline /* Functions may be inlined or external definition used*/ Vector2 Vector2Min(Vector2 v1, Vector2 v2);// Get max value for each pair of components
inline /* Functions may be inlined or external definition used*/ Vector2 Vector2Max(Vector2 v1, Vector2 v2);// Rotate vector by angle
inline /* Functions may be inlined or external definition used*/ Vector2 Vector2Rotate(Vector2 v, float angle);// Move Vector towards target
inline /* Functions may be inlined or external definition used*/ Vector2 Vector2MoveTowards(Vector2 v, Vector2 target, float maxDistance);// Invert the given vector
inline /* Functions may be inlined or external definition used*/ Vector2 Vector2Invert(Vector2 v);// Clamp the components of the vector between
// min and max values specified by the given vectors
inline /* Functions may be inlined or external definition used*/ Vector2 Vector2Clamp(Vector2 v, Vector2 min, Vector2 max);// Clamp the magnitude of the vector between two min and max values
inline /* Functions may be inlined or external definition used*/ Vector2 Vector2ClampValue(Vector2 v, float min, float max);// Check whether two given vectors are almost equal
inline /* Functions may be inlined or external definition used*/ int Vector2Equals(Vector2 p, Vector2 q);//----------------------------------------------------------------------------------
inline /* Functions may be inlined or external definition used*/ int Vector2Equals(Vector2 p, Vector2 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*/ Vector2 Vector2Refract(Vector2 v, Vector2 n, float r);//----------------------------------------------------------------------------------
// Module Functions Definition - Vector3 math
//----------------------------------------------------------------------------------
// Vector with components value 0.0f
@ -136,8 +145,11 @@ inline /* Functions may be inlined or external definition used*/ Vector3 Vector3
inline /* Functions may be inlined or external definition used*/ void Vector3OrthoNormalize(Vector3 *v1, Vector3 *v2);// Transforms a Vector3 by a given Matrix
inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Transform(Vector3 v, Matrix mat);// Transform a vector by quaternion rotation
inline /* Functions may be inlined or external definition used*/ Vector3 Vector3RotateByQuaternion(Vector3 v, Quaternion q);// Rotates a vector around an axis
inline /* Functions may be inlined or external definition used*/ Vector3 Vector3RotateByAxisAngle(Vector3 v, Vector3 axis, float angle);// Calculate linear interpolation between two vectors
inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Lerp(Vector3 v1, Vector3 v2, float amount);// Calculate reflected vector to normal
inline /* Functions may be inlined or external definition used*/ Vector3 Vector3RotateByAxisAngle(Vector3 v, Vector3 axis, float angle);// Move Vector towards target
inline /* Functions may be inlined or external definition used*/ Vector3 Vector3MoveTowards(Vector3 v, Vector3 target, float maxDistance);// Calculate linear interpolation between two vectors
inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Lerp(Vector3 v1, Vector3 v2, float amount);// Calculate cubic hermite interpolation between two vectors and their tangents
// as described in the GLTF 2.0 specification: https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#interpolation-cubic
inline /* Functions may be inlined or external definition used*/ Vector3 Vector3CubicHermite(Vector3 v1, Vector3 tangent1, Vector3 v2, Vector3 tangent2, float amount);// Calculate reflected vector to normal
inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Reflect(Vector3 v, Vector3 normal);// Get min value for each pair of components
inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Min(Vector3 v1, Vector3 v2);// Get max value for each pair of components
inline /* Functions may be inlined or external definition used*/ Vector3 Vector3Max(Vector3 v1, Vector3 v2);// Compute barycenter coordinates (u, v, w) for point p with respect to triangle (a, b, c)
@ -156,6 +168,21 @@ inline /* Functions may be inlined or external definition used*/ int Vector3Equa
// 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 - Vector4 math
//----------------------------------------------------------------------------------
inline /* Functions may be inlined or external definition used*/ Vector4 Vector4Zero(void);inline /* Functions may be inlined or external definition used*/ Vector4 Vector4One(void);inline /* Functions may be inlined or external definition used*/ Vector4 Vector4Add(Vector4 v1, Vector4 v2);inline /* Functions may be inlined or external definition used*/ Vector4 Vector4AddValue(Vector4 v, float add);inline /* Functions may be inlined or external definition used*/ Vector4 Vector4Subtract(Vector4 v1, Vector4 v2);inline /* Functions may be inlined or external definition used*/ Vector4 Vector4SubtractValue(Vector4 v, float add);inline /* Functions may be inlined or external definition used*/ float Vector4Length(Vector4 v);inline /* Functions may be inlined or external definition used*/ float Vector4LengthSqr(Vector4 v);inline /* Functions may be inlined or external definition used*/ float Vector4DotProduct(Vector4 v1, Vector4 v2);// Calculate distance between two vectors
inline /* Functions may be inlined or external definition used*/ float Vector4Distance(Vector4 v1, Vector4 v2);// Calculate square distance between two vectors
inline /* Functions may be inlined or external definition used*/ float Vector4DistanceSqr(Vector4 v1, Vector4 v2);inline /* Functions may be inlined or external definition used*/ Vector4 Vector4Scale(Vector4 v, float scale);// Multiply vector by vector
inline /* Functions may be inlined or external definition used*/ Vector4 Vector4Multiply(Vector4 v1, Vector4 v2);// Negate vector
inline /* Functions may be inlined or external definition used*/ Vector4 Vector4Negate(Vector4 v);// Divide vector by vector
inline /* Functions may be inlined or external definition used*/ Vector4 Vector4Divide(Vector4 v1, Vector4 v2);// Normalize provided vector
inline /* Functions may be inlined or external definition used*/ Vector4 Vector4Normalize(Vector4 v);// Get min value for each pair of components
inline /* Functions may be inlined or external definition used*/ Vector4 Vector4Min(Vector4 v1, Vector4 v2);// Get max value for each pair of components
inline /* Functions may be inlined or external definition used*/ Vector4 Vector4Max(Vector4 v1, Vector4 v2);// Calculate linear interpolation between two vectors
inline /* Functions may be inlined or external definition used*/ Vector4 Vector4Lerp(Vector4 v1, Vector4 v2, float amount);// Move Vector towards target
inline /* Functions may be inlined or external definition used*/ Vector4 Vector4MoveTowards(Vector4 v, Vector4 target, float maxDistance);// Invert the given vector
inline /* Functions may be inlined or external definition used*/ Vector4 Vector4Invert(Vector4 v);// Check whether two given vectors are almost equal
inline /* Functions may be inlined or external definition used*/ int Vector4Equals(Vector4 p, Vector4 q);//----------------------------------------------------------------------------------
// Module Functions Definition - Matrix math
//----------------------------------------------------------------------------------
// Compute matrix determinant
@ -182,7 +209,7 @@ inline /* Functions may be inlined or external definition used*/ Matrix MatrixRo
// NOTE: Angle must be provided in radians
inline /* Functions may be inlined or external definition used*/ Matrix MatrixRotateZYX(Vector3 angle);// Get scaling matrix
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
inline /* Functions may be inlined or external definition used*/ Matrix MatrixFrustum(double left, double right, double bottom, double top, double nearPlane, double farPlane);// 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 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)
@ -204,7 +231,9 @@ inline /* Functions may be inlined or external definition used*/ Quaternion Quat
inline /* Functions may be inlined or external definition used*/ Quaternion QuaternionDivide(Quaternion q1, Quaternion q2);// Calculate linear interpolation between two quaternions
inline /* Functions may be inlined or external definition used*/ Quaternion QuaternionLerp(Quaternion q1, Quaternion q2, float amount);// Calculate slerp-optimized interpolation between two quaternions
inline /* Functions may be inlined or external definition used*/ Quaternion QuaternionNlerp(Quaternion q1, Quaternion q2, float amount);// Calculates spherical linear interpolation between two quaternions
inline /* Functions may be inlined or external definition used*/ Quaternion QuaternionSlerp(Quaternion q1, Quaternion q2, float amount);// Calculate quaternion based on the rotation from one vector to another
inline /* Functions may be inlined or external definition used*/ Quaternion QuaternionSlerp(Quaternion q1, Quaternion q2, float amount);// Calculate quaternion cubic spline interpolation using Cubic Hermite Spline algorithm
// as described in the GLTF 2.0 specification: https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#interpolation-cubic
inline /* Functions may be inlined or external definition used*/ Quaternion QuaternionCubicHermiteSpline(Quaternion q1, Quaternion outTangent1, Quaternion q2, Quaternion inTangent2, float t);// Calculate quaternion based on the rotation from one vector to another
inline /* Functions may be inlined or external definition used*/ Quaternion QuaternionFromVector3ToVector3(Vector3 from, Vector3 to);// Get a quaternion for a given rotation matrix
inline /* Functions may be inlined or external definition used*/ Quaternion QuaternionFromMatrix(Matrix mat);// Get a matrix for a given quaternion
inline /* Functions may be inlined or external definition used*/ Matrix QuaternionToMatrix(Quaternion q);// Get rotation quaternion for an angle and axis
@ -216,4 +245,5 @@ inline /* Functions may be inlined or external definition used*/ Quaternion Quat
// NOTE: Angles are returned in a Vector3 struct in radians
inline /* Functions may be inlined or external definition used*/ Vector3 QuaternionToEuler(Quaternion q);// Transform a quaternion given a transformation matrix
inline /* Functions may be inlined or external definition used*/ Quaternion QuaternionTransform(Quaternion q, Matrix mat);// Check whether two given quaternions are almost equal
inline /* Functions may be inlined or external definition used*/ int QuaternionEquals(Quaternion p, Quaternion q);
inline /* Functions may be inlined or external definition used*/ int QuaternionEquals(Quaternion p, Quaternion q);// Decompose a transformation matrix into its rotational, translational and scaling components
inline /* Functions may be inlined or external definition used*/ void MatrixDecompose(Matrix mat, Vector3 *translation, Quaternion *rotation, Vector3 *scale);

View file

@ -1,6 +1,6 @@
/**********************************************************************************************
*
* rlgl v4.5 - A multi-OpenGL abstraction layer with an immediate-mode style API
* rlgl v5.0 - A multi-OpenGL abstraction layer with an immediate-mode style API
*
* DESCRIPTION:
* An abstraction layer for multiple OpenGL versions (1.1, 2.1, 3.3 Core, 4.3 Core, ES 2.0)
@ -8,17 +8,17 @@
*
* ADDITIONAL NOTES:
* When choosing an OpenGL backend different than OpenGL 1.1, some internal buffer are
* initialized on rlglInit() to accumulate vertex data.
* 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.
* additionally, rlDrawRenderBatchActive() could be called to force flushing of the batch
*
* 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().
* Internal buffer (and resources) must be manually unloaded calling rlglClose()
*
* CONFIGURATION:
* #define GRAPHICS_API_OPENGL_11
@ -32,9 +32,9 @@
* required by any other module, use rlGetVersion() to check it
*
* #define RLGL_IMPLEMENTATION
* Generates the implementation of the library into the included file.
* 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.
* 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)
@ -62,18 +62,21 @@
* When loading a shader, the following vertex attributes 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_ATTRIB_NAME_TEXCOORD2 "vertexTexCoord2" // Bound by default to shader location: 5
* #define RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION "vertexPosition" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION
* #define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD "vertexTexCoord" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD
* #define RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL "vertexNormal" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_NORMAL
* #define RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR "vertexColor" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_COLOR
* #define RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT "vertexTangent" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_TANGENT
* #define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2 "vertexTexCoord2" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2
* #define RL_DEFAULT_SHADER_ATTRIB_NAME_BONEIDS "vertexBoneIds" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEIDS
* #define RL_DEFAULT_SHADER_ATTRIB_NAME_BONEWEIGHTS "vertexBoneWeights" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEWEIGHTS
* #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_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_UNIFORM_NAME_BONE_MATRICES "boneMatrices" // bone matrices
* #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)
@ -85,7 +88,7 @@
*
* LICENSE: zlib/libpng
*
* Copyright (c) 2014-2023 Ramon Santamaria (@raysan5)
* Copyright (c) 2014-2024 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.
@ -103,8 +106,9 @@
* 3. This notice may not be removed or altered from any source distribution.
*
**********************************************************************************************/
// Function specifiers in case library is build/used as a shared library (Windows)
// Function specifiers in case library is build/used as a shared library
// NOTE: Microsoft specifiers to tell compiler that symbols are imported/exported from a .dll
// NOTE: visibility(default) attribute makes symbols "visible" when compiled with -fvisibility=hidden
// Function specifiers definition
// Support TRACELOG macros
// Allow custom memory allocators
@ -133,6 +137,7 @@
// GL Shader type
// GL blending factors
// GL blending functions/equations
// Default shader vertex attribute locations
//----------------------------------------------------------------------------------
// Types and Structures Definition
//----------------------------------------------------------------------------------
@ -141,10 +146,11 @@ typedef struct rlVertexBuffer {
int elementCount; // Number of elements in the buffer (QUADS)
float *vertices; // Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
float *texcoords; // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
float *normals; // Vertex normal (XYZ - 3 components per vertex) (shader-location = 2)
unsigned char *colors; // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
unsigned int *indices; // Vertex indices (in case vertex data comes indexed) (6 indices per quad)
unsigned int vaoId; // OpenGL Vertex Array Object id
unsigned int vboId[4]; // OpenGL Vertex Buffer Objects id (4 types of vertex data)
unsigned int vboId[5]; // OpenGL Vertex Buffer Objects id (5 types of vertex data)
} rlVertexBuffer;
// Draw call type
// NOTE: Only texture changes register a new draw, other state-change-related elements are not
@ -279,6 +285,10 @@ typedef enum {
RL_SHADER_UNIFORM_IVEC2, // Shader uniform type: ivec2 (2 int)
RL_SHADER_UNIFORM_IVEC3, // Shader uniform type: ivec3 (3 int)
RL_SHADER_UNIFORM_IVEC4, // Shader uniform type: ivec4 (4 int)
RL_SHADER_UNIFORM_UINT, // Shader uniform type: unsigned int
RL_SHADER_UNIFORM_UIVEC2, // Shader uniform type: uivec2 (2 unsigned int)
RL_SHADER_UNIFORM_UIVEC3, // Shader uniform type: uivec3 (3 unsigned int)
RL_SHADER_UNIFORM_UIVEC4, // Shader uniform type: uivec4 (4 unsigned int)
RL_SHADER_UNIFORM_SAMPLER2D // Shader uniform type: sampler2d
} rlShaderUniformDataType;
// Shader attribute data types
@ -332,6 +342,9 @@ typedef enum {
void rlFrustum(double left, double right, double bottom, double top, double znear, double zfar);
void rlOrtho(double left, double right, double bottom, double top, double znear, double zfar);
void rlViewport(int x, int y, int width, int height); // Set the viewport area
void rlSetClipPlanes(double nearPlane, double farPlane); // Set clip planes distances
double rlGetCullDistanceNear(void); // Get cull plane distance near
double rlGetCullDistanceFar(void); // Get cull plane distance far
//------------------------------------------------------------------------------------
// Functions Declaration - Vertex level operations
//------------------------------------------------------------------------------------
@ -355,10 +368,10 @@ typedef enum {
void rlDisableVertexArray(void); // Disable vertex array (VAO, if supported)
void rlEnableVertexBuffer(unsigned int id); // Enable vertex buffer (VBO)
void rlDisableVertexBuffer(void); // Disable vertex buffer (VBO)
void rlEnableVertexBufferElement(unsigned int id);// Enable vertex buffer element (VBO element)
void rlEnableVertexBufferElement(unsigned int id); // Enable vertex buffer element (VBO element)
void rlDisableVertexBufferElement(void); // Disable vertex buffer element (VBO element)
void rlEnableVertexAttribute(unsigned int index); // Enable vertex attribute index
void rlDisableVertexAttribute(unsigned int index);// Disable vertex attribute index
void rlDisableVertexAttribute(unsigned int index); // Disable vertex attribute index
// Textures state
void rlActiveTextureSlot(int slot); // Select and active a texture slot
void rlEnableTexture(unsigned int id); // Enable texture
@ -373,8 +386,10 @@ typedef enum {
// Framebuffer state
void rlEnableFramebuffer(unsigned int id); // Enable render texture (fbo)
void rlDisableFramebuffer(void); // Disable render texture (fbo), return to default framebuffer
unsigned int rlGetActiveFramebuffer(void); // Get the currently active render texture (fbo), 0 for 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
void rlBindFramebuffer(unsigned int target, unsigned int framebuffer); // Bind framebuffer (FBO)
// General render state
void rlEnableColorBlend(void); // Enable color blending
void rlDisableColorBlend(void); // Disable color blending
@ -384,13 +399,14 @@ typedef enum {
void rlDisableDepthMask(void); // Disable depth write
void rlEnableBackfaceCulling(void); // Enable backface culling
void rlDisableBackfaceCulling(void); // Disable backface culling
void rlColorMask(bool r, bool g, bool b, bool a); // Color mask control
void rlSetCullFace(int mode); // Set face culling mode
void rlEnableScissorTest(void); // Enable scissor test
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 rlEnablePointMode(void); // Enable point mode
void rlDisableWireMode(void); // Disable wire mode ( and point ) maybe rename
void rlEnablePointMode(void); // Enable point mode
void rlDisableWireMode(void); // Disable wire (and point) mode
void rlSetLineWidth(float width); // Set the line drawing width
float rlGetLineWidth(void); // Get the line drawing width
void rlEnableSmoothLines(void); // Enable line aliasing
@ -432,24 +448,24 @@ typedef enum {
//------------------------------------------------------------------------------------------------------------------------
// Vertex buffers management
unsigned int rlLoadVertexArray(void); // Load vertex array (vao) if supported
unsigned int rlLoadVertexBuffer(const void *buffer, int size, bool dynamic); // Load a vertex buffer attribute
unsigned int rlLoadVertexBufferElement(const void *buffer, int size, bool dynamic); // Load a new attributes element buffer
void rlUpdateVertexBuffer(unsigned int bufferId, const void *data, int dataSize, int offset); // Update GPU buffer with new data
void rlUpdateVertexBufferElements(unsigned int id, const void *data, int dataSize, int offset); // Update vertex buffer elements with new data
void rlUnloadVertexArray(unsigned int vaoId);
void rlUnloadVertexBuffer(unsigned int vboId);
void rlSetVertexAttribute(unsigned int index, int compSize, int type, bool normalized, int stride, const void *pointer);
void rlSetVertexAttributeDivisor(unsigned int index, int divisor);
void rlSetVertexAttributeDefault(int locIndex, const void *value, int attribType, int count); // Set vertex attribute default value
void rlDrawVertexArray(int offset, int count);
void rlDrawVertexArrayElements(int offset, int count, const void *buffer);
void rlDrawVertexArrayInstanced(int offset, int count, int instances);
void rlDrawVertexArrayElementsInstanced(int offset, int count, const void *buffer, int instances);
unsigned int rlLoadVertexBuffer(const void *buffer, int size, bool dynamic); // Load a vertex buffer object
unsigned int rlLoadVertexBufferElement(const void *buffer, int size, bool dynamic); // Load vertex buffer elements object
void rlUpdateVertexBuffer(unsigned int bufferId, const void *data, int dataSize, int offset); // Update vertex buffer object data on GPU buffer
void rlUpdateVertexBufferElements(unsigned int id, const void *data, int dataSize, int offset); // Update vertex buffer elements data on GPU buffer
void rlUnloadVertexArray(unsigned int vaoId); // Unload vertex array (vao)
void rlUnloadVertexBuffer(unsigned int vboId); // Unload vertex buffer object
void rlSetVertexAttribute(unsigned int index, int compSize, int type, bool normalized, int stride, int offset); // Set vertex attribute data configuration
void rlSetVertexAttributeDivisor(unsigned int index, int divisor); // Set vertex attribute data divisor
void rlSetVertexAttributeDefault(int locIndex, const void *value, int attribType, int count); // Set vertex attribute default value, when attribute to provided
void rlDrawVertexArray(int offset, int count); // Draw vertex array (currently active vao)
void rlDrawVertexArrayElements(int offset, int count, const void *buffer); // Draw vertex array elements
void rlDrawVertexArrayInstanced(int offset, int count, int instances); // Draw vertex array (currently active vao) with instancing
void rlDrawVertexArrayElementsInstanced(int offset, int count, const void *buffer, int instances); // Draw vertex array elements with instancing
// Textures management
unsigned int rlLoadTexture(const void *data, int width, int height, int format, int mipmapCount); // Load texture in GPU
unsigned int rlLoadTexture(const void *data, int width, int height, int format, int mipmapCount); // Load texture data
unsigned int rlLoadTextureDepth(int width, int height, bool useRenderBuffer); // Load depth texture/renderbuffer (to be attached to fbo)
unsigned int rlLoadTextureCubemap(const void *data, int size, int format); // Load texture cubemap
void rlUpdateTexture(unsigned int id, int offsetX, int offsetY, int width, int height, int format, const void *data); // Update GPU texture with new data
unsigned int rlLoadTextureCubemap(const void *data, int size, int format, int mipmapCount); // Load texture cubemap data
void rlUpdateTexture(unsigned int id, int offsetX, int offsetY, int width, int height, int format, const void *data); // Update texture with new data on GPU
void rlGetGlTextureFormats(int format, unsigned int *glInternalFormat, unsigned int *glFormat, unsigned int *glType); // Get OpenGL internal formats
const char *rlGetPixelFormatName(unsigned int format); // Get name string for pixel format
void rlUnloadTexture(unsigned int id); // Unload texture from GPU memory
@ -457,7 +473,7 @@ typedef enum {
void *rlReadTexturePixels(unsigned int id, int width, int height, int format); // Read texture pixel data
unsigned char *rlReadScreenPixels(int width, int height); // Read screen pixel data (color buffer)
// Framebuffer management (fbo)
unsigned int rlLoadFramebuffer(int width, int height); // Load an empty framebuffer
unsigned int rlLoadFramebuffer(void); // Load an empty framebuffer
void rlFramebufferAttach(unsigned int fboId, unsigned int texId, int attachType, int texType, int mipLevel); // Attach texture/renderbuffer to a framebuffer
bool rlFramebufferComplete(unsigned int id); // Verify framebuffer is complete
void rlUnloadFramebuffer(unsigned int id); // Delete framebuffer from GPU
@ -470,6 +486,7 @@ typedef enum {
int rlGetLocationAttrib(unsigned int shaderId, const char *attribName); // Get shader location attribute
void rlSetUniform(int locIndex, const void *value, int uniformType, int count); // Set shader value uniform
void rlSetUniformMatrix(int locIndex, Matrix mat); // Set shader value matrix
void rlSetUniformMatrices(int locIndex, const Matrix *mat, int count); // Set shader value matrices
void rlSetUniformSampler(int locIndex, unsigned int textureId); // Set shader value sampler
void rlSetShader(unsigned int id, int *locs); // Set shader currently active (id and locations)
// Compute shader management

View file

@ -1,7 +1,7 @@
import pathlib
from setuptools import setup
from setuptools.dist import Distribution
import os
# The directory containing this file
HERE = pathlib.Path(__file__).parent
@ -10,6 +10,13 @@ HERE = pathlib.Path(__file__).parent
README = (HERE / "README.md").read_text()
VERSION = (HERE / "version.py").read_text().split()[-1].strip("\"'")
RAYLIB_PLATFORM = os.getenv("RAYLIB_PLATFORM", "Desktop")
if RAYLIB_PLATFORM == "SDL":
NAME = "raylib_sdl"
elif RAYLIB_PLATFORM == "DRM":
NAME = "raylib_drm"
else:
NAME = "raylib"
class BinaryDistribution(Distribution):
"""Distribution which always forces a binary package with platform name"""
@ -18,7 +25,7 @@ class BinaryDistribution(Distribution):
# This call to setup() does all the work
setup(
name="raylib",
name=NAME,
version=VERSION,
description="Python CFFI bindings for Raylib",
long_description=README,

View file

@ -21,7 +21,7 @@ model.materials.maps[pr.MaterialMapIndex.MATERIAL_MAP_ALBEDO].texture = texture
pr.unload_image(image)
pos = pr.get_mouse_position()
ray = pr.get_mouse_ray(pos, camera)
ray = pr.get_screen_to_world_ray(pos, camera)
#rayhit = pr.get_ray_collision_ground(ray, 0)
#print(str(rayhit.position.x))
@ -37,7 +37,7 @@ while not pr.window_should_close():
pr.end_drawing()
pos = pr.get_mouse_position()
ray = pr.get_mouse_ray(pos, camera)
ray = pr.get_screen_to_world_ray(pos, camera)
#rayhit = pr.get_ray_collision_ground(ray, 0)
#print(str(rayhit.position.x))

View file

@ -21,7 +21,7 @@ model.materials.maps[MATERIAL_MAP_ALBEDO].texture = texture
unload_image(image)
pos = get_mouse_position()
ray = get_mouse_ray(pos, camera)
ray = get_screen_to_world_ray(pos, camera)
#rayhit = get_ray_collision_ground(ray, 0)
#print(str(rayhit.position.x))
@ -33,11 +33,11 @@ while not window_should_close():
draw_model(model, (-8.0, 0.0, -8.0), 1.0, RED)
draw_grid(20, 1.0)
end_mode_3d()
draw_text("This mesh should be textured", 190, 200, 20, VIOLET)
draw_text("This mesh should be tesxtured", 190, 200, 20, VIOLET)
end_drawing()
pos = get_mouse_position()
ray = get_mouse_ray(pos, camera)
ray = get_screen_to_world_ray(pos, camera)
#rayhit = get_ray_collision_ground(ray, 0)
#print(str(rayhit.position.x))

View file

@ -1 +1 @@
__version__ = "5.0.0.5"
__version__ = "5.5.0.0"