init repo
83
.clang-format
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
# Google C/C++ Code Style settings
|
||||||
|
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
|
||||||
|
# Author: Kehan Xue, kehan.xue (at) gmail.com
|
||||||
|
|
||||||
|
Language: Cpp
|
||||||
|
BasedOnStyle: Google
|
||||||
|
AccessModifierOffset: -4
|
||||||
|
AlignAfterOpenBracket: Align
|
||||||
|
AlignConsecutiveAssignments: None
|
||||||
|
AlignOperands: Align
|
||||||
|
AllowAllArgumentsOnNextLine: true
|
||||||
|
AllowAllConstructorInitializersOnNextLine: true
|
||||||
|
AllowAllParametersOfDeclarationOnNextLine: false
|
||||||
|
AllowShortBlocksOnASingleLine: Empty
|
||||||
|
AllowShortCaseLabelsOnASingleLine: false
|
||||||
|
AllowShortFunctionsOnASingleLine: Inline
|
||||||
|
AllowShortIfStatementsOnASingleLine: Never # To avoid conflict, set this "Never" and each "if statement" should include brace when coding
|
||||||
|
AllowShortLambdasOnASingleLine: Inline
|
||||||
|
AllowShortLoopsOnASingleLine: false
|
||||||
|
AlwaysBreakAfterReturnType: None
|
||||||
|
AlwaysBreakTemplateDeclarations: Yes
|
||||||
|
BinPackArguments: true
|
||||||
|
BreakBeforeBraces: Custom
|
||||||
|
BraceWrapping:
|
||||||
|
AfterCaseLabel: false
|
||||||
|
AfterClass: false
|
||||||
|
AfterStruct: false
|
||||||
|
AfterControlStatement: Never
|
||||||
|
AfterEnum: false
|
||||||
|
AfterFunction: false
|
||||||
|
AfterNamespace: false
|
||||||
|
AfterUnion: false
|
||||||
|
AfterExternBlock: false
|
||||||
|
BeforeCatch: false
|
||||||
|
BeforeElse: false
|
||||||
|
BeforeLambdaBody: false
|
||||||
|
IndentBraces: false
|
||||||
|
SplitEmptyFunction: false
|
||||||
|
SplitEmptyRecord: false
|
||||||
|
SplitEmptyNamespace: false
|
||||||
|
BreakBeforeBinaryOperators: None
|
||||||
|
BreakBeforeTernaryOperators: true
|
||||||
|
BreakConstructorInitializers: BeforeColon
|
||||||
|
BreakInheritanceList: BeforeColon
|
||||||
|
ColumnLimit: 80
|
||||||
|
CompactNamespaces: false
|
||||||
|
ContinuationIndentWidth: 4
|
||||||
|
Cpp11BracedListStyle: true
|
||||||
|
DerivePointerAlignment: false # Make sure the * or & align on the left
|
||||||
|
EmptyLineBeforeAccessModifier: LogicalBlock
|
||||||
|
FixNamespaceComments: true
|
||||||
|
IncludeBlocks: Preserve
|
||||||
|
IndentCaseLabels: true
|
||||||
|
IndentPPDirectives: None
|
||||||
|
IndentWidth: 4
|
||||||
|
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||||
|
MaxEmptyLinesToKeep: 1
|
||||||
|
NamespaceIndentation: None
|
||||||
|
ObjCSpaceAfterProperty: false
|
||||||
|
ObjCSpaceBeforeProtocolList: true
|
||||||
|
PointerAlignment: Left
|
||||||
|
ReflowComments: false
|
||||||
|
# SeparateDefinitionBlocks: Always # Only support since clang-format 14
|
||||||
|
SpaceAfterCStyleCast: false
|
||||||
|
SpaceAfterLogicalNot: false
|
||||||
|
SpaceAfterTemplateKeyword: true
|
||||||
|
SpaceBeforeAssignmentOperators: true
|
||||||
|
SpaceBeforeCpp11BracedList: false
|
||||||
|
SpaceBeforeCtorInitializerColon: true
|
||||||
|
SpaceBeforeInheritanceColon: true
|
||||||
|
SpaceBeforeParens: ControlStatements
|
||||||
|
SpaceBeforeRangeBasedForLoopColon: true
|
||||||
|
SpaceBeforeSquareBrackets: false
|
||||||
|
SpaceInEmptyParentheses: false
|
||||||
|
SpacesBeforeTrailingComments: 2
|
||||||
|
SpacesInAngles: false
|
||||||
|
SpacesInCStyleCastParentheses: false
|
||||||
|
SpacesInContainerLiterals: false
|
||||||
|
SpacesInParentheses: false
|
||||||
|
SpacesInSquareBrackets: false
|
||||||
|
Standard: c++11
|
||||||
|
TabWidth: 4
|
||||||
|
UseTab: Never
|
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
.idea/
|
8
3party/raylib/.github/FUNDING.yml
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# These are supported funding model platforms
|
||||||
|
|
||||||
|
github: raysan5
|
||||||
|
patreon: # raylib
|
||||||
|
open_collective: # Replace with a single Open Collective username
|
||||||
|
ko_fi: # raysan
|
||||||
|
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||||
|
custom: # Replace with a single custom sponsorship URL
|
1
3party/raylib/.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
blank_issues_enabled: false
|
41
3party/raylib/.github/ISSUE_TEMPLATE/new-issue-template.md
vendored
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
---
|
||||||
|
name: new issue template
|
||||||
|
about: generic template for new issues
|
||||||
|
title: "[module] Short description of the issue/bug/feature"
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**WARNING: Please, read this note carefully before submitting a new issue:**
|
||||||
|
|
||||||
|
It is important to realise that **this is NOT A SUPPORT FORUM**, this is for reproducible BUGS with raylib ONLY.
|
||||||
|
|
||||||
|
There are lots of generous and helpful people ready to help you out on [raylib Discord forum](https://discord.gg/raylib) or [raylib reddit](https://www.reddit.com/r/raylib/).
|
||||||
|
|
||||||
|
Remember that asking for support questions here actively takes developer time away from improving raylib.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Please, before submitting a new issue verify and check:
|
||||||
|
|
||||||
|
- [ ] I tested it on latest raylib version from master branch
|
||||||
|
- [ ] I checked there is no similar issue already reported
|
||||||
|
- [ ] I checked the documentation on the [wiki](https://github.com/raysan5/raylib/wiki)
|
||||||
|
- [ ] My code has no errors or misuse of raylib
|
||||||
|
|
||||||
|
### Issue description
|
||||||
|
|
||||||
|
*Briefly describe the issue you are experiencing (or the feature you want to see added to raylib). Tell us what you were trying to do and what happened instead. Remember, this is not the best place to ask questions. For questions, go to [raylib Discord server](https://discord.gg/raylib).*
|
||||||
|
|
||||||
|
### Environment
|
||||||
|
|
||||||
|
*Provide your Platform, Operating System, OpenGL version, GPU details where you experienced the issue.*
|
||||||
|
|
||||||
|
### Issue Screenshot
|
||||||
|
|
||||||
|
*If possible, provide a screenshot that illustrates the issue. Usually an image is better than a thousand words.*
|
||||||
|
|
||||||
|
### Code Example
|
||||||
|
|
||||||
|
*Provide minimal reproduction code to test the issue. Please, format the code properly and try to keep it as simple as possible, just focusing on the experienced issue.*
|
100
3party/raylib/.github/workflows/android.yml
vendored
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
name: Android
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- 'src/**'
|
||||||
|
- 'examples/**'
|
||||||
|
- '.github/workflows/android.yml'
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- 'src/**'
|
||||||
|
- 'examples/**'
|
||||||
|
- '.github/workflows/android.yml'
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
permissions:
|
||||||
|
contents: write # for actions/upload-release-asset to upload release asset
|
||||||
|
runs-on: windows-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
max-parallel: 1
|
||||||
|
matrix:
|
||||||
|
ARCH: ["arm64", "x86_64"]
|
||||||
|
|
||||||
|
env:
|
||||||
|
RELEASE_NAME: raylib-dev_android_api29_${{ matrix.ARCH }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@master
|
||||||
|
|
||||||
|
- name: Setup Release Version
|
||||||
|
run: |
|
||||||
|
echo "RELEASE_NAME=raylib-${{ github.event.release.tag_name }}_android_api29_${{ matrix.ARCH }}" >> $GITHUB_ENV
|
||||||
|
shell: bash
|
||||||
|
if: github.event_name == 'release' && github.event.action == 'published'
|
||||||
|
|
||||||
|
- name: Setup Android NDK
|
||||||
|
id: setup-ndk
|
||||||
|
uses: nttld/setup-ndk@v1
|
||||||
|
with:
|
||||||
|
ndk-version: r25
|
||||||
|
add-to-path: false
|
||||||
|
env:
|
||||||
|
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
|
||||||
|
|
||||||
|
- name: Setup Environment
|
||||||
|
run: |
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
mkdir ${{ env.RELEASE_NAME }}
|
||||||
|
cd ${{ env.RELEASE_NAME }}
|
||||||
|
mkdir include
|
||||||
|
mkdir lib
|
||||||
|
cd ../..
|
||||||
|
|
||||||
|
# Generating static + shared library for 64bit arquitectures and API version 29
|
||||||
|
- name: Build Library
|
||||||
|
run: |
|
||||||
|
cd src
|
||||||
|
make PLATFORM=PLATFORM_ANDROID ANDROID_ARCH=${{ matrix.ARCH }} ANDROID_API_VERSION=29 ANDROID_NDK=${{ env.ANDROID_NDK_HOME }} RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib"
|
||||||
|
make PLATFORM=PLATFORM_ANDROID ANDROID_ARCH=${{ matrix.ARCH }} ANDROID_API_VERSION=29 ANDROID_NDK=${{ env.ANDROID_NDK_HOME }} RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
|
||||||
|
cd ..
|
||||||
|
shell: cmd
|
||||||
|
|
||||||
|
- name: Generate Artifacts
|
||||||
|
run: |
|
||||||
|
cp -v ./src/raylib.h ./build/${{ env.RELEASE_NAME }}/include
|
||||||
|
cp -v ./src/raymath.h ./build/${{ env.RELEASE_NAME }}/include
|
||||||
|
cp -v ./src/rlgl.h ./build/${{ env.RELEASE_NAME }}/include
|
||||||
|
cp -v ./CHANGELOG ./build/${{ env.RELEASE_NAME }}/CHANGELOG
|
||||||
|
cp -v ./README.md ./build/${{ env.RELEASE_NAME }}/README.md
|
||||||
|
cp -v ./LICENSE ./build/${{ env.RELEASE_NAME }}/LICENSE
|
||||||
|
cd build
|
||||||
|
tar -czvf ${{ env.RELEASE_NAME }}.tar.gz ${{ env.RELEASE_NAME }}
|
||||||
|
|
||||||
|
- name: Upload Artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ${{ env.RELEASE_NAME }}.tar.gz
|
||||||
|
path: ./build/${{ env.RELEASE_NAME }}.tar.gz
|
||||||
|
|
||||||
|
- name: Upload Artifact to Release
|
||||||
|
uses: actions/upload-release-asset@v1.0.1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ github.event.release.upload_url }}
|
||||||
|
asset_path: ./build/${{ env.RELEASE_NAME }}.tar.gz
|
||||||
|
asset_name: ${{ env.RELEASE_NAME }}.tar.gz
|
||||||
|
asset_content_type: application/gzip
|
||||||
|
if: github.event_name == 'release' && github.event.action == 'published'
|
||||||
|
|
111
3party/raylib/.github/workflows/cmake.yml
vendored
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
name: CMakeBuilds
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- 'src/**'
|
||||||
|
- 'examples/**'
|
||||||
|
- '.github/workflows/cmake.yml'
|
||||||
|
- 'CMakeList.txt'
|
||||||
|
- 'CMakeOptions.txt'
|
||||||
|
- 'cmake/**'
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- 'src/**'
|
||||||
|
- 'examples/**'
|
||||||
|
- '.github/workflows/cmake.yml'
|
||||||
|
- 'CMakeList.txt'
|
||||||
|
- 'CMakeOptions.txt'
|
||||||
|
- 'cmake/**'
|
||||||
|
|
||||||
|
env:
|
||||||
|
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
||||||
|
BUILD_TYPE: Release
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build_windows:
|
||||||
|
name: Windows Build
|
||||||
|
# The CMake configure and build commands are platform agnostic and should work equally
|
||||||
|
# well on Windows or Mac. You can convert this to a matrix build if you need
|
||||||
|
# cross-platform coverage.
|
||||||
|
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Create Build Environment
|
||||||
|
# Some projects don't allow in-source building, so create a separate build directory
|
||||||
|
# We'll use this as our working directory for all subsequent commands
|
||||||
|
run: cmake -E make_directory ${{github.workspace}}/build
|
||||||
|
|
||||||
|
- name: Configure CMake
|
||||||
|
# Use a bash shell so we can use the same syntax for environment variable
|
||||||
|
# access regardless of the host operating system
|
||||||
|
shell: powershell
|
||||||
|
working-directory: ${{github.workspace}}/build
|
||||||
|
# Note the current convention is to use the -S and -B options here to specify source
|
||||||
|
# and build directories, but this is only available with CMake 3.13 and higher.
|
||||||
|
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
|
||||||
|
run: cmake $env:GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$env:BUILD_TYPE -DPLATFORM=Desktop
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
working-directory: ${{github.workspace}}/build
|
||||||
|
shell: powershell
|
||||||
|
# Execute the build. You can specify a specific target with "--target <NAME>"
|
||||||
|
run: cmake --build . --config $env:BUILD_TYPE
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
working-directory: ${{github.workspace}}/build
|
||||||
|
shell: powershell
|
||||||
|
# Execute tests defined by the CMake configuration.
|
||||||
|
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
|
||||||
|
run: ctest -C $env:BUILD_TYPE
|
||||||
|
|
||||||
|
build_linux:
|
||||||
|
name: Linux Build
|
||||||
|
# The CMake configure and build commands are platform agnostic and should work equally
|
||||||
|
# well on Windows or Mac. You can convert this to a matrix build if you need
|
||||||
|
# cross-platform coverage.
|
||||||
|
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Create Build Environment
|
||||||
|
# Some projects don't allow in-source building, so create a separate build directory
|
||||||
|
# We'll use this as our working directory for all subsequent commands
|
||||||
|
run: cmake -E make_directory ${{github.workspace}}/build
|
||||||
|
|
||||||
|
- name: Setup Environment
|
||||||
|
run: |
|
||||||
|
sudo apt-get update -qq
|
||||||
|
sudo apt-get install gcc-multilib
|
||||||
|
sudo apt-get install -y --no-install-recommends libglfw3 libglfw3-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxext-dev libxfixes-dev
|
||||||
|
- name: Configure CMake
|
||||||
|
# Use a bash shell so we can use the same syntax for environment variable
|
||||||
|
# access regardless of the host operating system
|
||||||
|
shell: bash
|
||||||
|
working-directory: ${{github.workspace}}/build
|
||||||
|
# Note the current convention is to use the -S and -B options here to specify source
|
||||||
|
# and build directories, but this is only available with CMake 3.13 and higher.
|
||||||
|
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
|
||||||
|
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DPLATFORM=Desktop
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
working-directory: ${{github.workspace}}/build
|
||||||
|
shell: bash
|
||||||
|
# Execute the build. You can specify a specific target with "--target <NAME>"
|
||||||
|
run: cmake --build . --config $BUILD_TYPE
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
working-directory: ${{github.workspace}}/build
|
||||||
|
shell: bash
|
||||||
|
# Execute tests defined by the CMake configuration.
|
||||||
|
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
|
||||||
|
run: ctest -C $BUILD_TYPE
|
111
3party/raylib/.github/workflows/linux.yml
vendored
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
name: Linux
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- 'src/**'
|
||||||
|
- 'examples/**'
|
||||||
|
- '.github/workflows/linux.yml'
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- 'src/**'
|
||||||
|
- 'examples/**'
|
||||||
|
- '.github/workflows/linux.yml'
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
permissions:
|
||||||
|
contents: write # for actions/upload-release-asset to upload release asset
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
max-parallel: 1
|
||||||
|
matrix:
|
||||||
|
bits: [32, 64]
|
||||||
|
include:
|
||||||
|
- bits: 32
|
||||||
|
ARCH: "i386"
|
||||||
|
ARCH_NAME: "i386"
|
||||||
|
COMPILER_PATH: "/user/bin"
|
||||||
|
- bits: 64
|
||||||
|
ARCH: "x86_64"
|
||||||
|
ARCH_NAME: "amd64"
|
||||||
|
COMPILER_PATH: "/user/bin"
|
||||||
|
|
||||||
|
env:
|
||||||
|
RELEASE_NAME: raylib-dev_linux_${{ matrix.ARCH_NAME }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@master
|
||||||
|
|
||||||
|
- name: Setup Release Version
|
||||||
|
run: |
|
||||||
|
echo "RELEASE_NAME=raylib-${{ github.event.release.tag_name }}_linux_${{ matrix.ARCH_NAME }}" >> $GITHUB_ENV
|
||||||
|
shell: bash
|
||||||
|
if: github.event_name == 'release' && github.event.action == 'published'
|
||||||
|
|
||||||
|
- name: Setup Environment
|
||||||
|
run: |
|
||||||
|
sudo apt-get update -qq
|
||||||
|
sudo apt-get install gcc-multilib
|
||||||
|
sudo apt-get install -y --no-install-recommends libglfw3 libglfw3-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxext-dev libxfixes-dev
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
mkdir ${{ env.RELEASE_NAME }}
|
||||||
|
cd ${{ env.RELEASE_NAME }}
|
||||||
|
mkdir include
|
||||||
|
mkdir lib
|
||||||
|
cd ../../../raylib
|
||||||
|
# ${{ matrix.ARCH }}-linux-gnu-gcc -v
|
||||||
|
|
||||||
|
# TODO: Support 32bit (i386) static/shared library building
|
||||||
|
- name: Build Library
|
||||||
|
run: |
|
||||||
|
cd src
|
||||||
|
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" CUSTOM_CFLAGS="-m32" -B
|
||||||
|
# make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
|
||||||
|
cd ..
|
||||||
|
if: matrix.bits == 32
|
||||||
|
|
||||||
|
- name: Build Library
|
||||||
|
run: |
|
||||||
|
cd src
|
||||||
|
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
|
||||||
|
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
|
||||||
|
cd ..
|
||||||
|
if: matrix.bits == 64
|
||||||
|
|
||||||
|
- name: Generate Artifacts
|
||||||
|
run: |
|
||||||
|
cp -v ./src/raylib.h ./build/${{ env.RELEASE_NAME }}/include
|
||||||
|
cp -v ./src/raymath.h ./build/${{ env.RELEASE_NAME }}/include
|
||||||
|
cp -v ./src/rlgl.h ./build/${{ env.RELEASE_NAME }}/include
|
||||||
|
cp -v ./CHANGELOG ./build/${{ env.RELEASE_NAME }}/CHANGELOG
|
||||||
|
cp -v ./README.md ./build/${{ env.RELEASE_NAME }}/README.md
|
||||||
|
cp -v ./LICENSE ./build/${{ env.RELEASE_NAME }}/LICENSE
|
||||||
|
cd build
|
||||||
|
tar -czvf ${{ env.RELEASE_NAME }}.tar.gz ${{ env.RELEASE_NAME }}
|
||||||
|
|
||||||
|
- name: Upload Artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ${{ env.RELEASE_NAME }}.tar.gz
|
||||||
|
path: ./build/${{ env.RELEASE_NAME }}.tar.gz
|
||||||
|
|
||||||
|
- name: Upload Artifact to Release
|
||||||
|
uses: actions/upload-release-asset@v1.0.1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ github.event.release.upload_url }}
|
||||||
|
asset_path: ./build/${{ env.RELEASE_NAME }}.tar.gz
|
||||||
|
asset_name: ${{ env.RELEASE_NAME }}.tar.gz
|
||||||
|
asset_content_type: application/gzip
|
||||||
|
if: github.event_name == 'release' && github.event.action == 'published'
|
42
3party/raylib/.github/workflows/linux_examples.yml
vendored
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
name: Linux Examples
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- 'src/**'
|
||||||
|
- 'examples/**'
|
||||||
|
- '.github/workflows/linux_examples.yml'
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
paths:
|
||||||
|
- 'src/**'
|
||||||
|
- 'examples/**'
|
||||||
|
- '.github/workflows/linux_examples.yml'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup Environment
|
||||||
|
run: |
|
||||||
|
sudo apt-get update -qq
|
||||||
|
sudo apt-get install -y --no-install-recommends libglfw3 libglfw3-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxext-dev libxfixes-dev
|
||||||
|
|
||||||
|
- name: Build Library
|
||||||
|
run: |
|
||||||
|
cd src
|
||||||
|
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=STATIC
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
- name: Build Examples
|
||||||
|
run: |
|
||||||
|
cd examples
|
||||||
|
make PLATFORM=PLATFORM_DESKTOP -B
|
||||||
|
cd ..
|
116
3party/raylib/.github/workflows/macos.yml
vendored
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
name: macOS
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- 'src/**'
|
||||||
|
- 'examples/**'
|
||||||
|
- '.github/workflows/macos.yml'
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- 'src/**'
|
||||||
|
- 'examples/**'
|
||||||
|
- '.github/workflows/macos.yml'
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
permissions:
|
||||||
|
contents: write # for actions/upload-release-asset to upload release asset
|
||||||
|
runs-on: macos-latest
|
||||||
|
|
||||||
|
env:
|
||||||
|
RELEASE_NAME: raylib-dev_macos
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@master
|
||||||
|
|
||||||
|
- name: Setup Release Version
|
||||||
|
run: |
|
||||||
|
echo "RELEASE_NAME=raylib-${{ github.event.release.tag_name }}_macos" >> $GITHUB_ENV
|
||||||
|
shell: bash
|
||||||
|
if: github.event_name == 'release' && github.event.action == 'published'
|
||||||
|
|
||||||
|
- name: Setup Environment
|
||||||
|
run: |
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
mkdir ${{ env.RELEASE_NAME }}
|
||||||
|
cd ${{ env.RELEASE_NAME }}
|
||||||
|
mkdir include
|
||||||
|
mkdir lib
|
||||||
|
cd ../..
|
||||||
|
|
||||||
|
# Generating static + shared library, note that i386 architecture is deprecated
|
||||||
|
# Defining GL_SILENCE_DEPRECATION because OpenGL is deprecated on macOS
|
||||||
|
- name: Build Library
|
||||||
|
run: |
|
||||||
|
cd src
|
||||||
|
clang --version
|
||||||
|
|
||||||
|
# Extract version numbers from Makefile
|
||||||
|
brew install grep
|
||||||
|
RAYLIB_API_VERSION=`ggrep -Po 'RAYLIB_API_VERSION\s*=\s\K(.*)' Makefile`
|
||||||
|
RAYLIB_VERSION=`ggrep -Po 'RAYLIB_VERSION\s*=\s\K(.*)' Makefile`
|
||||||
|
|
||||||
|
# Build raylib x86_64 static
|
||||||
|
make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=STATIC CUSTOM_CFLAGS="-target x86_64-apple-macos10.12 -DGL_SILENCE_DEPRECATION"
|
||||||
|
mv libraylib.a /tmp/libraylib_x86_64.a
|
||||||
|
make clean
|
||||||
|
|
||||||
|
# Build raylib arm64 static
|
||||||
|
make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=STATIC CUSTOM_CFLAGS="-target arm64-apple-macos11 -DGL_SILENCE_DEPRECATION" -B
|
||||||
|
mv libraylib.a /tmp/libraylib_arm64.a
|
||||||
|
make clean
|
||||||
|
|
||||||
|
# Join x86_64 and arm64 static
|
||||||
|
lipo -create -output ../build/${{ env.RELEASE_NAME }}/lib/libraylib.a /tmp/libraylib_x86_64.a /tmp/libraylib_arm64.a
|
||||||
|
|
||||||
|
# Build raylib x86_64 dynamic
|
||||||
|
make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED CUSTOM_CFLAGS="-target x86_64-apple-macos10.12 -DGL_SILENCE_DEPRECATION" CUSTOM_LDFLAGS="-target x86_64-apple-macos10.12" -B
|
||||||
|
mv libraylib.${RAYLIB_VERSION}.dylib /tmp/libraylib_x86_64.${RAYLIB_VERSION}.dylib
|
||||||
|
make clean
|
||||||
|
|
||||||
|
# Build raylib arm64 dynamic
|
||||||
|
make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED CUSTOM_CFLAGS="-target arm64-apple-macos11 -DGL_SILENCE_DEPRECATION" CUSTOM_LDFLAGS="-target arm64-apple-macos11" -B
|
||||||
|
mv libraylib.${RAYLIB_VERSION}.dylib /tmp/libraylib_arm64.${RAYLIB_VERSION}.dylib
|
||||||
|
|
||||||
|
# Join x86_64 and arm64 dynamic
|
||||||
|
lipo -create -output ../build/${{ env.RELEASE_NAME }}/lib/libraylib.${RAYLIB_VERSION}.dylib /tmp/libraylib_x86_64.${RAYLIB_VERSION}.dylib /tmp/libraylib_arm64.${RAYLIB_VERSION}.dylib
|
||||||
|
ln -sv libraylib.${RAYLIB_VERSION}.dylib ../build/${{ env.RELEASE_NAME }}/lib/libraylib.dylib
|
||||||
|
ln -sv libraylib.${RAYLIB_VERSION}.dylib ../build/${{ env.RELEASE_NAME }}/lib/libraylib.${RAYLIB_API_VERSION}.dylib
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
- name: Generate Artifacts
|
||||||
|
run: |
|
||||||
|
cp -v ./src/raylib.h ./build/${{ env.RELEASE_NAME }}/include
|
||||||
|
cp -v ./src/raymath.h ./build/${{ env.RELEASE_NAME }}/include
|
||||||
|
cp -v ./src/rlgl.h ./build/${{ env.RELEASE_NAME }}/include
|
||||||
|
cp -v ./CHANGELOG ./build/${{ env.RELEASE_NAME }}/CHANGELOG
|
||||||
|
cp -v ./README.md ./build/${{ env.RELEASE_NAME }}/README.md
|
||||||
|
cp -v ./LICENSE ./build/${{ env.RELEASE_NAME }}/LICENSE
|
||||||
|
cd build
|
||||||
|
tar -czvf ${{ env.RELEASE_NAME }}.tar.gz ${{ env.RELEASE_NAME }}
|
||||||
|
|
||||||
|
- name: Upload Artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ${{ env.RELEASE_NAME }}.tar.gz
|
||||||
|
path: ./build/${{ env.RELEASE_NAME }}.tar.gz
|
||||||
|
|
||||||
|
- name: Upload Artifact to Release
|
||||||
|
uses: actions/upload-release-asset@v1.0.1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ github.event.release.upload_url }}
|
||||||
|
asset_path: ./build/${{ env.RELEASE_NAME }}.tar.gz
|
||||||
|
asset_name: ${{ env.RELEASE_NAME }}.tar.gz
|
||||||
|
asset_content_type: application/gzip
|
||||||
|
if: github.event_name == 'release' && github.event.action == 'published'
|
86
3party/raylib/.github/workflows/webassembly.yml
vendored
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
name: WebAssembly
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- 'src/**'
|
||||||
|
- 'examples/**'
|
||||||
|
- '.github/workflows/webassembly.yml'
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- 'src/**'
|
||||||
|
- 'examples/**'
|
||||||
|
- '.github/workflows/webassembly.yml'
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
env:
|
||||||
|
RELEASE_NAME: raylib-dev_webassembly
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@master
|
||||||
|
|
||||||
|
- name: Setup emsdk
|
||||||
|
uses: mymindstorm/setup-emsdk@v12
|
||||||
|
with:
|
||||||
|
version: 3.1.30
|
||||||
|
actions-cache-folder: 'emsdk-cache'
|
||||||
|
|
||||||
|
- name: Setup Release Version
|
||||||
|
run: |
|
||||||
|
echo "RELEASE_NAME=raylib-${{ github.event.release.tag_name }}_webassembly" >> $GITHUB_ENV
|
||||||
|
shell: bash
|
||||||
|
if: github.event_name == 'release' && github.event.action == 'published'
|
||||||
|
|
||||||
|
- name: Setup Environment
|
||||||
|
run: |
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
mkdir ${{ env.RELEASE_NAME }}
|
||||||
|
cd ${{ env.RELEASE_NAME }}
|
||||||
|
mkdir include
|
||||||
|
mkdir lib
|
||||||
|
cd ../..
|
||||||
|
|
||||||
|
- name: Build Library
|
||||||
|
run: |
|
||||||
|
cd src
|
||||||
|
emcc -v
|
||||||
|
make PLATFORM=PLATFORM_WEB EMSDK_PATH="D:/a/raylib/raylib/emsdk-cache/emsdk-main" RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
- name: Generate Artifacts
|
||||||
|
run: |
|
||||||
|
copy /Y .\src\raylib.h .\build\${{ env.RELEASE_NAME }}\include\raylib.h
|
||||||
|
copy /Y .\src\raymath.h .\build\${{ env.RELEASE_NAME }}\include\raymath.h
|
||||||
|
copy /Y .\src\rlgl.h .\build\${{ env.RELEASE_NAME }}\include\rlgl.h
|
||||||
|
copy /Y .\CHANGELOG .\build/${{ env.RELEASE_NAME }}\CHANGELOG
|
||||||
|
copy /Y .\README.md .\build\${{ env.RELEASE_NAME }}\README.md
|
||||||
|
copy /Y .\LICENSE .\build\${{ env.RELEASE_NAME }}\LICENSE
|
||||||
|
cd build
|
||||||
|
7z a ./${{ env.RELEASE_NAME }}.zip ./${{ env.RELEASE_NAME }}
|
||||||
|
dir
|
||||||
|
shell: cmd
|
||||||
|
|
||||||
|
- name: Upload Artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ${{ env.RELEASE_NAME }}.zip
|
||||||
|
path: ./build/${{ env.RELEASE_NAME }}.zip
|
||||||
|
|
||||||
|
- name: Upload Artifact to Release
|
||||||
|
uses: actions/upload-release-asset@v1.0.1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ github.event.release.upload_url }}
|
||||||
|
asset_path: ./build/${{ env.RELEASE_NAME }}.zip
|
||||||
|
asset_name: ${{ env.RELEASE_NAME }}.zip
|
||||||
|
asset_content_type: application/zip
|
||||||
|
if: github.event_name == 'release' && github.event.action == 'published'
|
150
3party/raylib/.github/workflows/windows.yml
vendored
Normal file
@ -0,0 +1,150 @@
|
|||||||
|
name: Windows
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- 'src/**'
|
||||||
|
- 'examples/**'
|
||||||
|
- '.github/workflows/windows.yml'
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- 'src/**'
|
||||||
|
- 'examples/**'
|
||||||
|
- '.github/workflows/windows.yml'
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
permissions:
|
||||||
|
contents: write # for actions/upload-release-asset to upload release asset
|
||||||
|
runs-on: windows-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
max-parallel: 1
|
||||||
|
matrix:
|
||||||
|
compiler: [mingw-w64, msvc16]
|
||||||
|
bits: [32, 64]
|
||||||
|
include:
|
||||||
|
- compiler: mingw-w64
|
||||||
|
bits: 32
|
||||||
|
ARCH: "i686"
|
||||||
|
WINDRES_ARCH: pe-i386
|
||||||
|
- compiler: mingw-w64
|
||||||
|
bits: 64
|
||||||
|
ARCH: "x86_64"
|
||||||
|
WINDRES_ARCH: pe-x86-64
|
||||||
|
- compiler: msvc16
|
||||||
|
bits: 32
|
||||||
|
ARCH: "x86"
|
||||||
|
VSARCHPATH: "Win32"
|
||||||
|
- compiler: msvc16
|
||||||
|
bits: 64
|
||||||
|
ARCH: "x64"
|
||||||
|
VSARCHPATH: "x64"
|
||||||
|
|
||||||
|
env:
|
||||||
|
RELEASE_NAME: raylib-dev_win${{ matrix.bits }}_${{ matrix.compiler }}
|
||||||
|
GNUTARGET: default
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@master
|
||||||
|
|
||||||
|
- name: Setup Release Version
|
||||||
|
run: |
|
||||||
|
echo "RELEASE_NAME=raylib-${{ github.event.release.tag_name }}_win${{ matrix.bits }}_${{ matrix.compiler }}" >> $GITHUB_ENV
|
||||||
|
shell: bash
|
||||||
|
if: github.event_name == 'release' && github.event.action == 'published'
|
||||||
|
|
||||||
|
- name: Setup Environment
|
||||||
|
run: |
|
||||||
|
dir
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
mkdir ${{ env.RELEASE_NAME }}
|
||||||
|
cd ${{ env.RELEASE_NAME }}
|
||||||
|
mkdir include
|
||||||
|
mkdir lib
|
||||||
|
cd ../../../raylib
|
||||||
|
|
||||||
|
# Setup MSBuild.exe path if required
|
||||||
|
- name: Setup MSBuild
|
||||||
|
uses: microsoft/setup-msbuild@v1.1
|
||||||
|
if: matrix.compiler == 'msvc16'
|
||||||
|
|
||||||
|
- name: Build Library (MinGW-w64 32bit)
|
||||||
|
run: |
|
||||||
|
cd src
|
||||||
|
x86_64-w64-mingw32-gcc.exe --version
|
||||||
|
windres.exe --version
|
||||||
|
dir C:\msys64\mingw64\bin
|
||||||
|
make PLATFORM=PLATFORM_DESKTOP CC=x86_64-w64-mingw32-gcc.exe RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" CUSTOM_CFLAGS=-m32
|
||||||
|
//windres.exe -i raylib.dll.rc -o raylib.dll.rc.data -O coff --target=${{ matrix.WINDRES_ARCH }}
|
||||||
|
//make PLATFORM=PLATFORM_DESKTOP CC=${{ matrix.ARCH }}-w64-mingw32-gcc.exe RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
|
||||||
|
cd ..
|
||||||
|
shell: cmd
|
||||||
|
if: |
|
||||||
|
matrix.compiler == 'mingw-w64' &&
|
||||||
|
matrix.bits == 32
|
||||||
|
|
||||||
|
- name: Build Library (MinGW-w64 64bit)
|
||||||
|
run: |
|
||||||
|
cd src
|
||||||
|
${{ matrix.ARCH }}-w64-mingw32-gcc.exe --version
|
||||||
|
windres.exe --version
|
||||||
|
dir C:\msys64\mingw64\bin
|
||||||
|
make PLATFORM=PLATFORM_DESKTOP CC=${{ matrix.ARCH }}-w64-mingw32-gcc.exe RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib"
|
||||||
|
windres.exe -i raylib.dll.rc -o raylib.dll.rc.data -O coff --target=${{ matrix.WINDRES_ARCH }}
|
||||||
|
make PLATFORM=PLATFORM_DESKTOP CC=${{ matrix.ARCH }}-w64-mingw32-gcc.exe RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
|
||||||
|
cd ..
|
||||||
|
shell: cmd
|
||||||
|
if: |
|
||||||
|
matrix.compiler == 'mingw-w64' &&
|
||||||
|
matrix.bits == 64
|
||||||
|
|
||||||
|
- name: Build Library (MSVC16)
|
||||||
|
run: |
|
||||||
|
cd projects/VS2022
|
||||||
|
msbuild.exe raylib.sln /target:raylib /property:Configuration=Release /property:Platform=${{ matrix.ARCH }}
|
||||||
|
copy /Y .\build\raylib\bin\${{ matrix.VSARCHPATH }}\Release\raylib.lib .\..\..\build\${{ env.RELEASE_NAME }}\lib\raylib.lib
|
||||||
|
msbuild.exe raylib.sln /target:raylib /property:Configuration=Release.DLL /property:Platform=${{ matrix.ARCH }}
|
||||||
|
copy /Y .\build\raylib\bin\${{ matrix.VSARCHPATH }}\Release.DLL\raylib.dll .\..\..\build\${{ env.RELEASE_NAME }}\lib\raylib.dll
|
||||||
|
copy /Y .\build\raylib\bin\${{ matrix.VSARCHPATH }}\Release.DLL\raylib.lib .\..\..\build\${{ env.RELEASE_NAME }}\lib\raylibdll.lib
|
||||||
|
cd ../..
|
||||||
|
shell: cmd
|
||||||
|
if: matrix.compiler == 'msvc16'
|
||||||
|
|
||||||
|
- name: Generate Artifacts
|
||||||
|
run: |
|
||||||
|
copy /Y .\src\raylib.h .\build\${{ env.RELEASE_NAME }}\include\raylib.h
|
||||||
|
copy /Y .\src\raymath.h .\build\${{ env.RELEASE_NAME }}\include\raymath.h
|
||||||
|
copy /Y .\src\rlgl.h .\build\${{ env.RELEASE_NAME }}\include\rlgl.h
|
||||||
|
copy /Y .\CHANGELOG .\build\${{ env.RELEASE_NAME }}\CHANGELOG
|
||||||
|
copy /Y .\README.md .\build\${{ env.RELEASE_NAME }}\README.md
|
||||||
|
copy /Y .\LICENSE .\build\${{ env.RELEASE_NAME }}\LICENSE
|
||||||
|
cd build
|
||||||
|
7z a ./${{ env.RELEASE_NAME }}.zip ./${{ env.RELEASE_NAME }}
|
||||||
|
dir
|
||||||
|
shell: cmd
|
||||||
|
|
||||||
|
- name: Upload Artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ${{ env.RELEASE_NAME }}.zip
|
||||||
|
path: ./build/${{ env.RELEASE_NAME }}.zip
|
||||||
|
|
||||||
|
- name: Upload Artifact to Release
|
||||||
|
uses: actions/upload-release-asset@v1.0.1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ github.event.release.upload_url }}
|
||||||
|
asset_path: ./build/${{ env.RELEASE_NAME }}.zip
|
||||||
|
asset_name: ${{ env.RELEASE_NAME }}.zip
|
||||||
|
asset_content_type: application/zip
|
||||||
|
if: github.event_name == 'release' && github.event.action == 'published'
|
36
3party/raylib/.github/workflows/windows_examples.yml
vendored
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
name: Windows Examples
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- 'src/**'
|
||||||
|
- 'examples/**'
|
||||||
|
- '.github/workflows/windows_examples.yml'
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
paths:
|
||||||
|
- 'src/**'
|
||||||
|
- 'examples/**'
|
||||||
|
- '.github/workflows/windows_examples.yml'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Add MSBuild to PATH
|
||||||
|
uses: microsoft/setup-msbuild@v1
|
||||||
|
|
||||||
|
- name: Build Library (MSVC16)
|
||||||
|
run: |
|
||||||
|
cd projects/VS2019
|
||||||
|
msbuild.exe raylib.sln /property:Configuration=Release /property:Platform=x86
|
||||||
|
cd ../..
|
||||||
|
shell: cmd
|
||||||
|
|
106
3party/raylib/.gitignore
vendored
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
# Ignore generated files
|
||||||
|
# ...
|
||||||
|
|
||||||
|
# Ignore VIM's backup generated files
|
||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
|
*~
|
||||||
|
|
||||||
|
# Ignore thumbnails created by windows
|
||||||
|
Thumbs.db
|
||||||
|
|
||||||
|
# Ignore files build by Visual Studio
|
||||||
|
# *.obj --> Can be confused with 3d model!
|
||||||
|
*.pdb
|
||||||
|
*.aps
|
||||||
|
*.user
|
||||||
|
# *.vcproj
|
||||||
|
# *.vcxproj*
|
||||||
|
# *.sln
|
||||||
|
*.vspscc
|
||||||
|
*_i.c
|
||||||
|
*.i
|
||||||
|
*.icf
|
||||||
|
*_p.c
|
||||||
|
*.ncb
|
||||||
|
*.suo
|
||||||
|
*.tlb
|
||||||
|
*.tlh
|
||||||
|
*.bak
|
||||||
|
*.cache
|
||||||
|
*.ilk
|
||||||
|
*.log
|
||||||
|
.vs
|
||||||
|
|
||||||
|
[Bb]in
|
||||||
|
[Dd]ebug/
|
||||||
|
*.sbr
|
||||||
|
*.sdf
|
||||||
|
obj/
|
||||||
|
[R]elease/
|
||||||
|
_ReSharper*/
|
||||||
|
[Tt]est[Rr]esult*
|
||||||
|
ipch/
|
||||||
|
*.opensdf
|
||||||
|
*.db
|
||||||
|
*.opendb
|
||||||
|
packages/
|
||||||
|
!examples/models/resources/models/obj/
|
||||||
|
|
||||||
|
# Ignore compiled binaries
|
||||||
|
*.o
|
||||||
|
*.exe
|
||||||
|
*.a
|
||||||
|
*.bc
|
||||||
|
*.so
|
||||||
|
*.so.*
|
||||||
|
|
||||||
|
# Ignore wasm data in examples/
|
||||||
|
examples/**/*.wasm
|
||||||
|
examples/**/*.data
|
||||||
|
examples/**/*.js
|
||||||
|
examples/**/*.html
|
||||||
|
|
||||||
|
# Ignore files build by xcode
|
||||||
|
*.mode*v*
|
||||||
|
*.pbxuser
|
||||||
|
*.xcbkptlist
|
||||||
|
*.xcscheme
|
||||||
|
*.xcworkspacedata
|
||||||
|
*.xcuserstate
|
||||||
|
*.xccheckout
|
||||||
|
xcschememanagement.plist
|
||||||
|
.DS_Store
|
||||||
|
._.*
|
||||||
|
xcuserdata/
|
||||||
|
DerivedData/
|
||||||
|
|
||||||
|
# Jetbrains project
|
||||||
|
.idea/
|
||||||
|
cmake-build-*/
|
||||||
|
|
||||||
|
# CMake stuff
|
||||||
|
CMakeCache.txt
|
||||||
|
CMakeFiles
|
||||||
|
CMakeScripts
|
||||||
|
Testing
|
||||||
|
cmake_install.cmake
|
||||||
|
install_manifest.txt
|
||||||
|
compile_commands.json
|
||||||
|
CTestTestfile.cmake
|
||||||
|
build
|
||||||
|
|
||||||
|
# Ignore GNU global tags
|
||||||
|
GPATH
|
||||||
|
GRTAGS
|
||||||
|
GTAGS
|
||||||
|
|
||||||
|
# Zig programming language
|
||||||
|
zig-cache/
|
||||||
|
zig-out/
|
||||||
|
build/
|
||||||
|
build-*/
|
||||||
|
docgen_tmp/
|
||||||
|
|
||||||
|
# Parser stuff
|
||||||
|
parser/raylib_parser
|
160
3party/raylib/BINDINGS.md
Normal file
@ -0,0 +1,160 @@
|
|||||||
|
# raylib bindings and wrappers
|
||||||
|
|
||||||
|
Some people ported raylib to other languages in form of bindings or wrappers to the library. Here is a list with all the ports available. Feel free to send a PR if you know of any binding/wrapper not in this list.
|
||||||
|
|
||||||
|
### Language Bindings
|
||||||
|
|
||||||
|
| name | raylib version | language | license | repo |
|
||||||
|
|:------------------:|:---------------:|:---------:|:----------:|-----------------------------------------------------------|
|
||||||
|
| raylib | **4.5** | [C/C++](https://en.wikipedia.org/wiki/C_(programming_language)) | Zlib | https://github.com/raysan5/raylib |
|
||||||
|
| raylib-boo | 3.7 | [Boo](http://boo-language.github.io/)| MIT | https://github.com/Rabios/raylib-boo |
|
||||||
|
| Raylib-cs | **4.5** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib | https://github.com/ChrisDill/Raylib-cs |
|
||||||
|
| Raylib-CsLo | 4.2 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 | https://github.com/NotNotTech/Raylib-CsLo |
|
||||||
|
| cl-raylib | 4.0 | [Common Lisp](https://common-lisp.net/) | MIT | https://github.com/longlene/cl-raylib |
|
||||||
|
| claylib/wrap | **4.5** | [Common Lisp](https://common-lisp.net/) | Zlib | https://github.com/defun-games/claylib |
|
||||||
|
| claw-raylib | **auto** | [Common Lisp](https://common-lisp.net/) | Apache-2.0 | https://github.com/bohonghuang/claw-raylib |
|
||||||
|
| chez-raylib | **auto** | [Chez Scheme](https://cisco.github.io/ChezScheme/) | GPLv3 | https://github.com/Yunoinsky/chez-raylib |
|
||||||
|
| raylib-cr | **4.6-dev (5e1a81)** | [Crystal](https://crystal-lang.org/) | Apache-2.0 | https://github.com/sol-vin/raylib-cr |
|
||||||
|
| ray-cyber | 4.5 | [Cyber](https://cyberscript.dev) | MIT | https://github.com/fubark/ray-cyber |
|
||||||
|
| raylib-c3 | **4.5** | [C3](https://c3-lang.org/) | Zlib | https://github.com/Its-Kenta/Raylib-C3 |
|
||||||
|
| dart-raylib | 4.0 | [Dart](https://dart.dev/) | MIT | https://gitlab.com/wolfenrain/dart-raylib |
|
||||||
|
| bindbc-raylib3 | **4.5** | [D](https://dlang.org/) | BSL-1.0 | https://github.com/o3o/bindbc-raylib3 |
|
||||||
|
| dray | 4.2 | [D](https://dlang.org/) | Apache-2.0 | https://github.com/redthing1/dray |
|
||||||
|
| raylib-d | **4.5** | [D](https://dlang.org/) | Zlib | https://github.com/schveiguy/raylib-d |
|
||||||
|
| dlang_raylib | 4.0 | [D](https://dlang.org) | MPL-2.0 |https://github.com/rc-05/dlang_raylib |
|
||||||
|
| rayex | 3.7 | [elixir](https://elixir-lang.org/) | Apache-2.0 | https://github.com/shiryel/rayex |
|
||||||
|
| raylib-factor | **4.5** | [Factor](https://factorcode.org/) | BSD | https://github.com/factor/factor/blob/master/extra/raylib/raylib.factor |
|
||||||
|
| raylib-freebasic | **4.5** | [FreeBASIC](https://www.freebasic.net/) | MIT | https://github.com/WIITD/raylib-freebasic |
|
||||||
|
| fortran-raylib | **4.5** | [Fortran](https://fortran-lang.org/) | ISC | https://github.com/interkosmos/fortran-raylib |
|
||||||
|
| raylib for Pascal | **4.5** | [Object Pascal](https://en.wikipedia.org/wiki/Object_Pascal) | Modified Zlib | https://github.com/tinyBigGAMES/raylib |
|
||||||
|
| raylib-go | 4.5 | [Go](https://golang.org/) | Zlib | https://github.com/gen2brain/raylib-go |
|
||||||
|
| raylib-guile | **auto** | [Guile](https://www.gnu.org/software/guile/) | Zlib | https://github.com/petelliott/raylib-guile |
|
||||||
|
| gforth-raylib | 3.5 | [Gforth](https://gforth.org/) | MIT | https://github.com/ArnautDaniel/gforth-raylib |
|
||||||
|
| h-raylib | **4.6-dev** | [Haskell](https://haskell.org/) | Apache-2.0 | https://github.com/Anut-py/h-raylib |
|
||||||
|
| raylib-hx | 4.2 | [Haxe](https://haxe.org/) | Zlib | https://github.com/foreignsasquatch/raylib-hx |
|
||||||
|
| hb-raylib | 3.5 | [Harbour](https://harbour.github.io) | MIT | https://github.com/MarcosLeonardoMendezGerencir/hb-raylib |
|
||||||
|
| jaylib | 4.5 | [Janet](https://janet-lang.org/) | MIT | https://github.com/janet-lang/jaylib |
|
||||||
|
| jaylib | 4.2 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | GPLv3+CE | https://github.com/electronstudio/jaylib/ |
|
||||||
|
| raylib-j | 4.0 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | Zlib | https://github.com/CreedVI/Raylib-J |
|
||||||
|
| raylib.jl | 4.2 | [Julia](https://julialang.org/) | Zlib | https://github.com/irishgreencitrus/raylib.jl |
|
||||||
|
| kaylib | 3.7 | [Kotlin/native](https://kotlinlang.org) | ? | https://github.com/electronstudio/kaylib |
|
||||||
|
| KaylibKit | **4.5**| [Kotlin/native](https://kotlinlang.org) | Zlib | https://codeberg.org/Kenta/KaylibKit |
|
||||||
|
| raylib-lua | **4.5** | [Lua](http://www.lua.org/) | ISC | https://github.com/TSnake41/raylib-lua |
|
||||||
|
| raylua | 4.0 | [Lua](http://www.lua.org/) | MIT | https://github.com/Rabios/raylua |
|
||||||
|
| nelua-raylib | 4.0 | [nelua](https://nelua.io/) | MIT | https://github.com/AKDev21/nelua-raylib |
|
||||||
|
| Raylib.nelua | **4.5** | [nelua](https://nelua.io/) | Zlib | https://github.com/Its-Kenta/Raylib-Nelua |
|
||||||
|
| NimraylibNow! | 4.2 | [Nim](https://nim-lang.org/) | MIT | https://github.com/greenfork/nimraylib_now |
|
||||||
|
| raylib-bindings | **4.5** | [Ruby](https://www.ruby-lang.org/en/) | Zlib | https://github.com/vaiorabbit/raylib-bindings |
|
||||||
|
| raylib-Forever | auto | [Nim](https://nim-lang.org/) | ? | https://github.com/Guevara-chan/Raylib-Forever |
|
||||||
|
| naylib | auto | [Nim](https://nim-lang.org/) | MIT | https://github.com/planetis-m/naylib |
|
||||||
|
| node-raylib | **4.5** | [Node.js](https://nodejs.org/en/) | Zlib | https://github.com/RobLoach/node-raylib |
|
||||||
|
| raylib-odin | **4.5** | [Odin](https://odin-lang.org/) | BSD-3Clause | https://github.com/odin-lang/Odin/tree/master/vendor/raylib |
|
||||||
|
| raylib_odin_bindings | 4.0-dev | [Odin](https://odin-lang.org/) | MIT | https://github.com/Deathbat2190/raylib_odin_bindings |
|
||||||
|
| raylib-ocaml | **4.5** | [OCaml](https://ocaml.org/) | MIT | https://github.com/tjammer/raylib-ocaml |
|
||||||
|
| TurboRaylib | **4.5** | [Object Pascal](https://en.wikipedia.org/wiki/Object_Pascal) | MIT | https://github.com/turborium/TurboRaylib |
|
||||||
|
| Ray4Laz | **4.5** | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal)| Zlib | https://github.com/GuvaCode/Ray4Laz |
|
||||||
|
| Raylib.4.0.Pascal | 4.0 | [Free Pascal](https://en.wikipedia.org/wiki/Free_Pascal)| Zlib | https://github.com/sysrpl/Raylib.4.0.Pascal |
|
||||||
|
| pyraylib | 3.7 | [Python](https://www.python.org/) | Zlib | https://github.com/Ho011/pyraylib |
|
||||||
|
| raylib-python-cffi | 4.2 | [Python](https://www.python.org/) | EPL-2.0 | https://github.com/electronstudio/raylib-python-cffi |
|
||||||
|
| raylibpyctbg | **4.5** | [Python](https://www.python.org/) | MIT | https://github.com/overdev/raylibpyctbg |
|
||||||
|
| raylib-py | **4.5** | [Python](https://www.python.org/) | MIT | https://github.com/overdev/raylib-py |
|
||||||
|
| raylib-python-ctypes | 4.6-dev | [Python](https://www.python.org/) | MIT | https://github.com/sDos280/raylib-python-ctypes |
|
||||||
|
| raylib-pkpy-bindings | 4.6-dev | [pocketpy](https://pocketpy.dev/) | MIT | https://github.com/blueloveTH/pkpy-bindings |
|
||||||
|
| raylib-php | **4.5** | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib | https://github.com/joseph-montanez/raylib-php |
|
||||||
|
| raylib-phpcpp | 3.5 | [PHP](https://en.wikipedia.org/wiki/PHP) | Zlib | https://github.com/oraoto/raylib-phpcpp |
|
||||||
|
| raylibr | 4.0 | [R](https://www.r-project.org) | MIT | https://github.com/jeroenjanssens/raylibr |
|
||||||
|
| raylib-ffi | 4.5 | [Rust](https://www.rust-lang.org/) | GPLv3 | https://github.com/ewpratten/raylib-ffi |
|
||||||
|
| raylib-rs | 3.5 | [Rust](https://www.rust-lang.org/) | Zlib | https://github.com/deltaphc/raylib-rs |
|
||||||
|
| Relib | 3.5 | [ReCT](https://github.com/RedCubeDev-ByteSpace/ReCT) | ? | https://github.com/RedCubeDev-ByteSpace/Relib |
|
||||||
|
| racket-raylib | 4.0 | [Racket](https://racket-lang.org/) | MIT/Apache-2.0 | https://github.com/eutro/racket-raylib |
|
||||||
|
| raylib-swift | 4.0 | [Swift](https://swift.org/) | MIT | https://github.com/STREGAsGate/Raylib |
|
||||||
|
| raylib-scopes | auto | [Scopes](http://scopes.rocks) | MIT | https://github.com/salotz/raylib-scopes |
|
||||||
|
| raylib-smallBasic | 4.1-dev | [SmallBASIC](https://github.com/smallbasic/SmallBASIC) | GPLv3 | https://github.com/smallbasic/smallbasic.plugins/tree/master/raylib |
|
||||||
|
| raylib-umka | **4.5** | [Umka](https://github.com/vtereshkov/umka-lang) | Zlib | https://github.com/robloach/raylib-umka |
|
||||||
|
| raylib.v | 4.2 | [V](https://vlang.io/) | Zlib | https://github.com/irishgreencitrus/raylib.v |
|
||||||
|
| raylib-vapi | 4.2 | [Vala](https://vala.dev/) | Zlib | https://github.com/lxmcf/raylib-vapi |
|
||||||
|
| raylib-wren | 4.0 | [Wren](http://wren.io/) | ISC | https://github.com/TSnake41/raylib-wren |
|
||||||
|
| raylib-zig | 4.2 | [Zig](https://ziglang.org/) | MIT | https://github.com/Not-Nik/raylib-zig |
|
||||||
|
| raylib.zig | **4.5** | [Zig](https://ziglang.org/) | MIT | https://github.com/ryupold/raylib.zig |
|
||||||
|
| hare-raylib | **auto** | [Hare](https://harelang.org/) | Zlib | https://git.sr.ht/~evantj/hare-raylib |
|
||||||
|
| raylib-sunder | **auto** | [Sunder](https://github.com/ashn-dot-dev/sunder) | 0BSD | https://github.com/ashn-dot-dev/raylib-sunder |
|
||||||
|
| rayed-bqn | **auto** | [BQN](https://mlochbaum.github.io/BQN/) | MIT | https://github.com/Brian-ED/rayed-bqn |
|
||||||
|
| rayjs | 4.6-dev | [QuickJS](https://bellard.org/quickjs/) | MIT | https://github.com/mode777/rayjs |
|
||||||
|
| raylib-raku | **auto** | [Raku](https://www.raku.org/) | Artistic License 2.0 | https://github.com/vushu/raylib-raku |
|
||||||
|
|
||||||
|
### Utility Wrapers
|
||||||
|
These are utility wrappers for specific languages, they are not required to use raylib in the language but may adapt the raylib API to be more inline with the language's pardigm.
|
||||||
|
| name | raylib version | language | license | repo |
|
||||||
|
|:------------------:|:-------------: | :--------:|:-------:|:-------------------------------------------------------------|
|
||||||
|
| raylib-cpp | **4.5** | [C++](https://en.wikipedia.org/wiki/C%2B%2B) | Zlib | https://github.com/robloach/raylib-cpp |
|
||||||
|
| claylib | **4.5** | [Common Lisp](https://common-lisp.net/) | Zlib | https://github.com/defun-games/claylib |
|
||||||
|
|
||||||
|
### Older or Unmaintained Language Bindings
|
||||||
|
These are older raylib bindings that are more than 2 versions old or have not been maintained.
|
||||||
|
| name | raylib version | language | repo |
|
||||||
|
|:------------------:|:-------------: | :--------:|----------------------------------------------------------------------|
|
||||||
|
| raylib-cppsharp | 2.5 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | https://github.com/phxvyper/raylib-cppsharp |
|
||||||
|
| RaylibFS | 2.5 | [F#](https://fsharp.org/) | https://github.com/dallinbeutler/RaylibFS |
|
||||||
|
| raylib_d | 2.5 | [D](https://dlang.org/) | https://github.com/Sepheus/raylib_d |
|
||||||
|
| bindbc-raylib | 3.0 | [D](https://dlang.org/) | https://github.com/o3o/bindbc-raylib |
|
||||||
|
| go-raylib | 3.5 | [Go](https://golang.org/) | https://github.com/chunqian/go-raylib |
|
||||||
|
| raylib-goplus | 2.6-dev | [Go](https://golang.org/) | https://github.com/Lachee/raylib-goplus |
|
||||||
|
| ray-go | 2.6-dev | [Go](https://golang.org/) | https://github.com/hecate-tech/ray-go |
|
||||||
|
| raylib-luamore | 3.0 | [Lua](http://www.lua.org/) | https://github.com/HDPLocust/raylib-luamore |
|
||||||
|
| LuaJIT-Raylib | 2.6 | [Lua](http://www.lua.org/) | https://github.com/Bambofy/LuaJIT-Raylib |
|
||||||
|
| raylib-lua-sol | 2.5 | [Lua](http://www.lua.org/) | https://github.com/RobLoach/raylib-lua-sol |
|
||||||
|
| raylib-lua-ffi | 2.0 | [Lua](http://www.lua.org/) | https://github.com/raysan5/raylib/issues/693 |
|
||||||
|
| raylib-lua | 1.7 | [Lua](http://www.lua.org/) | https://github.com/raysan5/raylib-lua |
|
||||||
|
| raylib-nelua | 3.0 | [Nelua](https://nelua.io/) | https://github.com/Andre-LA/raylib-nelua |
|
||||||
|
| raylib-nim | 2.0 | [Nim](https://nim-lang.org/) | https://github.com/Skrylar/raylib-nim |
|
||||||
|
| raylib-Nim | 1.7 | [Nim](https://nim-lang.org/) | https://gitlab.com/define-private-public/raylib-Nim |
|
||||||
|
| nim-raylib | 3.1-dev | [Nim](https://nim-lang.org/) | https://github.com/tomc1998/nim-raylib |
|
||||||
|
| raylib-haskell | 2.0 | [Haskell](https://www.haskell.org/) | https://github.com/DevJac/raylib-haskell |
|
||||||
|
| raylib-cr | 2.5-dev | [Crystal](https://crystal-lang.org/) | https://github.com/AregevDev/raylib-cr |
|
||||||
|
| raylib.cr | 2.0 | [Crystal](https://crystal-lang.org/) | https://github.com/sam0x17/raylib.cr |
|
||||||
|
| cray | 1.8 | [Crystal](https://crystal-lang.org/) | https://gitlab.com/Zatherz/cray |
|
||||||
|
| raylib-pas | 3.0 | [Pascal](https://en.wikipedia.org/wiki/Pascal_(programming_language)) | https://github.com/tazdij/raylib-pas |
|
||||||
|
| raylib-pascal | 2.0 | [Pascal](https://en.wikipedia.org/wiki/Pascal_(programming_language)) | https://github.com/drezgames/raylib-pascal |
|
||||||
|
| Graphics-Raylib | 1.4 | [Perl](https://www.perl.org/) | https://github.com/athreef/Graphics-Raylib |
|
||||||
|
| raylib-ruby | 2.6 | [Ruby](https://www.ruby-lang.org/en/) | https://github.com/a0/raylib-ruby |
|
||||||
|
| raylib-ruby-ffi | 2.0 | [Ruby](https://www.ruby-lang.org/en/) | https://github.com/D3nX/raylib-ruby-ffi |
|
||||||
|
| raylib-mruby | 2.5-dev | [mruby](https://github.com/mruby/mruby) | https://github.com/lihaochen910/raylib-mruby |
|
||||||
|
| raylib-java | 2.0 | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | https://github.com/XoanaIO/raylib-java |
|
||||||
|
| clj-raylib | 3.0 | [Clojure](https://clojure.org/) | https://github.com/lsevero/clj-raylib |
|
||||||
|
| QuickJS-raylib | 3.0 | [QuickJS](https://bellard.org/quickjs/) | https://github.com/sntg-p/QuickJS-raylib |
|
||||||
|
| raylib-duktape | 2.6 | [JavaScript (Duktape)](https://en.wikipedia.org/wiki/JavaScript) | https://github.com/RobLoach/raylib-duktape |
|
||||||
|
| raylib-v7 | 3.5 | [JavaScript (v7)](https://en.wikipedia.org/wiki/JavaScript) | https://github.com/Rabios/raylib-v7 |
|
||||||
|
| raylib-chaiscript | 2.6 | [ChaiScript](http://chaiscript.com/) | https://github.com/RobLoach/raylib-chaiscript |
|
||||||
|
| raylib-squirrel | 2.5 | [Squirrel](http://www.squirrel-lang.org/) | https://github.com/RobLoach/raylib-squirrel |
|
||||||
|
| racket-raylib-2d | 2.5 | [Racket](https://racket-lang.org/) | https://github.com/arvyy/racket-raylib-2d |
|
||||||
|
| raylib-php-ffi | 2.4-dev | [PHP](https://en.wikipedia.org/wiki/PHP) | https://github.com/oraoto/raylib-php-ffi |
|
||||||
|
| raylib-haxe | 2.4 | [Haxe](https://haxe.org/) | https://github.com/ibilon/raylib-haxe |
|
||||||
|
| ringraylib | 2.6 | [Ring](http://ring-lang.sourceforge.net/) | https://github.com/ringpackages/ringraylib |
|
||||||
|
| raylib-scm | 2.5 | [Chicken Scheme](https://www.call-cc.org/) | https://github.com/yashrk/raylib-scm |
|
||||||
|
| raylib-chibi | 2.5 | [Chibi-Scheme](https://github.com/ashinn/chibi-scheme) | https://github.com/VincentToups/raylib-chibi |
|
||||||
|
| raylib-gambit-scheme | 3.1-dev | [Gambit Scheme](https://github.com/gambit/gambit) | https://github.com/georgjz/raylib-gambit-scheme |
|
||||||
|
| Euraylib | 3.0 | [Euphoria](https://openeuphoria.org/) | https://github.com/gAndy50/Euraylib |
|
||||||
|
| raylib-odin | 3.0 | [Odin](https://odin-lang.org/) | https://github.com/kevinw/raylib-odin |
|
||||||
|
| vraylib | 3.5 | [V](https://vlang.io/) | https://github.com/waotzi/vraylib |
|
||||||
|
| raylib-vala | 3.0 | [Vala](https://wiki.gnome.org/Projects/Vala) | https://code.guddler.uk/mart/raylibVapi |
|
||||||
|
| raylib-jai | 3.1-dev | [Jai](https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md) | https://github.com/kujukuju/raylib-jai |
|
||||||
|
| ray.zig | 2.5 | [Zig](https://ziglang.org/) | https://github.com/BitPuffin/zig-raylib-experiments |
|
||||||
|
| raylib-Ada | 3.0 | [Ada](https://www.adacore.com/about-ada) | https://github.com/mimo/raylib-Ada |
|
||||||
|
| raykit | ? | [Kit](https://www.kitlang.org/) | https://github.com/Gamerfiend/raykit |
|
||||||
|
| ray.mod | 3.0 | [BlitzMax](https://blitzmax.org/) | https://github.com/bmx-ng/ray.mod |
|
||||||
|
| raylib-mosaic | 3.0 | [Mosaic](https://github.com/sal55/langs/tree/master/Mosaic) | https://github.com/pluckyporcupine/raylib-mosaic |
|
||||||
|
| raylib-xdpw | 2.6 | [XD Pascal](https://github.com/vtereshkov/xdpw) | https://github.com/vtereshkov/raylib-xdpw |
|
||||||
|
| raylib-carp | 3.0 | [Carp](https://github.com/carp-lang/Carp) | https://github.com/pluckyporcupine/raylib-carp |
|
||||||
|
| raylib-fb | 3.0 | [FreeBasic](https://www.freebasic.net/) | https://github.com/IchMagBier/raylib-fb |
|
||||||
|
| raylib-purebasic | 3.0 | [PureBasic](https://www.purebasic.com/) | https://github.com/D-a-n-i-l-o/raylib-purebasic |
|
||||||
|
| raylib-ats2 | 3.0 | [ATS2](http://www.ats-lang.org/) | https://github.com/mephistopheles-8/raylib-ats2 |
|
||||||
|
| raylib-beef | 3.0 | [Beef](https://www.beeflang.org/) | https://github.com/M0n7y5/raylib-beef |
|
||||||
|
| raylib-never | 3.0 | [Never](https://github.com/never-lang/never) | https://github.com/never-lang/raylib-never |
|
||||||
|
| raylib.cbl | 2.0 | [COBOL](https://en.wikipedia.org/wiki/COBOL) | *[code examples](https://github.com/Martinfx/Cobol/tree/master/OpenCobol/Games/raylib)* |
|
||||||
|
|
||||||
|
|
||||||
|
Missing some language or wrapper? Feel free to create a new one! :)
|
||||||
|
|
||||||
|
Usually, raylib bindings follow the convention: `raylib-{language}`
|
||||||
|
|
||||||
|
Let me know if you're writing a new binding for raylib, I will list it here!
|
1888
3party/raylib/CHANGELOG
Normal file
45
3party/raylib/CMakeLists.txt
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.0)
|
||||||
|
project(raylib)
|
||||||
|
|
||||||
|
# Avoid excessive expansion of variables in conditionals. In particular, if
|
||||||
|
# "PLATFORM" is "DRM" than:
|
||||||
|
#
|
||||||
|
# if (${PLATFORM} MATCHES "DRM")
|
||||||
|
#
|
||||||
|
# may expand e.g to:
|
||||||
|
#
|
||||||
|
# if (/usr/lib/aarch64-linux-gnu/libdrm.so MATCHES "DRM")
|
||||||
|
#
|
||||||
|
# See https://cmake.org/cmake/help/latest/policy/CMP0054.html
|
||||||
|
cmake_policy(SET CMP0054 NEW)
|
||||||
|
|
||||||
|
# Directory for easier includes
|
||||||
|
# Anywhere you see include(...) you can check <root>/cmake for that file
|
||||||
|
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||||
|
|
||||||
|
# RAYLIB_IS_MAIN determines whether the project is being used from root
|
||||||
|
# or if it is added as a dependency (through add_subdirectory for example).
|
||||||
|
if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
|
set(RAYLIB_IS_MAIN TRUE)
|
||||||
|
else()
|
||||||
|
set(RAYLIB_IS_MAIN FALSE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Sets compiler flags and language standard
|
||||||
|
include(CompilerFlags)
|
||||||
|
|
||||||
|
# Registers build options that are exposed to cmake
|
||||||
|
include(CMakeOptions.txt)
|
||||||
|
|
||||||
|
# Enforces a few environment and compiler configurations
|
||||||
|
include(BuildOptions)
|
||||||
|
|
||||||
|
# Main sources directory (the second parameter sets the output directory name to raylib)
|
||||||
|
add_subdirectory(src raylib)
|
||||||
|
|
||||||
|
if (${BUILD_EXAMPLES})
|
||||||
|
MESSAGE(STATUS "Building examples is enabled")
|
||||||
|
add_subdirectory(examples)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
enable_testing()
|
102
3party/raylib/CMakeOptions.txt
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
### Config options ###
|
||||||
|
include(CMakeDependentOption)
|
||||||
|
include(EnumOption)
|
||||||
|
|
||||||
|
enum_option(PLATFORM "Desktop;Web;Android;Raspberry Pi;DRM" "Platform to build for.")
|
||||||
|
|
||||||
|
enum_option(OPENGL_VERSION "OFF;4.3;3.3;2.1;1.1;ES 2.0" "Force a specific OpenGL Version?")
|
||||||
|
|
||||||
|
# Configuration options
|
||||||
|
option(BUILD_EXAMPLES "Build the examples." ${RAYLIB_IS_MAIN})
|
||||||
|
option(CUSTOMIZE_BUILD "Show options for customizing your Raylib library build." OFF)
|
||||||
|
option(ENABLE_ASAN "Enable AddressSanitizer (ASAN) for debugging (degrades performance)" OFF)
|
||||||
|
option(ENABLE_UBSAN "Enable UndefinedBehaviorSanitizer (UBSan) for debugging" OFF)
|
||||||
|
option(ENABLE_MSAN "Enable MemorySanitizer (MSan) for debugging (not recommended to run with ASAN)" OFF)
|
||||||
|
|
||||||
|
# Shared library is always PIC. Static library should be PIC too if linked into a shared library
|
||||||
|
option(WITH_PIC "Compile static library as position-independent code" OFF)
|
||||||
|
option(BUILD_SHARED_LIBS "Build raylib as a shared library" OFF)
|
||||||
|
option(MACOS_FATLIB "Build fat library for both i386 and x86_64 on macOS" OFF)
|
||||||
|
cmake_dependent_option(USE_AUDIO "Build raylib with audio module" ON CUSTOMIZE_BUILD ON)
|
||||||
|
|
||||||
|
enum_option(USE_EXTERNAL_GLFW "OFF;IF_POSSIBLE;ON" "Link raylib against system GLFW instead of embedded one")
|
||||||
|
if(UNIX AND NOT APPLE)
|
||||||
|
option(USE_WAYLAND "Use Wayland for window creation" OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
option(INCLUDE_EVERYTHING "Include everything disabled by default (for CI usage" OFF)
|
||||||
|
set(OFF ${INCLUDE_EVERYTHING} CACHE INTERNAL "Replace any OFF by default with \${OFF} to have it covered by this option")
|
||||||
|
|
||||||
|
# raylib modules included
|
||||||
|
cmake_dependent_option(SUPPORT_MODULE_RSHAPES "Include module: rshapes" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_MODULE_RTEXTURES "Include module: rtextures" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_MODULE_RTEXT "Include module: rtext" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_MODULE_RMODELS "Include module: rmodels" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_MODULE_RAUDIO "Include module: raudio" ON CUSTOMIZE_BUILD ON)
|
||||||
|
|
||||||
|
# rcore.c
|
||||||
|
cmake_dependent_option(SUPPORT_CAMERA_SYSTEM "Provide camera module (rcamera.h) with multiple predefined cameras: free, 1st/3rd person, orbital" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_GESTURES_SYSTEM "Gestures module is included (rgestures.h) to support gestures detection: tap, hold, swipe, drag" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_MOUSE_GESTURES "Mouse gestures are directly mapped like touches and processed by gestures system" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_SSH_KEYBOARD_RPI "Reconfigure standard input to receive key inputs, works with SSH connection" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_DEFAULT_FONT "Default font is loaded on window initialization to be available for the user to render simple text. If enabled, uses external module functions to load default raylib font (module: text)" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_SCREEN_CAPTURE "Allow automatic screen capture of current screen pressing F12, defined in KeyCallback()" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_GIF_RECORDING "Allow automatic gif recording of current screen pressing CTRL+F12, defined in KeyCallback()" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_BUSY_WAIT_LOOP "Use busy wait loop for timing sync instead of a high-resolution timer" OFF CUSTOMIZE_BUILD OFF)
|
||||||
|
cmake_dependent_option(SUPPORT_EVENTS_WAITING "Wait for events passively (sleeping while no events) instead of polling them actively every frame" OFF CUSTOMIZE_BUILD OFF)
|
||||||
|
cmake_dependent_option(SUPPORT_WINMM_HIGHRES_TIMER "Setting a higher resolution can improve the accuracy of time-out intervals in wait functions" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_COMPRESSION_API "Support for compression API" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_EVENTS_AUTOMATION "Support automatic generated events, loading and recording of those events when required" OFF CUSTOMIZE_BUILD OFF)
|
||||||
|
cmake_dependent_option(SUPPORT_CUSTOM_FRAME_CONTROL "Enabling this flag allows manual control of the frame processes, use at your own risk" OFF CUSTOMIZE_BUILD OFF)
|
||||||
|
|
||||||
|
# rshapes.c
|
||||||
|
cmake_dependent_option(SUPPORT_QUADS_DRAW_MODE "Use QUADS instead of TRIANGLES for drawing when possible. Some lines-based shapes could still use lines" ON CUSTOMIZE_BUILD ON)
|
||||||
|
|
||||||
|
# rtextures.c
|
||||||
|
cmake_dependent_option(SUPPORT_IMAGE_EXPORT "Support image exporting to file" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_IMAGE_GENERATION "Support procedural image generation functionality (gradient, spot, perlin-noise, cellular)" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_IMAGE_MANIPULATION "Support multiple image editing functions to scale, adjust colors, flip, draw on images, crop... If not defined only three image editing functions supported: ImageFormat(), ImageAlphaMask(), ImageToPOT()" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_PNG "Support loading PNG as textures" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_DDS "Support loading DDS as textures" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_HDR "Support loading HDR as textures" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_PIC "Support loading PIC as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_PNM "Support loading PNM as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_KTX "Support loading KTX as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_ASTC "Support loading ASTC as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_BMP "Support loading BMP as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_TGA "Support loading TGA as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_JPG "Support loading JPG as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_GIF "Support loading GIF as textures" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_QOI "Support loading QOI as textures" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_PSD "Support loading PSD as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_PKM "Support loading PKM as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_PVR "Support loading PVR as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_SVG "Support loading SVG as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
|
|
||||||
|
# rtext.c
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_FNT "Support loading fonts in FNT format" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_TTF "Support loading font in TTF/OTF format" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_TEXT_MANIPULATION "Support text manipulation functions" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_FONT_ATLAS_WHITE_REC "Support white rec on font atlas bottom-right corner" ON CUSTOMIZE_BUILD ON)
|
||||||
|
|
||||||
|
# rmodels.c
|
||||||
|
cmake_dependent_option(SUPPORT_MESH_GENERATION "Support procedural mesh generation functions, uses external par_shapes.h library. NOTE: Some generated meshes DO NOT include generated texture coordinates" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_OBJ "Support loading OBJ file format" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_MTL "Support loading MTL file format" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_IQM "Support loading IQM file format" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_GLTF "Support loading GLTF file format" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_VOX "Support loading VOX file format" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_M3D "Support loading M3D file format" ON CUSTOMIZE_BUILD ON)
|
||||||
|
|
||||||
|
# raudio.c
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_WAV "Support loading WAV for sound" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_OGG "Support loading OGG for sound" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_XM "Support loading XM for sound" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_MOD "Support loading MOD for sound" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_MP3 "Support loading MP3 for sound" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_QOA "Support loading QOA for sound" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_FLAC "Support loading FLAC for sound" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
|
|
||||||
|
# utils.c
|
||||||
|
cmake_dependent_option(SUPPORT_STANDARD_FILEIO "Support standard file io library (stdio.h)" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_TRACELOG "Show TraceLog() output messages. NOTE: By default LOG_DEBUG traces not shown" ON CUSTOMIZE_BUILD ON)
|
76
3party/raylib/CONTRIBUTING.md
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
## Contributing to raylib
|
||||||
|
|
||||||
|
Hello contributors! Welcome to raylib!
|
||||||
|
|
||||||
|
Do you enjoy raylib and want to contribute? Nice! You can help with the following points:
|
||||||
|
|
||||||
|
- `C programming` - Can you write/review/test/improve the code?
|
||||||
|
- `Documentation/Tutorials/Example` - Can you write some tutorial/example?
|
||||||
|
- `Porting to other platforms` - Can you port/adapt/compile raylib on other systems?
|
||||||
|
- `Web Development` - Can you help [with the website](https://github.com/raysan5/raylib.com)?
|
||||||
|
- `Testing` - Can you find some bugs in raylib?
|
||||||
|
|
||||||
|
This document contains a set of guidelines to contribute to the project. These are mostly guidelines, not rules.
|
||||||
|
Use your best judgement, and feel free to propose changes to this document in a pull request.
|
||||||
|
|
||||||
|
### raylib philosophy
|
||||||
|
|
||||||
|
- raylib is a tool to **ENJOY** videogames programming, every function in raylib is designed as a mini-tutorial on itself.
|
||||||
|
- raylib is **SIMPLE** and **EASY-TO-USE**, I tried to keep it compact with a small set of functions, if a function is too complex, better not including it.
|
||||||
|
- raylib is open source and free; educators and institutions can use this tool to **TEACH** videogames programming completely for free.
|
||||||
|
- raylib is collaborative; contribution of tutorials / code examples / bug fixes / code comments are highly appreciated.
|
||||||
|
- raylib's license (and its external libs respective licenses) allow using raylib on commercial projects.
|
||||||
|
|
||||||
|
### Some interesting reads to start with
|
||||||
|
|
||||||
|
- [raylib history](HISTORY.md)
|
||||||
|
- [raylib architecture](https://github.com/raysan5/raylib/wiki/raylib-architecture)
|
||||||
|
- [raylib license](LICENSE)
|
||||||
|
- [raylib roadmap](ROADMAP.md)
|
||||||
|
|
||||||
|
[raylib Wiki](https://github.com/raysan5/raylib/wiki) contains some information about the library and is open to anyone for edit.
|
||||||
|
Feel free to review it if required, just take care not to break something.
|
||||||
|
|
||||||
|
### raylib C coding conventions
|
||||||
|
|
||||||
|
Despite being written in C, raylib does not follow the standard Hungarian notation for C,
|
||||||
|
it [follows Pascal-case/camel-case notation](https://github.com/raysan5/raylib/wiki/raylib-coding-conventions),
|
||||||
|
more common on C# language. All code formatting decisions have been carefully taken
|
||||||
|
to make it easier for students/users to read, write and understand code.
|
||||||
|
|
||||||
|
Source code is extensively commented for that purpose, raylib primary learning method is:
|
||||||
|
|
||||||
|
> `Learn by reading code and examples`
|
||||||
|
|
||||||
|
For detailed information on building raylib and examples, please check [raylib Wiki](https://github.com/raysan5/raylib/wiki).
|
||||||
|
|
||||||
|
### Opening new Issues
|
||||||
|
|
||||||
|
To open new issue for raylib (bug, enhancement, discussion...), just try to follow these rules:
|
||||||
|
|
||||||
|
- Make sure the issue has not already been reported before by searching on GitHub under Issues.
|
||||||
|
- If you're unable to find an open issue addressing the problem, open a new one. Be sure to include a
|
||||||
|
title and clear description, as much relevant information as possible, and a code sample demonstrating the unexpected behavior.
|
||||||
|
- If applies, attach some screenshot of the issue and a .zip file with the code sample and required resources.
|
||||||
|
- On issue description, add a brackets tag about the raylib module that relates to this issue.
|
||||||
|
If don't know which module, just report the issue, I will review it.
|
||||||
|
- You can check other issues to see how is being done!
|
||||||
|
|
||||||
|
### Sending a Pull-Request
|
||||||
|
|
||||||
|
- Make sure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.
|
||||||
|
- Don't send big pull requests (lots of changelists), they are difficult to review. It's better to send small pull requests, one at a time.
|
||||||
|
- Verify that changes don't break the build (at least on Windows platform). As many platforms where you can test it, the better, but don't worry
|
||||||
|
if you cannot test all the platforms.
|
||||||
|
|
||||||
|
### Contact information
|
||||||
|
|
||||||
|
If you have any doubt, don't hesitate to [contact me](mailto:ray@raylib.com)!.
|
||||||
|
You can write me a direct mail but you can also contact me on the following networks:
|
||||||
|
|
||||||
|
- [raylib Discord](https://discord.gg/raylib) - A direct communication channel for project discussions.
|
||||||
|
- [raylib twitter](https://twitter.com/raysan5) - My personal twitter account, I usually post about raylib, you can send me PMs.
|
||||||
|
- [raylib reddit](https://www.reddit.com/r/raylib/) - A good place for discussions or to ask for help.
|
||||||
|
- [raylib web](http://www.raylib.com/) - On top-right corner there is a bunch of networks where you can find me.
|
||||||
|
|
||||||
|
Thank you very much for your time! :)
|
94
3party/raylib/CONVENTIONS.md
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
## C Coding Style Conventions
|
||||||
|
|
||||||
|
Here it is a list with some of the code conventions used by raylib:
|
||||||
|
|
||||||
|
Code element | Convention | Example
|
||||||
|
--- | :---: | ---
|
||||||
|
Defines | ALL_CAPS | `#define PLATFORM_DESKTOP`
|
||||||
|
Macros | ALL_CAPS | `#define MIN(a,b) (((a)<(b))?(a):(b))`
|
||||||
|
Variables | lowerCase | `int screenWidth = 0;`, `float targetFrameTime = 0.016f;`
|
||||||
|
Local variables | lowerCase | `Vector2 playerPosition = { 0 };`
|
||||||
|
Global variables | lowerCase | `bool windowReady = false;`
|
||||||
|
Constants | lowerCase | `const int maxValue = 8;`
|
||||||
|
Pointers | MyType *pointer | `Texture2D *array = NULL;`
|
||||||
|
float values | always x.xf | `float gravity = 10.0f`
|
||||||
|
Operators | value1*value2 | `int product = value*6;`
|
||||||
|
Operators | value1/value2 | `int division = value/4;`
|
||||||
|
Operators | value1 + value2 | `int sum = value + 10;`
|
||||||
|
Operators | value1 - value2 | `int res = value - 5;`
|
||||||
|
Enum | TitleCase | `enum TextureFormat`
|
||||||
|
Enum members | ALL_CAPS | `PIXELFORMAT_UNCOMPRESSED_R8G8B8`
|
||||||
|
Struct | TitleCase | `struct Texture2D`, `struct Material`
|
||||||
|
Struct members | lowerCase | `texture.width`, `color.r`
|
||||||
|
Functions | TitleCase | `InitWindow()`, `LoadImageFromMemory()`
|
||||||
|
Functions params | lowerCase | `width`, `height`
|
||||||
|
Ternary Operator | (condition)? result1 : result2 | `printf("Value is 0: %s", (value == 0)? "yes" : "no");`
|
||||||
|
|
||||||
|
Some other conventions to follow:
|
||||||
|
- **ALWAYS** initialize all defined variables.
|
||||||
|
- **Do not use TABS**, use 4 spaces instead.
|
||||||
|
- Avoid trailing spaces, please, avoid them
|
||||||
|
- Control flow statements always are followed **by a space**:
|
||||||
|
```c
|
||||||
|
if (condition) value = 0;
|
||||||
|
|
||||||
|
while (!WindowShouldClose())
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < NUM_VALUES; i++) printf("%i", i);
|
||||||
|
|
||||||
|
// Be careful with the switch formatting!
|
||||||
|
switch (value)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
{
|
||||||
|
|
||||||
|
} break;
|
||||||
|
case 2: break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
- All conditions checks are **always between parenthesis** but not boolean values:
|
||||||
|
```c
|
||||||
|
if ((value > 1) && (value < 50) && valueActive)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
|
- When dealing with braces or curly brackets, open-close them in aligned mode:
|
||||||
|
```c
|
||||||
|
void SomeFunction()
|
||||||
|
{
|
||||||
|
// TODO: Do something here!
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**If proposing new functions, please try to use a clear naming for function-name and functions-parameters, in case of doubt, open an issue for discussion.**
|
||||||
|
|
||||||
|
## Files and Directories Naming Conventions
|
||||||
|
|
||||||
|
- Directories will be named using `snake_case`: `resources/models`, `resources/fonts`
|
||||||
|
|
||||||
|
- Files will be named using `snake_case`: `main_title.png`, `cubicmap.png`, `sound.wav`
|
||||||
|
|
||||||
|
_NOTE: Avoid any space or special character in the files/dir naming!_
|
||||||
|
|
||||||
|
## Games/Examples Directories Organization Conventions
|
||||||
|
|
||||||
|
- Data files should be organized by context and usage in the game, think about the loading requirements for data and put all the resources that need to be loaded at the same time together.
|
||||||
|
- Use descriptive names for the files, it would be perfect if just reading the name of the file, it was possible to know what is that file and where fits in the game.
|
||||||
|
- Here it is an example, note that some resources require to be loaded all at once while other require to be loaded only at initialization (gui, font).
|
||||||
|
|
||||||
|
```
|
||||||
|
resources/audio/fx/long_jump.wav
|
||||||
|
resources/audio/music/main_theme.ogg
|
||||||
|
resources/screens/logo/logo.png
|
||||||
|
resources/screens/title/title.png
|
||||||
|
resources/screens/gameplay/background.png
|
||||||
|
resources/characters/player.png
|
||||||
|
resources/characters/enemy_slime.png
|
||||||
|
resources/common/font_arial.ttf
|
||||||
|
resources/common/gui.png
|
||||||
|
```
|
138
3party/raylib/FAQ.md
Normal file
@ -0,0 +1,138 @@
|
|||||||
|
# Frequently Asked Questions
|
||||||
|
|
||||||
|
- [What is raylib?](#what-is-raylib)
|
||||||
|
- [What can I do with raylib?](#what-can-i-do-with-raylib)
|
||||||
|
- [Which kinds of games can I make with raylib?](#which-kinds-of-games-can-i-make-with-raylib)
|
||||||
|
- [Can I create non-game applications with raylib?](#can-i-create-non-game-applications-with-raylib)
|
||||||
|
- [How can I learn to use raylib? Is there some official documentation or tutorials?](#how-can-i-learn-to-use-raylib-is-there-some-official-documentation-or-tutorials)
|
||||||
|
- [How much does it cost?](#how-much-does-it-cost)
|
||||||
|
- [What is the raylib license?](#what-is-the-raylib-license)
|
||||||
|
- [What platforms are supported by raylib?](#what-platforms-are-supported-by-raylib)
|
||||||
|
- [What programming languages can I use with raylib?](#what-programming-languages-can-i-use-with-raylib)
|
||||||
|
- [Why is it coded in C?](#why-is-it-coded-in-c)
|
||||||
|
- [Is raylib a videogames engine?](#is-raylib-a-videogames-engine)
|
||||||
|
- [What does raylib provide that other engines or libraries don't?](#what-does-raylib-provide-that-other-engines-or-libraries-dont)
|
||||||
|
- [How does raylib compare to Unity/Unreal/Godot?](#how-does-raylib-compare-to-unityunrealgodot)
|
||||||
|
- [What development tools are required for raylib?](#what-development-tools-are-required-for-raylib)
|
||||||
|
- [What are raylib's external dependencies?](#what-are-raylibs-external-dependencies)
|
||||||
|
- [Can I use raylib with other technologies or libraries?](#can-i-use-raylib-with-other-technologies-or-libraries)
|
||||||
|
- [What file formats are supported by raylib?](#what-file-formats-are-supported-by-raylib)
|
||||||
|
- [Does raylib support the Vulkan API?](#does-raylib-support-the-vulkan-api)
|
||||||
|
- [What could I expect to see in raylib in the future?](#what-could-i-expect-to-see-in-raylib-in-the-future)
|
||||||
|
- [Who are the raylib developers?](#who-are-the-raylib-developers)
|
||||||
|
- [MORE QUESTIONS...](https://github.com/raysan5/raylib/wiki/Frequently-Asked-Questions)
|
||||||
|
|
||||||
|
### What is raylib?
|
||||||
|
|
||||||
|
raylib is a C programming library, designed to be simple and easy-to-use. It provides a set of functions intended for graphics/multimedia applications programming.
|
||||||
|
|
||||||
|
### What can I do with raylib?
|
||||||
|
|
||||||
|
raylib can be used to create any kind of graphics/multimedia applications: videogames, tools, mobile apps, web applications... Actually it can be used to create any application that requires something to be shown in a display with graphic hardware acceleration (OpenGL); including [IoT](https://en.wikipedia.org/wiki/Internet_of_things) devices with a graphics display.
|
||||||
|
|
||||||
|
### Which kinds of games can I make with raylib?
|
||||||
|
|
||||||
|
With enough time and effort any kind of game/application can be created but small-mid sized 2d videogames are the best fit. The raylib [examples](https://www.raylib.com/examples.html)/[games](https://www.raylib.com/games.html) and [raylibtech](https://raylibtech.itch.io/) tools are an example of what can be accomplished with raylib.
|
||||||
|
|
||||||
|
### Can I create non-game applications with raylib?
|
||||||
|
|
||||||
|
Yes, raylib can be used to create any kind of application, not just videogames. For example, it can be used to create [desktop/web tools](https://raylibtech.itch.io/) or also applications for an IoT devices like [Raspberry Pi](https://www.raspberrypi.org/).
|
||||||
|
|
||||||
|
### How can I learn to use raylib? Is there some official documentation or tutorials?
|
||||||
|
|
||||||
|
raylib does not provide a "standard" API reference documentation like other libraries, all of the raylib functionality is exposed in a simple [cheatsheet](https://www.raylib.com/cheatsheet/cheatsheet.html). Most of the functions are self-explanatory and the required parameters are very intuitive. It's also highly recommended to take a look to [`raylib.h`](https://github.com/raysan5/raylib/blob/master/src/raylib.h) header file or even the source code, that is very clean and organized, intended for teaching.
|
||||||
|
|
||||||
|
raylib also provides a big [collection of examples](https://www.raylib.com/examples.html), to showcase the multiple functionality usage (+120 examples). Examples are categorized by the internal module functionality and also define an estimated level of difficulty to guide the users checking them.
|
||||||
|
|
||||||
|
There is also a [FAQ on the raylib Wiki](https://github.com/raysan5/raylib/wiki/Frequently-Asked-Questions) with common technical questions.
|
||||||
|
|
||||||
|
There are also many tutorials on the internet and YouTube created by the growing raylib community along the years.
|
||||||
|
|
||||||
|
[raylib Discord Community](https://discord.gg/raylib) is also a great place to join and ask questions, the community is very friendly and always ready to help.
|
||||||
|
|
||||||
|
### How much does it cost?
|
||||||
|
|
||||||
|
raylib is [free and open source](https://github.com/raysan5/raylib). Anyone can use raylib library for free to create games/tools/apps but also the source code of raylib is open for anyone to check it, modify it, adapt it as required or just learn how it works internally.
|
||||||
|
|
||||||
|
### What is the raylib license?
|
||||||
|
|
||||||
|
raylib source code is licensed under an unmodified zlib/libpng license, which is an OSI-certified, BSD-like license that allows static linking with closed source software. Check [LICENSE](https://github.com/raysan5/raylib/blob/master/LICENSE) for further details.
|
||||||
|
|
||||||
|
### What platforms are supported by raylib?
|
||||||
|
|
||||||
|
raylib source code can be compiled for the following platforms:
|
||||||
|
|
||||||
|
- Windows (7, 8.1, 10, 11)
|
||||||
|
- Linux - Desktop (multiple distributions, X11 and Wayland based)
|
||||||
|
- Linux - Native (no windowing system, [DRM](https://en.wikipedia.org/wiki/Direct_Rendering_Manager))
|
||||||
|
- macOS (multiple versions, including ARM64)
|
||||||
|
- FreeBSD, OpenBSD, NetBSD, DragonFly
|
||||||
|
- Raspberry Pi (desktop and native)
|
||||||
|
- Android (multiple API versions and architectures)
|
||||||
|
- HTML5 (WebAssembly)
|
||||||
|
- Haiku
|
||||||
|
|
||||||
|
raylib code has also been ported to several [homebrew](https://en.wikipedia.org/wiki/Homebrew_(video_games)) platforms: N3DS, Switch, PS4, PSVita.
|
||||||
|
|
||||||
|
Also note that raylib is a low-level library that can be easily ported to any platform with OpenGL support (or similar API).
|
||||||
|
|
||||||
|
### What programming languages can I use with raylib?
|
||||||
|
|
||||||
|
raylib original version is coded in C language (using some C99 features) but it has bindings to +60 programming languages. Check [BINDINGS.md](https://github.com/raysan5/raylib/blob/master/BINDINGS.md) for details.
|
||||||
|
|
||||||
|
### Why is it coded in C?
|
||||||
|
|
||||||
|
It's a simple language, no high-level code abstractions like [OOP](https://en.wikipedia.org/wiki/Object-oriented_programming), just data types and functions. It's a very enjoyable language to code.
|
||||||
|
|
||||||
|
### Is raylib a videogames engine?
|
||||||
|
|
||||||
|
I personally consider raylib a graphics library with some high-level features rather than an engine. The line that separates a library/framework from an engine could be very confusing; raylib provides all the required functionality to create simple games or small applications but it does not provide 3 elements that I personally consider any "engine" should provide: Screen manager, GameObject/Entity manager and Resource Manager. Still, most users do not need those elements or just code simple approaches on their own.
|
||||||
|
|
||||||
|
### What does raylib provide that other engines or libraries don't?
|
||||||
|
|
||||||
|
I would say "simplicity" and "enjoyment" at a really low-level of coding but actually is up to the user to discover it, to try it and to see if it fits their needs. raylib is not good for everyone but it's worth a try.
|
||||||
|
|
||||||
|
### How does raylib compare to Unity/Unreal/Godot?
|
||||||
|
|
||||||
|
Those engines are usually big and complex to use, providing lot of functionality. They require some time to learn and test, they usually abstract many parts of the game development process and they usually provide a set of tools to assist users on their creations (like a GUI editor).
|
||||||
|
|
||||||
|
raylib is a simple programming library, with no integrated tools or editors. It gives full control to users at a very low-level to create graphics applications in a more handmade way.
|
||||||
|
|
||||||
|
### What development tools are required for raylib?
|
||||||
|
|
||||||
|
To develop raylib programs you only need a text editor (with recommended code syntax highlighting) and a compiler.
|
||||||
|
|
||||||
|
A [raylib Windows Installer](https://raysan5.itch.io/raylib) package is distributed including the Notepad++ editor and MinGW (GCC) compiler pre-configured for Windows for new users as an starter-pack but for more advance configurations with other editors/compilers, [raylib Wiki](https://github.com/raysan5/raylib/wiki) provides plenty of configuration tutorials.
|
||||||
|
|
||||||
|
### What are raylib's external dependencies?
|
||||||
|
|
||||||
|
raylib is self-contained, it has no external dependencies to build it. But internally raylib uses several libraries from other developers, mostly used to load specific file-formats.
|
||||||
|
|
||||||
|
A detailed list of raylib dependencies could be found on the [raylib Wiki](https://github.com/raysan5/raylib/wiki/raylib-dependencies).
|
||||||
|
|
||||||
|
### Can I use raylib with other technologies or libraries?
|
||||||
|
|
||||||
|
Yes, raylib can be used with other libraries that provide specific functionality. There are multiple examples of raylib integrations with libraries like Spine, Tiled, Dear Imgui and several physics engines.
|
||||||
|
|
||||||
|
### What file formats are supported by raylib?
|
||||||
|
|
||||||
|
raylib can load data from multiple standard file formats:
|
||||||
|
|
||||||
|
- Image/Textures: PNG, BMP, TGA, JPG, GIF, QOI, PSD, DDS, HDR, KTX, ASTC, PKM, PVR
|
||||||
|
- Fonts: FNT (sprite font), TTF, OTF
|
||||||
|
- Models/Meshes: OBJ, IQM, GLTF, VOX, M3D
|
||||||
|
- Audio: WAV, OGG, MP3, FLAC, XM, MOD, QOA
|
||||||
|
|
||||||
|
### Does raylib support the Vulkan API?
|
||||||
|
|
||||||
|
No, raylib is built on top of OpenGL API, and there are currently no plans to support any other graphics APIs. In any case, raylib uses rlgl as an abstraction layer to support different OpenGL versions. If really required, a Vulkan backend equivalent could be added but creating that abstraction layer would imply a considerable amount of work.
|
||||||
|
|
||||||
|
### What could I expect to see in raylib in the future?
|
||||||
|
|
||||||
|
The main focus of the library is simplicity. Most of the efforts are invested in maintainability and bug-fixing. Despite new small features are regularly added, it's not the objective for raylib to become a full-featured engine. Personally I prefer to keep it small and enjoyable.
|
||||||
|
|
||||||
|
### Who are the raylib developers?
|
||||||
|
|
||||||
|
The main raylib developer and maintainer is [Ramon Santamaria](https://www.linkedin.com/in/raysan/) but there's 360+ contributors that have helped by adding new features, testing the library and solving issues in the 9+ years life of raylib.
|
||||||
|
|
||||||
|
The full list of raylib contributors can be seen [on GitHub](https://github.com/raysan5/raylib/graphs/contributors).
|
434
3party/raylib/HISTORY.md
Normal file
@ -0,0 +1,434 @@
|
|||||||
|
![raylib logo](logo/raylib_256x256.png)
|
||||||
|
|
||||||
|
introduction
|
||||||
|
------------
|
||||||
|
|
||||||
|
I started developing videogames in 2006 and some years later I started teaching videogames development to young people with artistic profile, most of students had never written a single line of code.
|
||||||
|
|
||||||
|
I decided to start with C language basis and, after searching for the most simple and easy-to-use library to teach videogames programming, I found [WinBGI](https://winbgim.codecutter.org/); it was great and it worked very well with students, in just a couple of weeks, those students that had never written a single line of code were able to program (and understand) a simple PONG game, some of them even a BREAKOUT!
|
||||||
|
|
||||||
|
But WinBGI was not the clearer and most organized library for my taste. There were lots of things I found confusing and some function names were not clear enough for most of the students; not to mention the lack of transparencies support and no hardware acceleration.
|
||||||
|
|
||||||
|
So, I decided to create my own library, hardware accelerated, clear function names, quite organized, well structured, plain C coding and, the most important, primarily intended to learn videogames programming.
|
||||||
|
|
||||||
|
My previous videogames development experience was mostly in C# and [XNA](https://en.wikipedia.org/wiki/Microsoft_XNA) and I really loved it, so, I decided to use C# language style notation and XNA naming conventions. That way, students were able to move from raylib to XNA, MonoGame or similar libs extremely easily.
|
||||||
|
|
||||||
|
raylib started as a weekend project and after three months of hard work, **raylib 1.0 was published on November 2013**.
|
||||||
|
|
||||||
|
Enjoy it.
|
||||||
|
|
||||||
|
notes on raylib 1.1
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
On April 2014, after 6 month of first raylib release, raylib 1.1 has been released. This new version presents a complete internal redesign of the library to support OpenGL 1.1, OpenGL 3.3+ and OpenGL ES 2.0.
|
||||||
|
|
||||||
|
- A new module named [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) has been added to the library. This new module translates raylib-OpenGL-style immediate mode functions (i.e. rlVertex3f(), rlBegin(), ...) to different versions of OpenGL (1.1, 3.3+, ES2), selectable by one define.
|
||||||
|
|
||||||
|
- [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) also comes with a second new module named [raymath](https://github.com/raysan5/raylib/blob/master/src/raymath.h), which includes a bunch of useful functions for 3d-math with vectors, matrices and quaternions.
|
||||||
|
|
||||||
|
Some other big changes of this new version have been the support for OGG files loading and stream playing, and the support of DDS texture files (compressed and uncompressed) along with mipmaps support.
|
||||||
|
|
||||||
|
Lots of code changes and lot of testing have concluded in this amazing new raylib 1.1.
|
||||||
|
|
||||||
|
notes on raylib 1.2
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
On September 2014, after 5 month of raylib 1.1 release, it comes raylib 1.2. Again, this version presents a complete internal redesign of [core](https://github.com/raysan5/raylib/blob/master/src/rcore.c) module to support two new platforms: [Android](http://www.android.com/) and [Raspberry Pi](http://www.raspberrypi.org/).
|
||||||
|
|
||||||
|
It's been some month of really hard work to accomodate raylib to those new platforms while keeping it easy for the users. On Android, raylib manages internally the activity cicle, as well as the inputs; on Raspberry Pi, a complete raw input system has been written from scratch.
|
||||||
|
|
||||||
|
- A new display initialization system has been created to support multiple resolutions, adding black bars if required; user only defines desired screen size and it gets properly displayed.
|
||||||
|
|
||||||
|
- Now raylib can easily deploy games to Android devices and Raspberry Pi (console mode).
|
||||||
|
|
||||||
|
Lots of code changes and lot of testing have concluded in this amazing new raylib 1.2.
|
||||||
|
|
||||||
|
In December 2014, new raylib 1.2.2 was published with support to compile directly for web (html5) using [emscripten](http://kripken.github.io/emscripten-site/) and [asm.js](http://asmjs.org/).
|
||||||
|
|
||||||
|
notes on raylib 1.3
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
On September 2015, after 1 year of raylib 1.2 release, arrives raylib 1.3. This version adds shaders functionality, improves tremendously textures module and also provides some new modules (camera system, gestures system, immediate-mode gui).
|
||||||
|
|
||||||
|
- Shaders support is the biggest addition to raylib 1.3, with support for easy shaders loading and use. Loaded shaders can be attached to 3d models or used as fullscreen postrocessing effects. A bunch of postprocessing shaders are also included in this release, check raylib/shaders folder.
|
||||||
|
|
||||||
|
- Textures module has grown to support most of the internal texture formats available in OpenGL (RGB565, RGB888, RGBA5551, RGBA4444, etc.), including compressed texture formats (DXT, ETC1, ETC2, ASTC, PVRT); raylib 1.3 can load .dds, .pkm, .ktx, .astc and .pvr files.
|
||||||
|
|
||||||
|
- A brand new [camera](https://github.com/raysan5/raylib/blob/master/src/rcamera.c) module offers to the user multiple preconfigured ready-to-use camera systems (free camera, 1st person, 3rd person). Camera modes are very easy to use, just check examples: [core_3d_camera_free.c](https://github.com/raysan5/raylib/blob/master/examples/core_3d_camera_free.c) and [core_3d_camera_first_person.c](https://github.com/raysan5/raylib/blob/master/examples/core_3d_camera_first_person.c).
|
||||||
|
|
||||||
|
- New [gestures](https://github.com/raysan5/raylib/blob/master/src/rgestures.h) module simplifies gestures detection on Android and HTML5 programs.
|
||||||
|
|
||||||
|
- [raygui](https://github.com/raysan5/raylib/blob/master/src/raygui.h), the new immediate-mode GUI module offers a set of functions to create simple user interfaces, primary intended for tools development. It's still in experimental state but already fully functional.
|
||||||
|
|
||||||
|
Most of the examples have been completely rewritten and +10 new examples have been added to show the new raylib features.
|
||||||
|
|
||||||
|
Lots of code changes and lot of testing have concluded in this amazing new raylib 1.3.
|
||||||
|
|
||||||
|
notes on raylib 1.4
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
On February 2016, after 4 months of raylib 1.3 release, it comes raylib 1.4. For this new version, lots of parts of the library have been reviewed, lots of bugs have been solved and some interesting features have been added.
|
||||||
|
|
||||||
|
- First big addition is a set of [Image manipulation functions](https://github.com/raysan5/raylib/blob/master/src/raylib.h#L673) have been added to crop, resize, colorize, flip, dither and even draw image-to-image or text-to-image. Now a basic image processing can be done before converting the image to texture for usage.
|
||||||
|
|
||||||
|
- SpriteFonts system has been improved, adding support for AngelCode fonts (.fnt) and TrueType Fonts (using [stb_truetype](https://github.com/nothings/stb/blob/master/stb_truetype.h) helper library). Now raylib can read standard .fnt font data and also generate at loading a SpriteFont from a TTF file.
|
||||||
|
|
||||||
|
- New [physac](https://github.com/raysan5/raylib/blob/master/src/physac.h) physics module for basic 2D physics support. Still in development but already functional. Module comes with some usage examples for basic jump and level interaction and also force-based physic movements.
|
||||||
|
|
||||||
|
- [raymath](https://github.com/raysan5/raylib/blob/master/src/raymath.h) module has been reviewed; some bugs have been solved and the module has been converted to a header-only file for easier portability, optionally, functions can also be used as inline.
|
||||||
|
|
||||||
|
- [gestures](https://github.com/raysan5/raylib/blob/master/src/rgestures.c) module has redesigned and simplified, now it can process touch events from any source, including mouse. This way, gestures system can be used on any platform providing an unified way to work with inputs and allowing the user to create multiplatform games with only one source code.
|
||||||
|
|
||||||
|
- Raspberry Pi input system has been redesigned to better read raw inputs using generic Linux event handlers (keyboard:`stdin`, mouse:`/dev/input/mouse0`, gamepad:`/dev/input/js0`). Gamepad support has also been added (experimental).
|
||||||
|
|
||||||
|
Other important improvements are the functional raycast system for 3D picking, including some ray collision-detection functions,
|
||||||
|
and the addition of two simple functions for persistent data storage. Now raylib user can save and load game data in a file (only some platforms supported). A simple [easings](https://github.com/raysan5/raylib/blob/master/src/easings.h) module has also been added for values animation.
|
||||||
|
|
||||||
|
Up to 8 new code examples have been added to show the new raylib features and +10 complete game samples have been provided to learn
|
||||||
|
how to create some classic games like Arkanoid, Asteroids, Missile Commander, Snake or Tetris.
|
||||||
|
|
||||||
|
Lots of code changes and lots of hours of hard work have concluded in this amazing new raylib 1.4.
|
||||||
|
|
||||||
|
notes on raylib 1.5
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
On July 2016, after 5 months of raylib 1.4 release, arrives raylib 1.5. This new version is the biggest boost of the library until now, lots of parts of the library have been redesigned, lots of bugs have been solved and some **AMAZING** new features have been added.
|
||||||
|
|
||||||
|
- VR support: raylib supports **Oculus Rift CV1**, one of the most anticipated VR devices in the market. Additionally, raylib supports simulated VR stereo rendering, independent of the VR device; it means, raylib can generate stereo renders with custom head-mounted-display device parameteres, that way, any VR device in the market can be **simulated in any platform** just configuring device parameters (and consequently, lens distortion). To enable VR is [extremely easy](https://github.com/raysan5/raylib/blob/master/examples/core_oculus_rift.c).
|
||||||
|
|
||||||
|
- New materials system: now raylib supports standard material properties for 3D models, including diffuse-ambient-specular colors and diffuse-normal-specular textures. Just assign values to standard material and everything is processed internally.
|
||||||
|
|
||||||
|
- New lighting system: added support for up to 8 configurable lights and 3 light types: **point**, **directional** and **spot** lights. Just create a light, configure its parameters and raylib manages render internally for every 3d object using standard material.
|
||||||
|
|
||||||
|
- Complete gamepad support on Raspberry Pi: Gamepad system has been completely redesigned. Now multiple gamepads can be easily configured and used; gamepad data is read and processed in raw mode in a second thread.
|
||||||
|
|
||||||
|
- Redesigned physics module: [physac](https://github.com/raysan5/raylib/blob/master/src/physac.h) module has been converted to header only and usage [has been simplified](https://github.com/raysan5/raylib/blob/master/examples/physics_basic_rigidbody.c). Performance has also been singnificantly improved, now physic objects are managed internally in a second thread.
|
||||||
|
|
||||||
|
- Audio chiptunese support and mixing channels: Added support for module audio music (.xm, .mod) loading and playing. Multiple mixing channels are now also supported. All this features thanks to the amazing work of @kd7tck.
|
||||||
|
|
||||||
|
Other additions include a [2D camera system](https://github.com/raysan5/raylib/blob/master/examples/core_2d_rcamera.c), render textures for offline render (and most comprehensive [postprocessing](https://github.com/raysan5/raylib/blob/master/examples/shaders_postprocessing.c)) or support for legacy OpenGL 2.1 on desktop platforms.
|
||||||
|
|
||||||
|
This new version is so massive that is difficult to list all the improvements, most of raylib modules have been reviewed and [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.c) module has been completely redesigned to accomodate to new material-lighting systems and stereo rendering. You can check [CHANGELOG](https://github.com/raysan5/raylib/blob/master/CHANGELOG) file for a more detailed list of changes.
|
||||||
|
|
||||||
|
Up to 8 new code examples have been added to show the new raylib features and also some samples to show the usage of [rlgl](https://github.com/raysan5/raylib/blob/master/examples/rlgl_standalone.c) and [audio](https://github.com/raysan5/raylib/blob/master/examples/audio_standalone.c) raylib modules as standalone libraries.
|
||||||
|
|
||||||
|
Lots of code changes (+400 commits) and lots of hours of hard work have concluded in this amazing new raylib 1.5.
|
||||||
|
|
||||||
|
notes on raylib 1.6
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
On November 2016, only 4 months after raylib 1.5, arrives raylib 1.6. This new version represents another big review of the library and includes some interesting additions. This version conmmemorates raylib 3rd anniversary (raylib 1.0 was published on November 2013) and it is a stepping stone for raylib future. raylib roadmap has been reviewed and redefined to focus on its primary objective: create a simple and easy-to-use library to learn videogames programming. Some of the new features:
|
||||||
|
|
||||||
|
- Complete [raylib Lua binding](https://github.com/raysan5/raylib-lua). All raylib functions plus the +60 code examples have been ported to Lua, now Lua users can enjoy coding videogames in Lua while using all the internal power of raylib. This addition also open the doors to Lua scripting support for a future raylib-based engine, being able to move game logic (Init, Update, Draw, De-Init) to Lua scripts while keep using raylib functionality.
|
||||||
|
|
||||||
|
- Completely redesigned [audio module](https://github.com/raysan5/raylib/blob/master/src/raudio.c). Based on the new direction taken in raylib 1.5, it has been further improved and more functionality added (+20 new functions) to allow raw audio processing and streaming. [FLAC file format support](https://github.com/raysan5/raylib/blob/master/src/external/dr_flac.h) has also been added. In the same line, [OpenAL Soft](https://github.com/kcat/openal-soft) backend is now provided as a static library in Windows to allow static linking and get ride of OpenAL32.dll. Now raylib Windows games are completey self-contained, no external libraries required any more!
|
||||||
|
|
||||||
|
- [Physac](https://github.com/victorfisac/Physac) module has been moved to its own repository and it has been improved A LOT, actually, library has been completely rewritten from scratch by [@victorfisac](https://github.com/victorfisac), multiple samples have been added together with countless new features to match current standard 2D physic libraries. Results are amazing!
|
||||||
|
|
||||||
|
- Camera and gestures modules have been reviewed, highly simplified and ported to single-file header-only libraries for easier portability and usage flexibility. Consequently, camera system usage has been simplified in all examples.
|
||||||
|
|
||||||
|
- Improved Gamepad support on Windows and Raspberry Pi with the addition of new functions for custom gamepad configurations but supporting by default PS3 and Xbox-based gamepads.
|
||||||
|
|
||||||
|
- Improved textures and text functionality, adding new functions for texture filtering control and better TTF/AngelCode fonts loading and generation support.
|
||||||
|
|
||||||
|
Build system improvement. Added support for raylib dynamic library generation (raylib.dll) for users that prefer dynamic library linking. Also thinking on advance users, it has been added pre-configured [Visual Studio C++ 2015 solution](https://github.com/raysan5/raylib/tree/master/project/vs2015) with raylib project and C/C++ examples for users that prefer that professional IDE and compiler.
|
||||||
|
|
||||||
|
New examples, new functions, complete code-base review, multiple bugs corrected... this is raylib 1.6. Enjoy making games.
|
||||||
|
|
||||||
|
notes on raylib 1.7
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
On May 2017, around 6 month after raylib 1.6, comes another raylib instalment, raylib 1.7. This time library has been improved a lot in terms of consistency and cleanness. As stated in [this patreon article](https://www.patreon.com/posts/raylib-future-7501034), this new raylib version has focused efforts in becoming more simple and easy-to-use to learn videogames programming. Some highlights of this new version are:
|
||||||
|
|
||||||
|
- More than 30 new functions added to the library, functions to control Window, utils to work with filenames and extensions, functions to draw lines with custom thick, mesh loading, functions for 3d ray collisions detailed detection, funtions for VR simulation and much more... Just check [CHANGELOG](CHANGELOG) for a detailed list of additions!
|
||||||
|
|
||||||
|
- Support of [configuration flags](https://github.com/raysan5/raylib/issues/200) on every raylib module. Advance users can customize raylib just choosing desired features, defining some configuration flags on modules compilation. That way users can control library size and available functionality.
|
||||||
|
|
||||||
|
- Improved [build system](https://github.com/raysan5/raylib/blob/master/src/Makefile) for all supported platforms (Windows, Linux, OSX, RPI, Android, HTML5) with a unique Makefile to compile sources. Added support for Android compilation with a custom standalone toolchain and also multiple build compliation flags.
|
||||||
|
|
||||||
|
- New [examples](http://www.raylib.com/examples.html) and [sample games](http://www.raylib.com/games.html) added. All samples material has been reviewed, removing useless examples and adding more comprehensive ones; all material has been ported to latest raylib version and tested in multiple platforms. Examples folder structure has been improved and also build systems.
|
||||||
|
|
||||||
|
- Improved library consistency and organization in general. Functions and parameters have been renamed, some parts of the library have been cleaned and simplyfied, some functions has been moved to examples (lighting, Oculus Rift CV1 support) towards a more generic library implementation. Lots of hours have been invested in this process...
|
||||||
|
|
||||||
|
Some other features: Gamepad support on HTML5, RPI touch screen support, 32bit audio support, frames timing improvements, public log system, rres file format support, automatic GIF recording...
|
||||||
|
|
||||||
|
And here it is another version of **raylib, a simple and easy-to-use library to enjoy videogames programming**. Enjoy it.
|
||||||
|
|
||||||
|
notes on raylib 1.8
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
October 2017, around 5 months after latest raylib version, another release is published: raylib 1.8. Again, several modules of the library have been reviewed and some new functionality added. Main changes of this new release are:
|
||||||
|
|
||||||
|
- [Procedural image generation](https://github.com/raysan5/raylib/blob/master/examples/textures/textures_image_generation.c) function, a set of new functions have been added to generate gradients, checked, noise and cellular images from scratch. Image generation could be useful for certain textures or learning pourpouses.
|
||||||
|
|
||||||
|
- [Parametric mesh generation](https://github.com/raysan5/raylib/blob/master/examples/models/models_mesh_generation.c) functions, create 3d meshes from scratch just defining a set of parameters, meshes like cube, sphere, cylinder, torus, knot and more can be very useful for prototyping or for lighting and texture testing.
|
||||||
|
|
||||||
|
- PBR Materials support, a completely redesigned shaders and material system allows advance materials definition and usage, with fully customizable shaders. Some new functions have been added to generate the environment textures required for PBR shading and a a new complete [PBR material example](https://github.com/raysan5/raylib/blob/master/examples/models/models_material_pbr.c) is also provided for reference.
|
||||||
|
|
||||||
|
- Custom Android APK build pipeline with [simple Makefile](https://github.com/raysan5/raylib/blob/master/templates/simple_game/Makefile). Actually, full code building mechanism based on plain Makefile has been completely reviewed and Android building has been added for sources and also for examples and templates building into final APK package. This way, raylib Android building has been greatly simplified and integrated seamlessly into standard build scripts.
|
||||||
|
|
||||||
|
- [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) module has been completely reviewed and most of the functions renamed for consistency. This way, standalone usage of rlgl is promoted, with a [complete example provided](https://github.com/raysan5/raylib/blob/master/examples/others/rlgl_standalone.c). rlgl offers a pseudo-OpenGL 1.1 immediate-mode programming-style layer, with backends to multiple OpenGL versions.
|
||||||
|
|
||||||
|
- [raymath](https://github.com/raysan5/raylib/blob/master/src/raymath.h) library has been also reviewed to align with other advance math libraries like [GLM](https://github.com/g-truc/glm). Matrix math has been improved and simplified, some new Quaternion functions have been added and Vector3 functions have been renamed all around the library for consistency with new Vector2 functionality.
|
||||||
|
|
||||||
|
Additionally, as always, examples and templates have been reviewed to work with new version (some new examples have been added), all external libraries have been updated to latest stable version and latest Notepad++ and MinGW have been configured to work with new raylib. For a full list of changes, just check [CHANGELOG](CHANGELOG).
|
||||||
|
|
||||||
|
New installer provided, web updated, examples re-builded, documentation reviewed... **new raylib 1.8 published**. Enjoy coding games.
|
||||||
|
|
||||||
|
notes on raylib 2.0
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
It's been 9 month since last raylib version was published, a lots of things have changed since then... This new raylib version represents an inflexion point in the development of the library and so, we jump to a new major version... Here it is the result of almost **5 years and thousands of hours of hard work**... here it is... **raylib 2.0**
|
||||||
|
|
||||||
|
In **raylib 2.0** the full API has been carefully reviewed for better consistency, some new functionality has been added and the overall raylib experience has been greatly improved... The key features of new version are:
|
||||||
|
|
||||||
|
- **Complete removal of external dependencies.** Finally, raylib does not require external libraries to be installed and linked along with raylib, all required libraries are contained and compiled within raylib. Obviously some external libraries are required but only the strictly platform-dependant ones, the ones that come installed with the OS. So, raylib becomes a self-contained platform-independent games development library.
|
||||||
|
|
||||||
|
- **Full redesign of audio module to use the amazing miniaudio library**, along with external dependencies removal, OpenAL library has been replaced by [miniaudio](https://github.com/dr-soft/miniaudio), this brand new library offers automatic dynamic linking with default OS audio systems. Undoubtly, the perfect low-level companion for raylib audio module!
|
||||||
|
|
||||||
|
- **Support for continuous integration building*** through AppVeyor and Travis CI. Consequently, raylib GitHub develop branch has been removed, simplyfing the code-base to a single master branch, always stable. Every time a new commit is deployed, library is compiled for **up-to 12 different configurations**, including multiple platforms, 32bit/64bit and multiple compiler options! All those binaries are automatically attached to any new release!
|
||||||
|
|
||||||
|
- **More platforms supported and tested**, including BSD family (FreeBSD, openBSD, NetBSD, DragonFly) and Linux-based family platforms (openSUSE, Debian, Ubuntu, Arch, NixOS...). raylib has already been added to some package managers! Oh, and last but not less important, **Android 64bit** is already supported by raylib!
|
||||||
|
|
||||||
|
- **Support for TCC compiler!** Thanks to the lack of external dependencies, raylib can now be easily compiled with a **minimal toolchain**, like the one provide by Tiny C Compiler. It opens the door to an amazing future, allowing, for example, static linkage of libtcc for **runtime compilation of raylib-based code**... and the library itself if required! Moreover, TCC is blazing fast, it can compile all raylib in a couple of seconds!
|
||||||
|
|
||||||
|
- Refactored all raylib configuration #defines into a **centralized `config.h` header**, with more than **40 possible configuration options** to compile a totally customizable raylib version including only desired options like supported file-formats or specific functionality support. It allows generating a trully ligth-weight version of the library if desired!
|
||||||
|
|
||||||
|
A part of that, lots of new features, like a brand **new font rendering and packaging system** for TTF fonts with **SDF support** (thanks to the amazing STB headers), new functions for **CPU image data manipulation**, new orthographic 3d camera mode, a complete review of `raymath.h` single-file header-only library for better consistency and performance, new examples and way, [way more](https://github.com/raysan5/raylib/blob/master/CHANGELOG).
|
||||||
|
|
||||||
|
Probably by now, **raylib 2.0 is the simplest and easiest-to-use library to enjoy (and learn) videogames programming**... but, undoubtly its development has exceeded any initial objective; raylib has become a simple and easy-to-use trully multiplatform portable standalone media library with thousands of possibilities... and that's just the beginning!
|
||||||
|
|
||||||
|
notes on raylib 2.5
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
After almost one years since latest raylib installment, here it is **raylib 2.5**. A lot of work has been put on this new version and consequently I decided to bump versioning several digits. The complete list of changes and additions is humungous, details can be found in the [CHANGELOG](CHANGELOG), and here it is a short recap with the highlight improvements.
|
||||||
|
|
||||||
|
- New **window management and file system functions** to query monitor information, deal with clipboard, check directory files info and even launch a URL with default system web browser. Experimental **High-DPI monitor support** has also been added through a compile flag.
|
||||||
|
|
||||||
|
- **Redesigned Gamepad mechanism**, now generic for all platforms and gamepads, no more specific gamepad configurations.
|
||||||
|
**Redesigned UWP input system**, now raylib supports UWP seamlessly, previous implementation required a custom input system implemented in user code.
|
||||||
|
|
||||||
|
- `rlgl` module has been redesigned to **support a unique buffer for shapes drawing batching**, including LINES, TRIANGLES, QUADS in the same indexed buffer, also added support for multi-buffering if required. Additionally, `rlPushMatrix()`/`rlPopMatrix()` functionality has been reviewed to behave exactly like OpenGL 1.1, `models_rlgl_solar_system` example has been added to illustrate this behaviour.
|
||||||
|
|
||||||
|
- **VR simulator** has been reviewed to **allow custom configuration of Head-Mounted-Device parameters and distortion shader**, `core_vr_simulator` has been properly adapted to showcase this new functionality, now the VR simulator is a generic configurable stereo rendering system that allows any VR device simulation with just a few lines of code or even dynamic tweaking of HMD parameters.
|
||||||
|
|
||||||
|
- Support for **Unicode text drawing**; now raylib processes UTF8 strings on drawing, supporting Unicode codepoints, allowing rendering mostly any existent language (as long as the font with the glyphs is provided). An amazing example showing this feature has also been added: `text_unicode`.
|
||||||
|
|
||||||
|
- Brand **new text management API**, with the addition of multiple functions to deal with string data, including functionality like replace, insert, join, split, append, to uppercase, to lower... Note that most of those functions are intended for text management on rendering, using pre-loaded internal buffers, avoiding new memory allocation that user should free manually.
|
||||||
|
|
||||||
|
- Multiple **new shapes and textures drawing functions** to support rings (`DrawRing()`, `DrawRingLines()`), circle sectors (`DrawCircleSector()`, `DrawCircleSectorLines()`), rounded rectangles (`DrawRectangleRounded()`, `DrawRectangleRoundedLines()`) and also n-patch textures (`DrawTextureNPatch()`), detailed examples have been added to illustrate all this new functionality.
|
||||||
|
|
||||||
|
- Experimental **cubemap support**, to automatically load multiple cubemap layouts (`LoadTextureCubemap()`). It required some internal `rlgl` redesign to allow cubemap textures.
|
||||||
|
|
||||||
|
- **Skeletal animation support for 3d models**, this addition implied a redesign of `Model` data structure to accomodate multiple mesh/multiple materials support and bones information. Multiple models functions have been reviewed and added on this process, also **glTF models loading support** has been added.
|
||||||
|
|
||||||
|
This is a just a brief list with some of the changes of the new **raylib 2.5** but there is way more, about **70 new functions** have been added and several subsystems have been redesigned. More than **30 new examples** have been created to show the new functionalities and better illustrate already available ones.
|
||||||
|
|
||||||
|
It has been a long year of hard work to make raylib a solid technology to develop new products over it.
|
||||||
|
|
||||||
|
notes on raylib 3.0
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
After **10 months of intense development**, new raylib version is ready. Despite primary intended as a minor release, the [CHANGELIST](CHANGELOG) has grown so big and the library has changed so much internally that it finally became a major release. Library **internal ABI** has reveived a big redesign and review, targeting portability, integration with other platforms and making it a perfect option for other progamming [language bindings](BINDINGS.md).
|
||||||
|
|
||||||
|
- All **global variables** from the multiple raylib modules have been moved to a **global context state**, it has several benefits, first, better code readability with more comprehensive variables naming and categorization (organized by types, i.e. `CORE.Window.display.width`, `CORE.Input.Keyboard.currentKeyState` or `RLGL.State.modelview`). Second, it allows better memory management to load global context state dynamically when required (not at the moment), making it easy to implement a **hot-reloading mechanism** if desired.
|
||||||
|
|
||||||
|
- All **memory allocations** on raylib and its dependencies now use `RL_MALLOC`, `RL_FREE` and similar macros. Now users can easely hook their own memory allocations mechanism if desired, having more control over memory allocated internally by the library. Additionally, it makes it easier to port the library to embedded devices where memory control is critical. For more info check raylib issue #1074.
|
||||||
|
|
||||||
|
- All **I/O file accesses** from raylib are being moved to **memory data access**, now all I/O file access is centralized into just four functions: `LoadFileData()`, `SaveFileData()`, `LoadFileText()`, `SaveFileText()`. Users can just update those functions to any I/O file system. This change makes it easier to integrate raylib with **Virtual File Systems** or custom I/O file implementations.
|
||||||
|
|
||||||
|
- All **raylib data structures** have been reviewed and optimized for pass-by-value usage. One of raylib distinctive design decisions is that most of its functions receive and return data by value. This design makes raylib really simple for newcomers, avoiding pointers and allowing complete access to all structures data in a simple way. The downside is that data is copied on stack every function call and that copy could be costly so, all raylib data structures have been optimized to **stay under 64 bytes** for fast copy and retrieve.
|
||||||
|
|
||||||
|
- All **raylib tracelog messages** have been reviewd and categorized for a more comprehensive output information when developing raylib applications, now all display, input, timer, platform, auxiliar libraries, file-accesses, data loading/unloading issues are properly reported with more detailed and visual messages.
|
||||||
|
|
||||||
|
- `raudio` module has been internally reviewed to accomodate the new `Music` structure (converted from previous pointer format) and the module has been adapted to the **highly improved** [`miniaudio v0.10`](https://github.com/dr-soft/miniaudio).
|
||||||
|
|
||||||
|
- `text` module reviewed to **improve fonts generation** and text management functions, `Font` structure has been redesigned to better accomodate characters data, decoupling individual characters as `Image` glyphs from the font atlas parameters. Several improvements have been made to better support Unicode strings with UTF-8 encoding.
|
||||||
|
|
||||||
|
- **Multiple new examples added** (most of them contributed by raylib users) and all examples reviewed for correct execution on most of the supported platforms, specially Web and Raspberry Pi. A detailed categorized table has been created on github for easy examples navigation and code access.
|
||||||
|
|
||||||
|
- New **GitHub Actions CI** system has been implemented for Windows, Linux and macOS code and examples compilation on every new commit or PR to make sure library keeps stable and usable with no breaking bugs.
|
||||||
|
|
||||||
|
Note that only key changes are listed here but there is way more! About **30 new functions**, multiple functions reviewed, bindings to [+40 programming languages](https://github.com/raysan5/raylib/blob/master/BINDINGS.md) and great samples/demos/tutorials [created by the community](https://discord.gg/raylib), including raylib integration with [Spine](https://github.com/WEREMSOFT/spine-raylib-runtimes), [Unity](https://unitycoder.com/blog/2019/12/09/using-raylib-dll-in-unity/), [Tiled](https://github.com/OnACoffeeBreak/raylib_tiled_import_with_tmx), [Nuklear](http://bedroomcoders.co.uk/implementing-a-3d-gui-with-raylib/), [enet](https://github.com/nxrighthere/NetDynamics) and [more](https://github.com/raysan5/raylib/issues/1079)!
|
||||||
|
|
||||||
|
It has been **10 months of improvements** to create the best raylib ever.
|
||||||
|
|
||||||
|
Welcome to **raylib 3.0**.
|
||||||
|
|
||||||
|
notes on raylib 3.5 - 7th Anniversary Edition
|
||||||
|
---------------------------------------------
|
||||||
|
|
||||||
|
It's December 25th... this crazy 2020 is about to finish and finally the holidays gave me some time to put a new version of raylib. It's been **9 months since last release** and last November raylib become 7 years old... I was not able to release this new version back then but here it is. Many changes and improvements have happened in those months and, even, last August, raylib was awarded with an [Epic Megagrant](https://www.unrealengine.com/en-US/blog/epic-megagrants-fall-2020-update)! Bindings list kept growing to [+50 programming languages](BINDINGS.md) and some new platforms have been supported. Let's see this new version details:
|
||||||
|
|
||||||
|
First, some general numbers of this new update:
|
||||||
|
|
||||||
|
- **+650** commits since previous RELEASE
|
||||||
|
- **+30** functions ADDED (for a TOTAL of **475**!)
|
||||||
|
- **+90** functions REVIEWED/REDESIGNED
|
||||||
|
- **+30** contributors (for a TOTAL of **170**!)
|
||||||
|
- **+8** new examples (for a TOTAL of **+120**!)
|
||||||
|
|
||||||
|
Here the list with some highlights for `raylib 3.5`.
|
||||||
|
|
||||||
|
- NEW **Platform** supported: **Raspberry Pi 4 native mode** (no X11 windows) through [DRM](https://en.wikipedia.org/wiki/Direct_Rendering_Manager) subsystem and GBM API. Actually this is a really interesting improvement because it opens the door to raylib to support other embedded platforms (Odroid, GameShell, NanoPi...). Also worth mentioning the un-official homebrew ports of raylib for [PS4](https://github.com/orbisdev/orbisdev-orbisGl2) and [PSVita](https://github.com/psp2dev/raylib4Vita).
|
||||||
|
|
||||||
|
- NEW **configuration options** exposed: For custom raylib builds, `config.h` now exposes **more than 150 flags and defines** to build raylib with only the desired features, for example, it allows to build a minimal raylib library in just some KB removing all external data filetypes supported, very useful to generate **small executables or embedded devices**.
|
||||||
|
|
||||||
|
- NEW **automatic GIF recording** feature: Actually, automatic GIF recording (**CTRL+F12**) for any raylib application has been available for some versions but this feature was really slow and low-performant using an old gif library with many file-accesses. It has been replaced by a **high-performant alternative** (`msf_gif.h`) that operates directly on memory... and actually works very well! Try it out!
|
||||||
|
|
||||||
|
- NEW **RenderBatch** system: `rlgl` module has been redesigned to support custom **render batches** to allow grouping draw calls as desired, previous implementation just had one default render batch. This feature has not been exposed to raylib API yet but it can be used by advance users dealing with `rlgl` directly. For example, multiple `RenderBatch` can be created for 2D sprites and 3D geometry independently.
|
||||||
|
|
||||||
|
- NEW **Framebuffer** system: `rlgl` module now exposes an API for custom **Framebuffer attachments** (including cubemaps!). raylib `RenderTexture` is a basic use-case, just allowing color and depth textures, but this new API allows the creation of more advance Framebuffers with multiple attachments, like the **G-Buffers**. `GenTexture*()` functions have been redesigned to use this new API.
|
||||||
|
|
||||||
|
- Improved **software rendering**: raylib `Image*()` API is intended for software rendering, for those cases when **no GPU or no Window is available**. Those functions operate directly with **multi-format** pixel data on RAM and they have been completely redesigned to be way faster, specially for small resolutions and retro-gaming. Low-end embedded devices like **microcontrollers with custom displays** could benefit of this raylib functionality!
|
||||||
|
|
||||||
|
- File **loading from memory**: Multiple functions have been redesigned to load data from memory buffers **instead of directly accessing the files**, now all raylib file loading/saving goes through a couple of functions that load data into memory. This feature allows **custom virtual-file-systems** and it gives more control to the user to access data already loaded in memory (i.e. images, fonts, sounds...).
|
||||||
|
|
||||||
|
- NEW **Window states** management system: raylib `core` module has been redesigned to support Window **state check and setup more easily** and also **before/after Window initialization**, `SetConfigFlags()` has been reviewed and `SetWindowState()` has been added to control Window minification, maximization, hidding, focusing, topmost and more.
|
||||||
|
|
||||||
|
- NEW **GitHub Actions** CI/CD system: Previous CI implementation has been reviewed and improved a lot to support **multiple build configurations** (platforms, compilers, static/shared build) and also an **automatic deploy system** has been implemented to automatically attach the diferent generated artifacts to every new release. As the system seems to work very good, previous CI platforms (AppVeyor/TravisCI) have been removed.
|
||||||
|
|
||||||
|
A part of those changes, many new functions have been added, some redundant functions removed and many functions have been reviewed for consistency with the full API (function name, parameters name and order, code formatting...). Again, this release represents is a **great improvement for raylib and marks the way forward** for the library. Make sure to check [CHANGELOG](CHANGELOG) for details! Hope you enjoy it!
|
||||||
|
|
||||||
|
Happy holidays! :)
|
||||||
|
|
||||||
|
notes on raylib 3.7
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
April 2021, it's been about 4 months since last raylib release and here it is already a new one, this time with a bunch of internal redesigns and improvements. Surprisingly, on April the 8th I was awarded for a second time with the [Google Open Source Peer Bonus Award](https://opensource.googleblog.com/2021/04/announcing-first-group-of-google-open-source-peer-bonus-winners.html) for my contribution to open source world with raylib and it seems the library is getting some traction, what a better moment for a new release? Let's see what can be found in this new version:
|
||||||
|
|
||||||
|
Let's start with some numbers:
|
||||||
|
|
||||||
|
- **+100** closed issues (for a TOTAL of **+900**!)
|
||||||
|
- **+400** commits since previous RELEASE
|
||||||
|
- **+50** functions ADDED (**+30** of them to rlgl API)
|
||||||
|
- **+30** functions REVIEWED/REDESIGNED
|
||||||
|
- **+40** new contributors (for a TOTAL of **+210**!)
|
||||||
|
|
||||||
|
Highlights for `raylib 3.7`:
|
||||||
|
|
||||||
|
- **REDESIGNED: `rlgl` module for greater abstraction level**. This suppose an **important change in raylib architecture**, now `rlgl` functionality is self-contained in the module and used by higher-level layers (specially by `core` module), those upper layers are the ones that expose functionality to the main API when required, for example the `Shaders`, `Mesh` and `Materials` functionality. Multiple `rlgl` functions have been renamed for consistency, in this case, following the `rl*()` prefix convention. Functions have also been reorganized internally by categories and `GenTexture*()` functions have been removed from the library and moved to [`models_material_pbr`](https://github.com/raysan5/raylib/blob/master/examples/models/models_material_pbr.c) example.
|
||||||
|
|
||||||
|
- **REDESIGNED: VR simulator and stereo rendering mechanism**. A **brand new API** has been added, more comprehensive and better integrated with raylib, the **new stereo rendering** can be combined with `RenderTexture` and `Shader` API allowing the user to **manage fbo and distortion shader directly**. Also, the new rendering mechanism supports **instancing on stereo rendering**! Check the updated [`core_vr_simulator`](https://github.com/raysan5/raylib/blob/master/examples/core/core_vr_simulator.c) example for reference!
|
||||||
|
|
||||||
|
- **ADDED: New file access callbacks system**. Several new callback functions have been added to the API to allow custom file loaders. A [nice example](https://github.com/RobLoach/raylib-physfs) it's the **raylib integration with a virtual file system** [PhysFS](https://icculus.org/physfs/).
|
||||||
|
|
||||||
|
- **ADDED: glTF animations support**. glTF is the preferred models file format to be used with raylib and along the addition of a models animation API on latest raylib versions, now animations support for glTF format has come to raylib, thanks for this great contribution to [Hristo Stamenov](@object71)
|
||||||
|
|
||||||
|
- **ADDED: Music streaming support from memory**. raylib has been adding the `Load*FromMemory()` option to all its supported file formats but **music streaming** was not supported yet... until now. Thanks to this great contribution by [Agnis "NeZvērs" Aldiņš](@nezvers), now raylib supports music streamming from memory data for all supported file formats: WAV, OGG, MP3, FLAC, XM and MOD.
|
||||||
|
|
||||||
|
- **RENAMED: enums values for consistency**. Most raylib enums names and values names have been renamed for consistency, now all value names start with the type of data they represent. It increases clarity and readability when using those values and also **improves overall library consistency**.
|
||||||
|
|
||||||
|
Beside those key changes, many functions have been reviewed with improvements and bug fixes, many of them contributed by the community! Thanks! And again, this release sets a **new milestone for raylib library**. Make sure to check [CHANGELOG](CHANGELOG) for detailed list of changes! Hope you enjoy this new raylib installment!
|
||||||
|
|
||||||
|
Happy **gamedev/tools/graphics** programming! :)
|
||||||
|
|
||||||
|
notes on raylib 4.0 - 8th Anniversary Edition
|
||||||
|
---------------------------------------------
|
||||||
|
|
||||||
|
It's been about 6 months since last raylib release and it's been **8 years since I started with this project**, what an adventure! It's time for a new release: `raylib 4.0`, **the biggest release ever** and an inflexion point for the library. Many hours have been put in this release to make it special, **many library details have been polished**: syntax, naming conventions, code comments, functions descriptions, log outputs... Almost all the issues have been closed (only 3 remain open at the moment of this writing) and some amazing new features have been added. I expect this **`raylib 4.0`** to be a long term version (LTS), stable and complete enough for any new graphic/game/tool application development.
|
||||||
|
|
||||||
|
Let's start with some numbers:
|
||||||
|
|
||||||
|
- **+130** closed issues (for a TOTAL of **+1030**!)
|
||||||
|
- **+550** commits since previous RELEASE
|
||||||
|
- **+20** functions ADDED to raylib API
|
||||||
|
- **+60** functions ADDED to rlgl API
|
||||||
|
- **+40** functions RENAMED/REVIEWED/REDESIGNED
|
||||||
|
- **+60** new contributors (for a TOTAL of **+275**!)
|
||||||
|
|
||||||
|
Highlights for `raylib 4.0`:
|
||||||
|
|
||||||
|
- **Naming consistency and coherency**: `raylib` API has been completely reviewed to be consistent on naming conventions for data structures and functions, comments and descriptions have been reviewed, also the syntax of many symbols for consistency; some functions and structs have been renamed (i.e. `struct CharInfo` to `struct GlyphInfo`). Output log messages have been also improved to show more info to the users. Several articles have been writen in this process: [raylib_syntax analysis](https://github.com/raysan5/raylib/wiki/raylib-syntax-analysis) and [raylib API usage analysis](https://gist.github.com/raysan5/7c0c9fff1b6c19af24bb4a51b7383f1e). In general, a big polishment of the library to make it more consistent and coherent.
|
||||||
|
|
||||||
|
- **Event Automation System**: This new _experimental_ feature has been added for future usage, it allows to **record input events and re-play them automatically**. This feature could be very useful to automatize examples testing but also for tutorials with assited game playing, in-game cinematics, speedruns, AI playing and more! Note this feature is still experimental.
|
||||||
|
|
||||||
|
- **Custom game-loop control**: As requested by some advance users, **the game-loop control can be exposed** compiling raylib with the config flag: `SUPPORT_CUSTOM_FRAME_CONTROL`. It's intended for advance users that want to control the events polling and also the timming mechanisms of their games.
|
||||||
|
|
||||||
|
- [**`rlgl 4.0`**](https://github.com/raysan5/raylib/blob/master/src/rlgl.h): This module has been completely **decoupled from platform layer** and raylib, now `rlgl` single-file header-only library only depends on the multiple OpenGL backends supported, even the dependency on `raymath` has been removed. Additionally, **support for OpenGL 4.3** has been added, supporting compute shaders and Shader Storage Buffer Objects (SSBO). Now `rlgl` can be used as a complete standalone portable library to wrap several OpenGL version and providing **a simple and easy-to-use pseudo-OpenGL immediate-mode API**.
|
||||||
|
|
||||||
|
- [**`raymath 1.5`**](https://github.com/raysan5/raylib/blob/master/src/raymath.h): This module has been reviewed and some new conventions have been adopted to make it **more portable and self-contained**:
|
||||||
|
- Functions are self-contained, no function use other raymath function inside, required code is directly re-implemented
|
||||||
|
- Functions input parameters are always received by value
|
||||||
|
- Functions use always a "result" variable for return
|
||||||
|
- Angles are always in radians (`DEG2RAD`/`RAD2DEG` macros provided for convenience)
|
||||||
|
|
||||||
|
- [**`raygui 3.0`**](https://github.com/raysan5/raygui): The **official raylib immediate-mode gui library** (included in `raylib/src/extras`) has been updated to a new version, embedding the icons collection and adding mulstiple improvements. It has been simplified and constrained for a better focus on its task: provide a simple and easy-to-use immediate-mode-gui library for small tools development.
|
||||||
|
|
||||||
|
- [**`raylib_parser`**](https://github.com/raysan5/raylib/tree/master/parser): Added **new tool to parse `raylib.h`** and tokenize its enums, structs and functions, extracting all required info (name, params, descriptions...) into custom output formats (TXT, XML, JSON...) for further processing. This tool is specially useful to **automatize bindings generation**. Hopefully, this tool will make life easier to binding creators to update their bindings for raylib 4.0 or adding new ones!
|
||||||
|
|
||||||
|
- **Zig and Odin official support for raylib**: Those two new amazing programming languages are officially supporting raylib, `Zig` lists raylib as an [official example for C interoperatibility](https://ziglang.org/learn/samples/#c-interoperability) and Odin [officially supports raylib as a vendor library](https://github.com/odin-lang/Odin/tree/master/vendor/raylib). Both languages also have several bingings to raylib. Additionally, Zig build system supported has been added to compile raylib library and examples.
|
||||||
|
|
||||||
|
Those are some of the key features for this new release but actually there is way more! **Support for `VOX` ([MagikaVoxel](https://ephtracy.github.io/)) 3d model format** has been added, **new [raylib_game_template](https://github.com/raysan5/raylib-game-template)** repo shared, **new `EncodeDataBase64()` and `DecodeDataBase64()` functions** added, **improved HiDPI support**, new `DrawTextPro()` with support for text rotations, completely **reviewed `glTF` models loading**, added **`SeekMusicStream()` for music seeking**, many new examples and +20 examples reviewed... **hundreds of improvements and bug fixes**! Make sure to check [CHANGELOG](CHANGELOG) for a detailed list of changes!
|
||||||
|
|
||||||
|
Undoubtely, **this is the best raylib ever**. Enjoy gamedev/tools/graphics programming! :)
|
||||||
|
|
||||||
|
notes on raylib 4.2
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
**New raylib release!** Nine months after latest raylib, here it is a new version. It was supposed to be just a small update but, actually, it's a huge update with lots of changes a improvements. It has been possible thanks to the many contributors that has helped with issues and improvements, it's the **update with more contributors to date** and that's amazing!
|
||||||
|
|
||||||
|
Some numbers to start with:
|
||||||
|
|
||||||
|
- **+200** closed issues (for a TOTAL of **1230**!)
|
||||||
|
- **+540** commits since previous RELEASE (for a TOTAL of **+6000**!)
|
||||||
|
- **+20** functions ADDED to raylib API (for a TOTAL of **502**!)
|
||||||
|
- **+60** functions REVIEWED/REDESIGNED
|
||||||
|
- **+70** new contributors (for a TOTAL of **+360**!)
|
||||||
|
|
||||||
|
Highlights for `raylib 4.2`:
|
||||||
|
|
||||||
|
- **raylib extra libraries cleanup**: raylib has been on diet and all the _extra_ libraries included on previous releases have been removed from raylib. Now raylib only includes the original **7** raylib modules: `rcore`, `rlgl`, `rshapes`, `rtextures`, `rtext`, `rmodels` and `raudio`. But no worries, _extra_ libraries have not been deleted, they have been moved to their own repos for better maintainability and more focus on its functionality. The libraries moved out from raylib repo are: [`raygui`](https://github.com/raysan5/raygui), [`physac`](https://github.com/raysan5/physac), [`rmem`](https://github.com/raylib-extras/rmem), [`reasings`](https://github.com/raylib-extras/reasings) and [`raudio`](https://github.com/raysan5/raudio) (standalone mode). On that same line, a new **amazing GitHub group:** [`raylib-extras`](https://github.com/raylib-extras) has been created by @JeffM2501 to contain raylib extra libraries as well as other raylib add-ons provided by the community. Jeff has done an amazing work on that line, providing multiple libraries and examples for raylib, like [custom first-person and third person camera systems](https://github.com/raylib-extras/extras-c/tree/main/cameras), [Dear ImGui raylib integration](https://github.com/raylib-extras/rlImGui), [multiple specific examples](https://github.com/raylib-extras/examples-c) and even a complete [RPG Game Example](https://github.com/raylib-extras/RPGExample)! Great work Jeff! :D
|
||||||
|
|
||||||
|
- **raylib examples review**: The +120 raylib examples have been reviewed to add clearer information about when the were first created (raylib version used) and when they were updated for the last time. But the greatest improvement for users has been the **addition of an estimated difficulty level** for every example, [web has been updated accordingly](https://www.raylib.com/examples.html) to reflect those difficulty levels. Now examples are classified with **1 to 4 stars** depending on difficulty to help users with their learning process. Personally, I think this "small" addition could be a game-changer to better guide new users on the library adoption! Additionally, this new raylib release includes 7 new examples; the most interesting one: [`text_codepoints_loading`](https://www.raylib.com/examples/text/loader.html?name=text_codepoints_loading) that illustrates how to load and draw custom codepoints from a font file, very useful for Asian languages.
|
||||||
|
|
||||||
|
- [**`rres 1.0`**](https://github.com/raysan5/rres): New `rres` **resources packaging file-format**, including a [`rres-raylib`](https://github.com/raysan5/rres/blob/master/src/rres-raylib.h) library implementation and [`rrespacker`](https://raylibtech.itch.io/rrespacker) tool. `rres` file format has been [under development for +8 years](https://github.com/raysan5/rres#design-history) and it was originally created to be part of raylib. It was highly inspired by _XNA XNB_ resources file format but design has changed a lot along the years. This first release of the format specs is engine-agnostic and has been designed to be portable to any engine, including lots of professional features like data processing, compression and encryption.
|
||||||
|
|
||||||
|
- [**`raygui 3.2`**](https://github.com/raysan5/raygui): The **official raylib immediate-mode gui library** designed for tools development has been updated to a new version aligned with raylib 4.2. Multiple controls have been reviewed for library consistency, now all controls follow a similar function signature. It has been battle-tested with the development of +8 published tools in the last months. The tools can be seen and used for free in the [raylib technologies tools page](https://raylibtech.itch.io/). Worth mentioning that several of those **tools have been open sourced** for anyone to use, compile, contribute or learn how the code works.
|
||||||
|
|
||||||
|
- [**`raylib_parser`**](https://github.com/raysan5/raylib/tree/master/parser): Multiple contributors **using the tool to automatize bindings creation** have contributed with improvements of this **tool to parse `raylib.h`** (and other raylib-style headers) to tokenize its enums, structs and functions. Processed data can be exported to custom file formats (i.e XML, JSON, LUA) for bindings generation or even docs generation if required.
|
||||||
|
|
||||||
|
- **New file system API**: Current API has been redesigned to be more comprehensive and better aligned with raylib naming conventions, two new functions are provided `LoadDirectoryFiles()`/`LoadDirectoryFilesEx()` to load a `FilePathList` for provided path, supporting extension filtering and recursive directory scan. `LoadDroppedFiles()` has been renamed to better reflect its internal functionality. Now, all raylib functions that start with `Load*()` allocate memory internally and a equivalent `Unload*()` function is defined to take care of that memory internally when not required any more!
|
||||||
|
|
||||||
|
- **New audio stream processors API** (_experimental_): Now real-time audio stream data processors can be added using callbacks to played Music. It allows users to create custom effects for audio like delays of low-pass-filtering (example provided). The new API uses a callback system and it's still _ highly experimental_, it differs from the usual level of complexity that provides raylib and it is intended for advance users. It could change in the future but, actually, `raudio` module is in the spotlight for future updates; [miniaudio](https://github.com/mackron/miniaudio) implements a new higher-level API that can be useful in the future for raylib.
|
||||||
|
|
||||||
|
As always, there are more improvements than the key features listed, make sure to check raylib [CHANGELOG](CHANGELOG) for the detailed list of changes; for this release a `WARNING` flag has been added to all the changes that could affect bindings or productivity code. **raylib keeps improving one more version** and a special focus on maintainability has been put on the library for the future. Specific/advance functionality will be provided through **raylib-extras** repos and raylib main repo devlelopment will be focused on what made raylib popular: being a simple and easy-to-use library to **enjoy videogames programming**.
|
||||||
|
|
||||||
|
**Enjoy gamedev/tools/graphics programming!** :)
|
||||||
|
|
||||||
|
notes on raylib 4.5
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
It's been **7 months** since latest raylib release. As usual, **many parts of the library have been reviewed and improved** along those months. Many issues have been closed, staying under 10 open issues at the moment of this writting and also many PRs from contributors have been received, reviewed and merged into raylib library. Some new functions have been added and some others have been removed to improve library coherence and avoid moving too high level, giving the users the tools to implement advance functionality themselfs over raylib. Again, this is a big release with a considerable amount of changes and improvements. Here it is a small summary highlighting this new **rayib 4.5**.
|
||||||
|
|
||||||
|
Some numbers for this release:
|
||||||
|
|
||||||
|
- **+100** closed issues (for a TOTAL of **+1340**!)
|
||||||
|
- **+350** commits since previous RELEASE (for a TOTAL of **+6350**!)
|
||||||
|
- **+25** functions ADDED to raylib API (for a TOTAL of **516**!)
|
||||||
|
- **+40** functions REVIEWED/REDESIGNED
|
||||||
|
- **+40** new contributors (for a TOTAL of **405**!)
|
||||||
|
|
||||||
|
Highlights for `raylib 4.5`:
|
||||||
|
|
||||||
|
- **`NEW` Improved ANGLE support on Desktop platforms**: Support for OpenGL ES 2.0 on Desktop platforms (Windows, Linux, macOS) has been reviewed by @wtnbgo GitHub user. Now raylib can be compiled on desktop for OpenGL ES 2.0 and linked against [`ANGLE`](https://github.com/google/angle). This _small_ addition open the door to building raylib for all **ANGLE supported backends: Direct3D 11, Vulkan and Metal**. Please note that this new feature is still experimental and requires further testing!
|
||||||
|
|
||||||
|
- **`NEW` Camera module**: A brand new implementation from scratch for `rcamera` module, contributed by @Crydsch GitHub user! **New camera system is simpler, more flexible, more granular and more extendable**. Specific camera math transformations (movement/rotation) have been moved to individual functions, exposing them to users if required. Global state has been removed from the module and standalone usage has been greatly improved; now `rcamera.h` single-file header-only library can be used externally, independently of raylib. A new `UpdateCameraPro()` function has been added to address input-dependency of `UpdateCamera()`, now advance users have **full control over camera inputs and movement/rotation speeds**!
|
||||||
|
|
||||||
|
- **`NEW` Support for M3D models and M3D/GLTF animations**: 3d models animations support has been a limited aspect of raylib for long time, some versions ago IQM animations were supported but raylib 4.5 also adds support for the brand new [M3D file format](https://bztsrc.gitlab.io/model3d/), including animations and the long expected support for **GLTF animations**! The new M3D file format is **simple, portable, feature complete, extensible and open source**. It also provides a complete set of tools to export/visualize M3D models from/to Blender! Now raylib supports up to **3 model file-formats with animations**: `IQM`, `GLTF` and `M3D`.
|
||||||
|
|
||||||
|
- **`NEW` Support QOA audio format (import/export)**: Just a couple of months ago the new [QOA file format](https://qoaformat.org/) was published, a very simple, portable and open source quite-ok-audio file format. raylib already supports it, added to `raudio` module and including audio loading from file, loading from memory, streaming from file, streaming from memory and **exporting to QOA** audio format. **Because simplicity really matters to raylib!**
|
||||||
|
|
||||||
|
- **`NEW` Module for compressed textures loading**: [`rl_gputex`](https://github.com/raysan5/raylib/blob/master/src/external/rl_gputex.h), a portable single-file header-only small library to load compressed texture file-formats (DDS, PKM, KTX, PVR, ASTC). Provided functionality is not new to raylib but it was part of the raylib `rtextures` module, now it has been moved into a separate self-contained library, **improving portability**. Note that this module is only intended to **load compressed data from files, ready to be uploaded to GPU**, no compression/decompression functionality is provided. This change is a first step towards a better modularization of raylib library.
|
||||||
|
|
||||||
|
- **Reviewed `rlgl` module for automatic limits checking**: Again, [`rlgl`](https://github.com/raysan5/raylib/blob/master/src/rlgl.h) has been reviewed to simplify usage. Now users do not need to worry about reaching the internal render-batch limits when they send their triangles to draw 2d/3d, `rlgl` manages it automatically! This change allows a **great simplification for other modules** like `rshapes`, `rtextures` and `rmodels` that do not need to worry about bufffer overflows and can just define as many vertex as desired!
|
||||||
|
|
||||||
|
- **Reviewed `rshapes` module to minimize the rlgl dependency**: Now `rshapes` 2d shapes drawing functions **only depend on 6 low-level functions**: `rlBegin()`, `rlEnd()`, `rlVertex3f()`, `rlTexCoord2f()`, `rlNormal3f()`, `rlSetTexture()`. With only those pseudo-OpenGl 1.1 minimal functionality, everything can be drawn! This improvement converts `rshapes` module in a **self-contained, portable shapes-drawing library that can be used independently of raylib**, as far as entry points for those 6 functions are provided by the user. It even allows to be used for software rendering, with the proper backend!
|
||||||
|
|
||||||
|
- **Added data structures validation functions**: Multiple functions have been added by @RobLoach GitHub user to ease the validation of raylib data structures: `IsImageReady()`, `IsTextureReady()`, `IsSoundReady()`... Now users have a simple mechanism to **make sure data has been correctly loaded**, instead of checking internal structure values by themselfs.
|
||||||
|
|
||||||
|
As usual, those are only some highlights but there is much more! New image generators, new color transformation functionality, improved blending support for color/alpha, etc... Make sure to check raylib [CHANGELOG]([CHANGELOG](https://github.com/raysan5/raylib/blob/master/CHANGELOG)) for a detailed list of changes! Please, note that all breaking changes have been flagged with a `WARNING` in the CHANGELOG, specially useful for binding creators!
|
||||||
|
|
||||||
|
**raylib keeps improving one more version** with a special focus on maintainability and sustainability. Always working towards making the library more **simple and easy-to-use**.
|
||||||
|
|
||||||
|
Let's keep **enjoying games/tools/graphics programming!** :)
|
16
3party/raylib/LICENSE
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
Copyright (c) 2013-2023 Ramon Santamaria (@raysan5)
|
||||||
|
|
||||||
|
This software is provided "as-is", without any express or implied warranty. In no event
|
||||||
|
will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|
||||||
|
Permission is granted to anyone to use this software for any purpose, including commercial
|
||||||
|
applications, and to alter it and redistribute it freely, subject to the following restrictions:
|
||||||
|
|
||||||
|
1. The origin of this software must not be misrepresented; you must not claim that you
|
||||||
|
wrote the original software. If you use this software in a product, an acknowledgment
|
||||||
|
in the product documentation would be appreciated but is not required.
|
||||||
|
|
||||||
|
2. Altered source versions must be plainly marked as such, and must not be misrepresented
|
||||||
|
as being the original software.
|
||||||
|
|
||||||
|
3. This notice may not be removed or altered from any source distribution.
|
144
3party/raylib/README.md
Normal file
@ -0,0 +1,144 @@
|
|||||||
|
<img align="left" style="width:260px" src="https://github.com/raysan5/raylib/blob/master/logo/raylib_logo_animation.gif" width="288px">
|
||||||
|
|
||||||
|
**raylib is a simple and easy-to-use library to enjoy videogames programming.**
|
||||||
|
|
||||||
|
raylib is highly inspired by Borland BGI graphics lib and by XNA framework and it's especially well suited for prototyping, tooling, graphical applications, embedded systems and education.
|
||||||
|
|
||||||
|
*NOTE for ADVENTURERS: raylib is a programming library to enjoy videogames programming; no fancy interface, no visual helpers, no debug button... just coding in the most pure spartan-programmers way.*
|
||||||
|
|
||||||
|
Ready to learn? Jump to [code examples!](https://www.raylib.com/examples.html)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
[![GitHub Releases Downloads](https://img.shields.io/github/downloads/raysan5/raylib/total)](https://github.com/raysan5/raylib/releases)
|
||||||
|
[![GitHub Stars](https://img.shields.io/github/stars/raysan5/raylib?style=flat&label=stars)](https://github.com/raysan5/raylib/stargazers)
|
||||||
|
[![GitHub commits since tagged version](https://img.shields.io/github/commits-since/raysan5/raylib/4.5.0)](https://github.com/raysan5/raylib/commits/master)
|
||||||
|
[![GitHub Sponsors](https://img.shields.io/github/sponsors/raysan5?label=sponsors)](https://github.com/sponsors/raysan5)
|
||||||
|
[![Packaging Status](https://repology.org/badge/tiny-repos/raylib.svg)](https://repology.org/project/raylib/versions)
|
||||||
|
[![License](https://img.shields.io/badge/license-zlib%2Flibpng-blue.svg)](LICENSE)
|
||||||
|
|
||||||
|
[![Discord Members](https://img.shields.io/discord/426912293134270465.svg?label=Discord&logo=discord)](https://discord.gg/raylib)
|
||||||
|
[![Subreddit Subscribers](https://img.shields.io/reddit/subreddit-subscribers/raylib?label=reddit%20r%2Fraylib&logo=reddit)](https://www.reddit.com/r/raylib/)
|
||||||
|
[![Youtube Subscribers](https://img.shields.io/youtube/channel/subscribers/UC8WIBkhYb5sBNqXO1mZ7WSQ?style=flat&label=Youtube&logo=youtube)](https://www.youtube.com/c/raylib)
|
||||||
|
[![Twitch Status](https://img.shields.io/twitch/status/raysan5?style=flat&label=Twitch&logo=twitch)](https://www.twitch.tv/raysan5)
|
||||||
|
|
||||||
|
[![Windows](https://github.com/raysan5/raylib/workflows/Windows/badge.svg)](https://github.com/raysan5/raylib/actions?query=workflow%3AWindows)
|
||||||
|
[![Linux](https://github.com/raysan5/raylib/workflows/Linux/badge.svg)](https://github.com/raysan5/raylib/actions?query=workflow%3ALinux)
|
||||||
|
[![macOS](https://github.com/raysan5/raylib/workflows/macOS/badge.svg)](https://github.com/raysan5/raylib/actions?query=workflow%3AmacOS)
|
||||||
|
[![Android](https://github.com/raysan5/raylib/workflows/Android/badge.svg)](https://github.com/raysan5/raylib/actions?query=workflow%3AAndroid)
|
||||||
|
[![WebAssembly](https://github.com/raysan5/raylib/workflows/WebAssembly/badge.svg)](https://github.com/raysan5/raylib/actions?query=workflow%3AWebAssembly)
|
||||||
|
|
||||||
|
[![CMakeBuilds](https://github.com/raysan5/raylib/workflows/CMakeBuilds/badge.svg)](https://github.com/raysan5/raylib/actions?query=workflow%3ACMakeBuilds)
|
||||||
|
[![Windows Examples](https://github.com/raysan5/raylib/actions/workflows/windows_examples.yml/badge.svg)](https://github.com/raysan5/raylib/actions/workflows/windows_examples.yml)
|
||||||
|
[![Linux Examples](https://github.com/raysan5/raylib/actions/workflows/linux_examples.yml/badge.svg)](https://github.com/raysan5/raylib/actions/workflows/linux_examples.yml)
|
||||||
|
|
||||||
|
features
|
||||||
|
--------
|
||||||
|
- **NO external dependencies**, all required libraries are [bundled into raylib](https://github.com/raysan5/raylib/tree/master/src/external)
|
||||||
|
- Multiple platforms supported: **Windows, Linux, MacOS, RPI, Android, HTML5... and more!**
|
||||||
|
- Written in plain C code (C99) using PascalCase/camelCase notation
|
||||||
|
- Hardware accelerated with OpenGL (**1.1, 2.1, 3.3, 4.3 or ES 2.0**)
|
||||||
|
- **Unique OpenGL abstraction layer** (usable as standalone module): [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h)
|
||||||
|
- Multiple **Fonts** formats supported (TTF, Image fonts, AngelCode fonts)
|
||||||
|
- Multiple texture formats supported, including **compressed formats** (DXT, ETC, ASTC)
|
||||||
|
- **Full 3D support**, including 3D Shapes, Models, Billboards, Heightmaps and more!
|
||||||
|
- Flexible Materials system, supporting classic maps and **PBR maps**
|
||||||
|
- **Animated 3D models** supported (skeletal bones animation) (IQM)
|
||||||
|
- Shaders support, including model and **postprocessing** shaders.
|
||||||
|
- **Powerful math module** for Vector, Matrix and Quaternion operations: [raymath](https://github.com/raysan5/raylib/blob/master/src/raymath.h)
|
||||||
|
- Audio loading and playing with streaming support (WAV, OGG, MP3, FLAC, XM, MOD)
|
||||||
|
- **VR stereo rendering** support with configurable HMD device parameters
|
||||||
|
- Huge examples collection with [+120 code examples](https://github.com/raysan5/raylib/tree/master/examples)!
|
||||||
|
- Bindings to [+60 programming languages](https://github.com/raysan5/raylib/blob/master/BINDINGS.md)!
|
||||||
|
- **Free and open source**.
|
||||||
|
|
||||||
|
basic example
|
||||||
|
--------------
|
||||||
|
This is a basic raylib example, it creates a window and it draws the text `"Congrats! You created your first window!"` in the middle of the screen. Check this example [running live on web here](https://www.raylib.com/examples/core/loader.html?name=core_basic_window).
|
||||||
|
```c
|
||||||
|
#include "raylib.h"
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
InitWindow(800, 450, "raylib [core] example - basic window");
|
||||||
|
|
||||||
|
while (!WindowShouldClose())
|
||||||
|
{
|
||||||
|
BeginDrawing();
|
||||||
|
ClearBackground(RAYWHITE);
|
||||||
|
DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
|
||||||
|
EndDrawing();
|
||||||
|
}
|
||||||
|
|
||||||
|
CloseWindow();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
build and installation
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
raylib binary releases for Windows, Linux, macOS, Android and HTML5 are available at the [Github Releases page](https://github.com/raysan5/raylib/releases).
|
||||||
|
|
||||||
|
raylib is also available via multiple [package managers](https://github.com/raysan5/raylib/issues/613) on multiple OS distributions.
|
||||||
|
|
||||||
|
#### Installing and building raylib on multiple platforms
|
||||||
|
|
||||||
|
[raylib Wiki](https://github.com/raysan5/raylib/wiki#development-platforms) contains detailed instructions on building and usage on multiple platforms.
|
||||||
|
|
||||||
|
- [Working on Windows](https://github.com/raysan5/raylib/wiki/Working-on-Windows)
|
||||||
|
- [Working on macOS](https://github.com/raysan5/raylib/wiki/Working-on-macOS)
|
||||||
|
- [Working on GNU Linux](https://github.com/raysan5/raylib/wiki/Working-on-GNU-Linux)
|
||||||
|
- [Working on Chrome OS](https://github.com/raysan5/raylib/wiki/Working-on-Chrome-OS)
|
||||||
|
- [Working on FreeBSD](https://github.com/raysan5/raylib/wiki/Working-on-FreeBSD)
|
||||||
|
- [Working on Raspberry Pi](https://github.com/raysan5/raylib/wiki/Working-on-Raspberry-Pi)
|
||||||
|
- [Working for Android](https://github.com/raysan5/raylib/wiki/Working-for-Android)
|
||||||
|
- [Working for Web (HTML5)](https://github.com/raysan5/raylib/wiki/Working-for-Web-(HTML5))
|
||||||
|
- [Working anywhere with CMake](https://github.com/raysan5/raylib/wiki/Working-with-CMake)
|
||||||
|
|
||||||
|
*Note that the Wiki is open for edit, if you find some issues while building raylib for your target platform, feel free to edit the Wiki or open an issue related to it.*
|
||||||
|
|
||||||
|
#### Setup raylib with multiple IDEs
|
||||||
|
|
||||||
|
raylib has been developed on Windows platform using [Notepad++](https://notepad-plus-plus.org/) and [MinGW GCC](https://www.mingw-w64.org/) compiler but it can be used with other IDEs on multiple platforms.
|
||||||
|
|
||||||
|
[Projects directory](https://github.com/raysan5/raylib/tree/master/projects) contains several ready-to-use **project templates** to build raylib and code examples with multiple IDEs.
|
||||||
|
|
||||||
|
*Note that there are lots of IDEs supported, some of the provided templates could require some review, so please, if you find some issue with a template or you think they could be improved, feel free to send a PR or open a related issue.*
|
||||||
|
|
||||||
|
learning and docs
|
||||||
|
------------------
|
||||||
|
|
||||||
|
raylib is designed to be learned using [the examples](https://github.com/raysan5/raylib/tree/master/examples) as the main reference. There is no standard API documentation but there is a [**cheatsheet**](https://www.raylib.com/cheatsheet/cheatsheet.html) containing all the functions available on the library a short description of each one of them, input parameters and result value names should be intuitive enough to understand how each function works.
|
||||||
|
|
||||||
|
Some additional documentation about raylib design can be found in raylib GitHub Wiki. Here are the relevant links:
|
||||||
|
|
||||||
|
- [raylib cheatsheet](https://www.raylib.com/cheatsheet/cheatsheet.html)
|
||||||
|
- [raylib architecture](https://github.com/raysan5/raylib/wiki/raylib-architecture)
|
||||||
|
- [raylib library design](https://github.com/raysan5/raylib/wiki)
|
||||||
|
- [raylib examples collection](https://github.com/raysan5/raylib/tree/master/examples)
|
||||||
|
- [raylib games collection](https://github.com/raysan5/raylib-games)
|
||||||
|
|
||||||
|
|
||||||
|
contact and networks
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
raylib is present in several networks and raylib community is growing everyday. If you are using raylib and enjoying it, feel free to join us in any of these networks. The most active network is our [Discord server](https://discord.gg/raylib)! :)
|
||||||
|
|
||||||
|
- Webpage: [https://www.raylib.com](https://www.raylib.com)
|
||||||
|
- Discord: [https://discord.gg/raylib](https://discord.gg/raylib)
|
||||||
|
- Twitter: [https://www.twitter.com/raysan5](https://www.twitter.com/raysan5)
|
||||||
|
- Twitch: [https://www.twitch.tv/raysan5](https://www.twitch.tv/raysan5)
|
||||||
|
- Reddit: [https://www.reddit.com/r/raylib](https://www.reddit.com/r/raylib)
|
||||||
|
- Patreon: [https://www.patreon.com/raylib](https://www.patreon.com/raylib)
|
||||||
|
- YouTube: [https://www.youtube.com/channel/raylib](https://www.youtube.com/c/raylib)
|
||||||
|
|
||||||
|
license
|
||||||
|
-------
|
||||||
|
|
||||||
|
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. Check [LICENSE](LICENSE) for further details.
|
||||||
|
|
||||||
|
raylib uses internally some libraries for window/graphics/inputs management and also to support different file formats loading, all those libraries are embedded with and are available in [src/external](https://github.com/raysan5/raylib/tree/master/src/external) directory. Check [raylib dependencies LICENSES](https://github.com/raysan5/raylib/wiki/raylib-dependencies) on raylib Wiki for details.
|
82
3party/raylib/ROADMAP.md
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
# raylib roadmap
|
||||||
|
|
||||||
|
Here it is a wishlist with features and ideas to improve the library. Note that features listed here are usually long term improvements or just describe a route to follow for the library. There are also some additional places to look for raylib improvements and ideas:
|
||||||
|
|
||||||
|
- [GitHub Issues](https://github.com/raysan5/raylib/issues) has several open issues for possible improvements or bugs to fix.
|
||||||
|
- [raylib source code](https://github.com/raysan5/raylib/tree/master/src) has multiple *TODO* comments around code with pending things to review or improve.
|
||||||
|
- raylib wishlists discussions are open to everyone to ask for improvements, feel free to check and comment:
|
||||||
|
- [raylib wishlist 2021](https://github.com/raysan5/raylib/discussions/1502)
|
||||||
|
- [raylib wishlist 2022](https://github.com/raysan5/raylib/discussions/2272)
|
||||||
|
- [raylib 5.0 wishlist](https://github.com/raysan5/raylib/discussions/2952)
|
||||||
|
|
||||||
|
_Current version of raylib is complete and functional but there is always room for improvements._
|
||||||
|
|
||||||
|
**raylib 4.x**
|
||||||
|
- [ ] Split core module into separate platforms?
|
||||||
|
- [ ] Basic 2d software renderer, using `Image` provided API
|
||||||
|
- [ ] Redesign gestures system, improve touch inputs management
|
||||||
|
- [ ] Redesign audio module, implement miniaudio high-level provided features
|
||||||
|
- [x] Redesign camera module (more flexible) ([#1143](https://github.com/raysan5/raylib/issues/1143), https://github.com/raysan5/raylib/discussions/2507)
|
||||||
|
- [x] Better documentation and improved examples, reviewed webpage with examples complexity level
|
||||||
|
- [x] Focus on HTML5 ([raylib 5k gamejam](https://itch.io/jam/raylib-5k-gamejam)) and embedded platforms (RPI and similar SOCs)
|
||||||
|
- [x] Additional support libraries: [raygui](https://github.com/raysan5/raygui), [rres](https://github.com/raysan5/rres)
|
||||||
|
|
||||||
|
**raylib 4.0**
|
||||||
|
- [x] Improved consistency and coherency in raylib API
|
||||||
|
- [x] Continuous Deployment using GitHub Actions
|
||||||
|
- [x] rlgl improvements for standalone usage (avoid raylib coupling)
|
||||||
|
- Basic CPU/GPU stats system (memory, draws, time...) ([#1295](https://github.com/raysan5/raylib/issues/1295)) - _DISCARDED_
|
||||||
|
- Software rendering backend (avoiding OpenGL) ([#1370](https://github.com/raysan5/raylib/issues/1370)) - _DISCARDED_
|
||||||
|
- Network module (UDP): `rnet` ([#753](https://github.com/raysan5/raylib/issues/753)) - _DISCARDED_ - Use [nbnet](https://github.com/nathhB/nbnet).
|
||||||
|
|
||||||
|
**raylib 3.0**
|
||||||
|
- [x] Custom memory allocators support
|
||||||
|
- [x] Global variables moved to global context
|
||||||
|
- [x] Optimize data structures for pass-by-value
|
||||||
|
- [x] Trace log messages redesign ([#1065](https://github.com/raysan5/raylib/issues/1065))
|
||||||
|
- [x] Continuous Integration using GitHub Actions
|
||||||
|
|
||||||
|
**raylib 2.5**
|
||||||
|
- [x] Support Animated models
|
||||||
|
- [x] Support glTF models file format
|
||||||
|
- [x] Unicode support on text drawing
|
||||||
|
|
||||||
|
**raylib 2.0**
|
||||||
|
- [x] Removed external dependencies (GLFW3 and OpenAL)
|
||||||
|
- [x] Support TCC compiler (32bit and 64bit)
|
||||||
|
|
||||||
|
**raylib 1.8**
|
||||||
|
- [x] Improved Materials system with PBR support
|
||||||
|
- [x] Procedural image generation functions (spot, gradient, noise...)
|
||||||
|
- [x] Procedural mesh generation functions (cube, sphere...)
|
||||||
|
- [x] Custom Android APK build pipeline (default Makefile)
|
||||||
|
|
||||||
|
**raylib 1.7**
|
||||||
|
- [x] Support configuration flags
|
||||||
|
- [x] Improved build system for Android
|
||||||
|
- [x] Gamepad support on HTML5
|
||||||
|
|
||||||
|
**raylib 1.6**
|
||||||
|
- [x] Lua scripting support (raylib Lua wrapper)
|
||||||
|
- [x] Redesigned audio module
|
||||||
|
- [x] Support FLAC file format
|
||||||
|
|
||||||
|
**raylib 1.5**
|
||||||
|
- [x] Support Oculus Rift CV1 and VR stereo rendering (simulator)
|
||||||
|
- [x] Redesign Shaders/Textures system -> New Materials system
|
||||||
|
- [x] Support lighting: Omni, Directional and Spot lights
|
||||||
|
- [x] Redesign physics module (physac)
|
||||||
|
- [x] Chiptunes audio modules support
|
||||||
|
|
||||||
|
**raylib 1.4**
|
||||||
|
- [x] TTF fonts support (using stb_truetype)
|
||||||
|
- [x] Raycast system for 3D picking (including collisions detection)
|
||||||
|
- [x] Floyd-Steinberg dithering on 16bit image format conversion
|
||||||
|
- [x] Basic image manipulation functions (crop, resize, draw...)
|
||||||
|
- [x] Storage load/save data functionality
|
||||||
|
- [x] Add Physics module (physac)
|
||||||
|
- [x] Remove GLEW dependency -> Replaced by GLAD
|
||||||
|
- [x] Redesign Raspberry PI inputs system
|
||||||
|
- [x] Redesign gestures module to be multiplatform
|
||||||
|
- [x] Module raymath as header-only and functions inline
|
||||||
|
- [x] Add Easings module (easings.h)
|
7
3party/raylib/build.zig
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
const std = @import("std");
|
||||||
|
const raylib = @import("src/build.zig");
|
||||||
|
|
||||||
|
// This has been tested to work with zig master branch as of commit 87de821 or May 14 2023
|
||||||
|
pub fn build(b: *std.Build) void {
|
||||||
|
raylib.build(b);
|
||||||
|
}
|
12
3party/raylib/cmake/AddIfFlagCompiles.cmake
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
include(CheckCCompilerFlag)
|
||||||
|
function(add_if_flag_compiles flag)
|
||||||
|
CHECK_C_COMPILER_FLAG("${flag}" COMPILER_HAS_THOSE_TOGGLES)
|
||||||
|
set(outcome "Failed")
|
||||||
|
if(COMPILER_HAS_THOSE_TOGGLES)
|
||||||
|
foreach(var ${ARGN})
|
||||||
|
set(${var} "${flag} ${${var}}" PARENT_SCOPE)
|
||||||
|
endforeach()
|
||||||
|
set(outcome "compiles")
|
||||||
|
endif()
|
||||||
|
message(STATUS "Testing if ${flag} can be used -- ${outcome}")
|
||||||
|
endfunction()
|
18
3party/raylib/cmake/BuildOptions.cmake
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
if(${PLATFORM} MATCHES "Desktop" AND APPLE)
|
||||||
|
if(MACOS_FATLIB)
|
||||||
|
if (CMAKE_OSX_ARCHITECTURES)
|
||||||
|
message(FATAL_ERROR "User supplied -DCMAKE_OSX_ARCHITECTURES overrides -DMACOS_FATLIB=ON")
|
||||||
|
else()
|
||||||
|
set(CMAKE_OSX_ARCHITECTURES "x86_64;i386")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# This helps support the case where emsdk toolchain file is used
|
||||||
|
# either by setting it with -DCMAKE_TOOLCHAIN_FILE=<path_to_emsdk>/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake
|
||||||
|
# or by using "emcmake cmake -B build -S ." as described in https://emscripten.org/docs/compiling/Building-Projects.html
|
||||||
|
if(EMSCRIPTEN)
|
||||||
|
SET(PLATFORM Web CACHE STRING "Forcing PLATFORM_WEB because EMSCRIPTEN was detected")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# vim: ft=cmake
|
121
3party/raylib/cmake/CompileDefinitions.cmake
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
# Adding compile definitions
|
||||||
|
target_compile_definitions("raylib" PUBLIC "${PLATFORM_CPP}")
|
||||||
|
target_compile_definitions("raylib" PUBLIC "${GRAPHICS}")
|
||||||
|
|
||||||
|
function(define_if target variable)
|
||||||
|
if (${${variable}})
|
||||||
|
message(STATUS "${variable}=${${variable}}")
|
||||||
|
target_compile_definitions(${target} PUBLIC "${variable}")
|
||||||
|
endif ()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
if (${CUSTOMIZE_BUILD})
|
||||||
|
target_compile_definitions("raylib" PUBLIC EXTERNAL_CONFIG_FLAGS)
|
||||||
|
define_if("raylib" USE_AUDIO)
|
||||||
|
define_if("raylib" SUPPORT_MODULE_RSHAPES)
|
||||||
|
define_if("raylib" SUPPORT_MODULE_RTEXTURES)
|
||||||
|
define_if("raylib" SUPPORT_MODULE_RTEXT)
|
||||||
|
define_if("raylib" SUPPORT_MODULE_RMODELS)
|
||||||
|
define_if("raylib" SUPPORT_MODULE_RAUDIO)
|
||||||
|
define_if("raylib" SUPPORT_CAMERA_SYSTEM)
|
||||||
|
define_if("raylib" SUPPORT_GESTURES_SYSTEM)
|
||||||
|
define_if("raylib" SUPPORT_MOUSE_GESTURES)
|
||||||
|
define_if("raylib" SUPPORT_SSH_KEYBOARD_RPI)
|
||||||
|
define_if("raylib" SUPPORT_DEFAULT_FONT)
|
||||||
|
define_if("raylib" SUPPORT_SCREEN_CAPTURE)
|
||||||
|
define_if("raylib" SUPPORT_GIF_RECORDING)
|
||||||
|
define_if("raylib" SUPPORT_BUSY_WAIT_LOOP)
|
||||||
|
define_if("raylib" SUPPORT_EVENTS_WAITING)
|
||||||
|
define_if("raylib" SUPPORT_WINMM_HIGHRES_TIMER)
|
||||||
|
define_if("raylib" SUPPORT_COMPRESSION_API)
|
||||||
|
define_if("raylib" SUPPORT_EVENTS_AUTOMATION)
|
||||||
|
define_if("raylib" SUPPORT_CUSTOM_FRAME_CONTROL)
|
||||||
|
define_if("raylib" SUPPORT_QUADS_DRAW_MODE)
|
||||||
|
define_if("raylib" SUPPORT_IMAGE_EXPORT)
|
||||||
|
define_if("raylib" SUPPORT_IMAGE_GENERATION)
|
||||||
|
define_if("raylib" SUPPORT_IMAGE_MANIPULATION)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_PNG)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_DDS)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_HDR)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_PIC)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_PNM)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_KTX)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_ASTC)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_BMP)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_TGA)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_JPG)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_GIF)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_QOI)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_PSD)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_PKM)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_PVR)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_SVG)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_FNT)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_TTF)
|
||||||
|
define_if("raylib" SUPPORT_TEXT_MANIPULATION)
|
||||||
|
define_if("raylib" SUPPORT_MESH_GENERATION)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_OBJ)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_MTL)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_IQM)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_GLTF)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_VOX)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_M3D)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_WAV)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_OGG)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_XM)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_MOD)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_MP3)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_QOA)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_FLAC)
|
||||||
|
define_if("raylib" SUPPORT_STANDARD_FILEIO)
|
||||||
|
define_if("raylib" SUPPORT_TRACELOG)
|
||||||
|
|
||||||
|
if (UNIX AND NOT APPLE)
|
||||||
|
target_compile_definitions("raylib" PUBLIC "MAX_FILEPATH_LENGTH=4096")
|
||||||
|
else ()
|
||||||
|
target_compile_definitions("raylib" PUBLIC "MAX_FILEPATH_LENGTH=512")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
target_compile_definitions("raylib" PUBLIC "MAX_GAMEPADS=4")
|
||||||
|
target_compile_definitions("raylib" PUBLIC "MAX_GAMEPAD_AXIS=8")
|
||||||
|
target_compile_definitions("raylib" PUBLIC "MAX_GAMEPAD_BUTTONS=32")
|
||||||
|
target_compile_definitions("raylib" PUBLIC "MAX_TOUCH_POINTS=10")
|
||||||
|
target_compile_definitions("raylib" PUBLIC "MAX_KEY_PRESSED_QUEUE=16")
|
||||||
|
|
||||||
|
target_compile_definitions("raylib" PUBLIC "STORAGE_DATA_FILE=\"storage.data\"")
|
||||||
|
target_compile_definitions("raylib" PUBLIC "MAX_CHAR_PRESSED_QUEUE=16")
|
||||||
|
target_compile_definitions("raylib" PUBLIC "MAX_DECOMPRESSION_SIZE=64")
|
||||||
|
|
||||||
|
if (${GRAPHICS} MATCHES "GRAPHICS_API_OPENGL_33" OR ${GRAPHICS} MATCHES "GRAPHICS_API_OPENGL_11")
|
||||||
|
target_compile_definitions("raylib" PUBLIC "DEFAULT_BATCH_BUFFER_ELEMENTS=8192")
|
||||||
|
elseif (${GRAPHICS} MATCHES "GRAPHICS_API_OPENGL_ES2")
|
||||||
|
target_compile_definitions("raylib" PUBLIC "DEFAULT_BATCH_BUFFER_ELEMENTS=2048")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
target_compile_definitions("raylib" PUBLIC "DEFAULT_BATCH_DRAWCALLS=256")
|
||||||
|
target_compile_definitions("raylib" PUBLIC "MAX_MATRIX_STACK_SIZE=32")
|
||||||
|
target_compile_definitions("raylib" PUBLIC "MAX_SHADER_LOCATIONS=32")
|
||||||
|
target_compile_definitions("raylib" PUBLIC "MAX_MATERIAL_MAPS=12")
|
||||||
|
target_compile_definitions("raylib" PUBLIC "RL_CULL_DISTANCE_NEAR=0.01")
|
||||||
|
target_compile_definitions("raylib" PUBLIC "RL_CULL_DISTANCE_FAR=1000.0")
|
||||||
|
|
||||||
|
target_compile_definitions("raylib" PUBLIC "DEFAULT_SHADER_ATTRIB_NAME_POSITION=\"vertexPosition\"")
|
||||||
|
target_compile_definitions("raylib" PUBLIC "DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD=\"vertexTexCoord\"")
|
||||||
|
target_compile_definitions("raylib" PUBLIC "DEFAULT_SHADER_ATTRIB_NAME_NORMAL=\"vertexNormal\"")
|
||||||
|
target_compile_definitions("raylib" PUBLIC "DEFAULT_SHADER_ATTRIB_NAME_COLOR=\"vertexColor\"")
|
||||||
|
target_compile_definitions("raylib" PUBLIC "DEFAULT_SHADER_ATTRIB_NAME_TANGENT=\"vertexTangent\"")
|
||||||
|
target_compile_definitions("raylib" PUBLIC "DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2=\"vertexTexCoord2\"")
|
||||||
|
|
||||||
|
target_compile_definitions("raylib" PUBLIC "MAX_TEXT_BUFFER_LENGTH=1024")
|
||||||
|
target_compile_definitions("raylib" PUBLIC "MAX_TEXT_UNICODE_CHARS=512")
|
||||||
|
target_compile_definitions("raylib" PUBLIC "MAX_TEXTSPLIT_COUNT=128")
|
||||||
|
|
||||||
|
target_compile_definitions("raylib" PUBLIC "AUDIO_DEVICE_FORMAT=ma_format_f32")
|
||||||
|
target_compile_definitions("raylib" PUBLIC "AUDIO_DEVICE_CHANNELS=2")
|
||||||
|
target_compile_definitions("raylib" PUBLIC "AUDIO_DEVICE_SAMPLE_RATE=44100")
|
||||||
|
target_compile_definitions("raylib" PUBLIC "DEFAULT_AUDIO_BUFFER_SIZE=4096")
|
||||||
|
|
||||||
|
target_compile_definitions("raylib" PUBLIC "MAX_TRACELOG_MSG_LENGTH=128")
|
||||||
|
target_compile_definitions("raylib" PUBLIC "MAX_UWP_MESSAGES=512")
|
||||||
|
endif ()
|
||||||
|
|
79
3party/raylib/cmake/CompilerFlags.cmake
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
include(AddIfFlagCompiles)
|
||||||
|
|
||||||
|
# Makes +/- operations on void pointers be considered an error
|
||||||
|
# https://gcc.gnu.org/onlinedocs/gcc/Pointer-Arith.html
|
||||||
|
add_if_flag_compiles(-Werror=pointer-arith CMAKE_C_FLAGS)
|
||||||
|
|
||||||
|
# Generates error whenever a function is used before being declared
|
||||||
|
# https://gcc.gnu.org/onlinedocs/gcc-4.0.1/gcc/Warning-Options.html
|
||||||
|
add_if_flag_compiles(-Werror=implicit-function-declaration CMAKE_C_FLAGS)
|
||||||
|
|
||||||
|
# Allows some casting of pointers without generating a warning
|
||||||
|
add_if_flag_compiles(-fno-strict-aliasing CMAKE_C_FLAGS)
|
||||||
|
|
||||||
|
if (ENABLE_MSAN AND ENABLE_ASAN)
|
||||||
|
# MSAN and ASAN both work on memory - ASAN does more things
|
||||||
|
MESSAGE(WARNING "Compiling with both AddressSanitizer and MemorySanitizer is not recommended")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (ENABLE_ASAN)
|
||||||
|
|
||||||
|
# If enabled it would generate errors/warnings for all kinds of memory errors
|
||||||
|
# (like returning a stack variable by reference)
|
||||||
|
# https://clang.llvm.org/docs/AddressSanitizer.html
|
||||||
|
|
||||||
|
add_if_flag_compiles(-fno-omit-frame-pointer CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
|
||||||
|
add_if_flag_compiles(-fsanitize=address CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (ENABLE_UBSAN)
|
||||||
|
|
||||||
|
# If enabled this will generate errors for undefined behavior points
|
||||||
|
# (like adding +1 to the maximum int value)
|
||||||
|
# https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
|
||||||
|
|
||||||
|
add_if_flag_compiles(-fno-omit-frame-pointer CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
|
||||||
|
add_if_flag_compiles(-fsanitize=undefined CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (ENABLE_MSAN)
|
||||||
|
|
||||||
|
# If enabled this will generate warnings for places where uninitialized memory is used
|
||||||
|
# https://clang.llvm.org/docs/MemorySanitizer.html
|
||||||
|
|
||||||
|
add_if_flag_compiles(-fno-omit-frame-pointer CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
|
||||||
|
add_if_flag_compiles(-fsanitize=memory CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_VERSION VERSION_LESS "3.1")
|
||||||
|
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||||
|
add_if_flag_compiles(-std=gnu99 CMAKE_C_FLAGS)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set (CMAKE_C_STANDARD 99)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(${PLATFORM} MATCHES "Android")
|
||||||
|
|
||||||
|
# If enabled will remove dead code during the linking process
|
||||||
|
# https://gcc.gnu.org/onlinedocs/gnat_ugn/Compilation-options.html
|
||||||
|
add_if_flag_compiles(-ffunction-sections CMAKE_C_FLAGS)
|
||||||
|
|
||||||
|
# If enabled will generate some exception data (usually disabled for C programs)
|
||||||
|
# https://gcc.gnu.org/onlinedocs/gcc-4.2.4/gcc/Code-Gen-Options.html
|
||||||
|
add_if_flag_compiles(-funwind-tables CMAKE_C_FLAGS)
|
||||||
|
|
||||||
|
# If enabled adds stack protection guards around functions that allocate memory
|
||||||
|
# https://www.keil.com/support/man/docs/armclang_ref/armclang_ref_cjh1548250046139.htm
|
||||||
|
add_if_flag_compiles(-fstack-protector-strong CMAKE_C_FLAGS)
|
||||||
|
|
||||||
|
# Marks that the library will not be compiled with an executable stack
|
||||||
|
add_if_flag_compiles(-Wa,--noexecstack CMAKE_C_FLAGS)
|
||||||
|
|
||||||
|
# Do not expand symbolic links or resolve paths like "/./" or "/../", etc.
|
||||||
|
# https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html
|
||||||
|
add_if_flag_compiles(-no-canonical-prefixes CMAKE_C_FLAGS)
|
||||||
|
endif()
|
9
3party/raylib/cmake/EnumOption.cmake
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
macro(enum_option var values description)
|
||||||
|
set(${var}_VALUES ${values})
|
||||||
|
list(GET ${var}_VALUES 0 default)
|
||||||
|
set(${var} "${default}" CACHE STRING "${description}")
|
||||||
|
set_property(CACHE ${var} PROPERTY STRINGS ${${var}_VALUES})
|
||||||
|
if (NOT ";${${var}_VALUES};" MATCHES ";${${var}};")
|
||||||
|
message(FATAL_ERROR "Unknown value ${${var}}. Only -D${var}=${${var}_VALUES} allowed.")
|
||||||
|
endif()
|
||||||
|
endmacro()
|
36
3party/raylib/cmake/GlfwImport.cmake
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
|
||||||
|
if(USE_EXTERNAL_GLFW STREQUAL "ON")
|
||||||
|
find_package(glfw3 3.3.3 REQUIRED)
|
||||||
|
elseif(USE_EXTERNAL_GLFW STREQUAL "IF_POSSIBLE")
|
||||||
|
find_package(glfw3 3.3.3 QUIET)
|
||||||
|
endif()
|
||||||
|
if (glfw3_FOUND)
|
||||||
|
set(LIBS_PRIVATE ${LIBS_PRIVATE} glfw)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Explicitly check against "ON", because USE_EXTERNAL_GLFW is a tristate option
|
||||||
|
# Also adding only on desktop (web also uses glfw but it is more limited and is added using an emcc linker flag)
|
||||||
|
if(NOT glfw3_FOUND AND NOT USE_EXTERNAL_GLFW STREQUAL "ON" AND "${PLATFORM}" MATCHES "Desktop")
|
||||||
|
MESSAGE(STATUS "Using raylib's GLFW")
|
||||||
|
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
|
||||||
|
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
||||||
|
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
||||||
|
set(GLFW_INSTALL OFF CACHE BOOL "" FORCE)
|
||||||
|
set(GLFW_USE_WAYLAND ${USE_WAYLAND} CACHE BOOL "" FORCE)
|
||||||
|
|
||||||
|
set(WAS_SHARED ${BUILD_SHARED_LIBS})
|
||||||
|
set(BUILD_SHARED_LIBS OFF CACHE BOOL " " FORCE)
|
||||||
|
|
||||||
|
add_subdirectory(external/glfw)
|
||||||
|
|
||||||
|
set(BUILD_SHARED_LIBS ${WAS_SHARED} CACHE BOOL " " FORCE)
|
||||||
|
unset(WAS_SHARED)
|
||||||
|
|
||||||
|
list(APPEND raylib_sources $<TARGET_OBJECTS:glfw>)
|
||||||
|
include_directories(BEFORE SYSTEM external/glfw/include)
|
||||||
|
elseif("${PLATFORM}" STREQUAL "DRM")
|
||||||
|
MESSAGE(STATUS "No GLFW required on PLATFORM_DRM")
|
||||||
|
else()
|
||||||
|
MESSAGE(STATUS "Using external GLFW")
|
||||||
|
set(GLFW_PKG_DEPS glfw3)
|
||||||
|
endif()
|
28
3party/raylib/cmake/InstallConfigurations.cmake
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
install(
|
||||||
|
TARGETS raylib EXPORT raylib-targets
|
||||||
|
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||||
|
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||||
|
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||||
|
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
|
||||||
|
)
|
||||||
|
|
||||||
|
# PKG_CONFIG_LIBS_PRIVATE is used in raylib.pc.in
|
||||||
|
if (NOT BUILD_SHARED_LIBS)
|
||||||
|
include(LibraryPathToLinkerFlags)
|
||||||
|
set(PKG_CONFIG_LIBS_PRIVATE ${GLFW_PKG_LIBS})
|
||||||
|
string(REPLACE ";" " " PKG_CONFIG_LIBS_PRIVATE "${PKG_CONFIG_LIBS_PRIVATE}")
|
||||||
|
elseif (BUILD_SHARED_LIBS)
|
||||||
|
set(PKG_CONFIG_LIBS_EXTRA "")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
join_paths(libdir_for_pc_file "\${exec_prefix}" "${CMAKE_INSTALL_LIBDIR}")
|
||||||
|
join_paths(includedir_for_pc_file "\${prefix}" "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||||
|
configure_file(../raylib.pc.in raylib.pc @ONLY)
|
||||||
|
configure_file(../cmake/raylib-config-version.cmake raylib-config-version.cmake @ONLY)
|
||||||
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/raylib.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
||||||
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/raylib-config-version.cmake DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/raylib")
|
||||||
|
install(FILES ${PROJECT_SOURCE_DIR}/../cmake/raylib-config.cmake DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/raylib")
|
||||||
|
|
||||||
|
# populates raylib_{FOUND, INCLUDE_DIRS, LIBRARIES, LDFLAGS, DEFINITIONS}
|
||||||
|
include(PopulateConfigVariablesLocally)
|
||||||
|
populate_config_variables_locally(raylib)
|
26
3party/raylib/cmake/JoinPaths.cmake
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
# This module provides function for joining paths
|
||||||
|
# known from most languages
|
||||||
|
#
|
||||||
|
# Original license:
|
||||||
|
# SPDX-License-Identifier: (MIT OR CC0-1.0)
|
||||||
|
# Explicit permission given to distribute this module under
|
||||||
|
# the terms of the project as described in /LICENSE.rst.
|
||||||
|
# Copyright 2020 Jan Tojnar
|
||||||
|
# https://github.com/jtojnar/cmake-snips
|
||||||
|
#
|
||||||
|
# Modelled after Python’s os.path.join
|
||||||
|
# https://docs.python.org/3.7/library/os.path.html#os.path.join
|
||||||
|
# Windows not supported
|
||||||
|
function(join_paths joined_path first_path_segment)
|
||||||
|
set(temp_path "${first_path_segment}")
|
||||||
|
foreach(current_segment IN LISTS ARGN)
|
||||||
|
if(NOT ("${current_segment}" STREQUAL ""))
|
||||||
|
if(IS_ABSOLUTE "${current_segment}")
|
||||||
|
set(temp_path "${current_segment}")
|
||||||
|
else()
|
||||||
|
set(temp_path "${temp_path}/${current_segment}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
set(${joined_path} "${temp_path}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
122
3party/raylib/cmake/LibraryConfigurations.cmake
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
# Set OpenGL_GL_PREFERENCE to new "GLVND" even when legacy library exists and
|
||||||
|
# cmake is <= 3.10
|
||||||
|
#
|
||||||
|
# See https://cmake.org/cmake/help/latest/policy/CMP0072.html for more
|
||||||
|
# information.
|
||||||
|
if(POLICY CMP0072)
|
||||||
|
cmake_policy(SET CMP0072 NEW)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (${PLATFORM} MATCHES "Desktop")
|
||||||
|
set(PLATFORM_CPP "PLATFORM_DESKTOP")
|
||||||
|
|
||||||
|
if (APPLE)
|
||||||
|
# Need to force OpenGL 3.3 on OS X
|
||||||
|
# See: https://github.com/raysan5/raylib/issues/341
|
||||||
|
set(GRAPHICS "GRAPHICS_API_OPENGL_33")
|
||||||
|
find_library(OPENGL_LIBRARY OpenGL)
|
||||||
|
set(LIBS_PRIVATE ${OPENGL_LIBRARY})
|
||||||
|
link_libraries("${LIBS_PRIVATE}")
|
||||||
|
if (NOT CMAKE_SYSTEM STRLESS "Darwin-18.0.0")
|
||||||
|
add_definitions(-DGL_SILENCE_DEPRECATION)
|
||||||
|
MESSAGE(AUTHOR_WARNING "OpenGL is deprecated starting with macOS 10.14 (Mojave)!")
|
||||||
|
endif ()
|
||||||
|
elseif (WIN32)
|
||||||
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||||
|
find_package(OpenGL QUIET)
|
||||||
|
set(LIBS_PRIVATE ${OPENGL_LIBRARIES} winmm)
|
||||||
|
elseif (UNIX)
|
||||||
|
find_library(pthread NAMES pthread)
|
||||||
|
find_package(OpenGL QUIET)
|
||||||
|
if ("${OPENGL_LIBRARIES}" STREQUAL "")
|
||||||
|
set(OPENGL_LIBRARIES "GL")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if ("${CMAKE_SYSTEM_NAME}" MATCHES "(Net|Open)BSD")
|
||||||
|
find_library(OSS_LIBRARY ossaudio)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
set(LIBS_PRIVATE m pthread ${OPENGL_LIBRARIES} ${OSS_LIBRARY})
|
||||||
|
else ()
|
||||||
|
find_library(pthread NAMES pthread)
|
||||||
|
find_package(OpenGL QUIET)
|
||||||
|
if ("${OPENGL_LIBRARIES}" STREQUAL "")
|
||||||
|
set(OPENGL_LIBRARIES "GL")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
set(LIBS_PRIVATE m atomic pthread ${OPENGL_LIBRARIES} ${OSS_LIBRARY})
|
||||||
|
|
||||||
|
if ("${CMAKE_SYSTEM_NAME}" MATCHES "(Net|Open)BSD")
|
||||||
|
find_library(OSS_LIBRARY ossaudio)
|
||||||
|
set(LIBS_PRIVATE m pthread ${OPENGL_LIBRARIES} ${OSS_LIBRARY})
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if (NOT "${CMAKE_SYSTEM_NAME}" MATCHES "(Net|Open)BSD" AND USE_AUDIO)
|
||||||
|
set(LIBS_PRIVATE ${LIBS_PRIVATE} dl)
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
elseif (${PLATFORM} MATCHES "Web")
|
||||||
|
set(PLATFORM_CPP "PLATFORM_WEB")
|
||||||
|
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s USE_GLFW=3 -s ASSERTIONS=1 --profiling")
|
||||||
|
set(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
|
||||||
|
|
||||||
|
elseif (${PLATFORM} MATCHES "Android")
|
||||||
|
set(PLATFORM_CPP "PLATFORM_ANDROID")
|
||||||
|
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
|
||||||
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||||
|
list(APPEND raylib_sources ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
|
||||||
|
include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--exclude-libs,libatomic.a -Wl,--build-id -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings -u ANativeActivity_onCreate -Wl,-undefined,dynamic_lookup")
|
||||||
|
|
||||||
|
find_library(OPENGL_LIBRARY OpenGL)
|
||||||
|
set(LIBS_PRIVATE m log android EGL GLESv2 OpenSLES atomic c)
|
||||||
|
|
||||||
|
elseif ("${PLATFORM}" MATCHES "DRM")
|
||||||
|
set(PLATFORM_CPP "PLATFORM_DRM")
|
||||||
|
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
|
||||||
|
|
||||||
|
add_definitions(-D_DEFAULT_SOURCE)
|
||||||
|
add_definitions(-DEGL_NO_X11)
|
||||||
|
add_definitions(-DPLATFORM_DRM)
|
||||||
|
|
||||||
|
find_library(GLESV2 GLESv2)
|
||||||
|
find_library(EGL EGL)
|
||||||
|
find_library(DRM drm)
|
||||||
|
find_library(GBM gbm)
|
||||||
|
|
||||||
|
if (NOT CMAKE_CROSSCOMPILING)
|
||||||
|
include_directories(/usr/include/libdrm)
|
||||||
|
endif ()
|
||||||
|
set(LIBS_PRIVATE ${GLESV2} ${EGL} ${DRM} ${GBM} atomic pthread m dl)
|
||||||
|
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if (NOT ${OPENGL_VERSION} MATCHES "OFF")
|
||||||
|
set(${SUGGESTED_GRAPHICS} "${GRAPHICS}")
|
||||||
|
if (${OPENGL_VERSION} MATCHES "4.3")
|
||||||
|
set(GRAPHICS "GRAPHICS_API_OPENGL_43")
|
||||||
|
elseif (${OPENGL_VERSION} MATCHES "3.3")
|
||||||
|
set(GRAPHICS "GRAPHICS_API_OPENGL_33")
|
||||||
|
elseif (${OPENGL_VERSION} MATCHES "2.1")
|
||||||
|
set(GRAPHICS "GRAPHICS_API_OPENGL_21")
|
||||||
|
elseif (${OPENGL_VERSION} MATCHES "1.1")
|
||||||
|
set(GRAPHICS "GRAPHICS_API_OPENGL_11")
|
||||||
|
elseif (${OPENGL_VERSION} MATCHES "ES 2.0")
|
||||||
|
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
|
||||||
|
endif ()
|
||||||
|
if ("${SUGGESTED_GRAPHICS}" AND NOT "${SUGGESTED_GRAPHICS}" STREQUAL "${GRAPHICS}")
|
||||||
|
message(WARNING "You are overriding the suggested GRAPHICS=${SUGGESTED_GRAPHICS} with ${GRAPHICS}! This may fail")
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if (NOT GRAPHICS)
|
||||||
|
set(GRAPHICS "GRAPHICS_API_OPENGL_33")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
set(LIBS_PRIVATE ${LIBS_PRIVATE} ${OPENAL_LIBRARY})
|
||||||
|
|
||||||
|
if (${PLATFORM} MATCHES "Desktop")
|
||||||
|
set(LIBS_PRIVATE ${LIBS_PRIVATE} glfw)
|
||||||
|
endif ()
|
24
3party/raylib/cmake/LibraryPathToLinkerFlags.cmake
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
function(library_path_to_linker_flags LD_FLAGS LIB_PATHS)
|
||||||
|
foreach(L ${LIB_PATHS})
|
||||||
|
get_filename_component(DIR ${L} PATH)
|
||||||
|
get_filename_component(LIBFILE ${L} NAME_WE)
|
||||||
|
STRING(REGEX REPLACE "^lib" "" FILE ${LIBFILE})
|
||||||
|
|
||||||
|
if (${L} MATCHES "[.]framework$")
|
||||||
|
set(FILE_OPT "-framework ${FILE}")
|
||||||
|
set(DIR_OPT "-F${DIR}")
|
||||||
|
else()
|
||||||
|
set(FILE_OPT "-l${FILE}")
|
||||||
|
set(DIR_OPT "-L${DIR}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if ("${DIR}" STREQUAL "" OR "${DIR}" STREQUAL "${LASTDIR}")
|
||||||
|
set (DIR_OPT "")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(LASTDIR ${DIR})
|
||||||
|
|
||||||
|
set(${LD_FLAGS} ${${LD_FLAGS}} ${DIR_OPT} ${FILE_OPT} PARENT_SCOPE)
|
||||||
|
string (REPLACE ";" " " ${LD_FLAGS} "${${LD_FLAGS}}")
|
||||||
|
endforeach()
|
||||||
|
endfunction()
|
18
3party/raylib/cmake/PackConfigurations.cmake
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# Packaging
|
||||||
|
SET(CPACK_PACKAGE_NAME "raylib")
|
||||||
|
SET(CPACK_PACKAGE_CONTACT "raysan5")
|
||||||
|
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Simple and easy-to-use library to enjoy videogames programming")
|
||||||
|
SET(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
|
||||||
|
SET(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
|
||||||
|
SET(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
|
||||||
|
SET(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
|
||||||
|
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/../README.md")
|
||||||
|
SET(CPACK_RESOURCE_FILE_WELCOME "${PROJECT_SOURCE_DIR}/../README.md")
|
||||||
|
SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/../LICENSE")
|
||||||
|
SET(CPACK_PACKAGE_FILE_NAME "raylib-${PROJECT_VERSION}$ENV{RAYLIB_PACKAGE_SUFFIX}")
|
||||||
|
SET(CPACK_GENERATOR "ZIP;TGZ;DEB;RPM") # Remove this, if you want the NSIS installer on Windows
|
||||||
|
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) # can be used to generate deps, slow and requires tools.
|
||||||
|
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libatomic1, libc6, libglfw3, libglu1-mesa | libglu1, libglx0, libopengl0")
|
||||||
|
SET(CPACK_DEBIAN_PACKAGE_NAME "lib${CPACK_PACKAGE_NAME}-dev")
|
||||||
|
SET(CPACK_RPM_PACKAGE_NAME "lib${CPACK_PACKAGE_NAME}-devel")
|
||||||
|
include(CPack)
|
11
3party/raylib/cmake/PopulateConfigVariablesLocally.cmake
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
macro(populate_config_variables_locally target)
|
||||||
|
get_property(raylib_INCLUDE_DIRS TARGET ${target} PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
|
||||||
|
#get_property(raylib_LIBRARIES TARGET ${target} PROPERTY LOCATION) # only works for SHARED
|
||||||
|
get_property(raylib_LDFLAGS TARGET ${target} PROPERTY INTERFACE_LINK_LIBRARIES)
|
||||||
|
get_property(raylib_DEFINITIONS TARGET ${target} PROPERTY DEFINITIONS)
|
||||||
|
|
||||||
|
set(raylib_INCLUDE_DIRS "${raylib_INCLUDE_DIRS}" PARENT_SCOPE)
|
||||||
|
#set(raylib_LIBRARIES "${raylib_INCLUDE_DIRS}" PARENT_SCOPE)
|
||||||
|
set(raylib_LDFLAGS "${raylib_LDFLAGS}" PARENT_SCOPE)
|
||||||
|
set(raylib_DEFINITIONS "${raylib_DEFINITIONS}" PARENT_SCOPE)
|
||||||
|
endmacro()
|
21
3party/raylib/cmake/raylib-config-version.cmake
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
set(PACKAGE_VERSION "@PROJECT_VERSION@")
|
||||||
|
|
||||||
|
if(PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION)
|
||||||
|
set(PACKAGE_VERSION_EXACT TRUE)
|
||||||
|
endif()
|
||||||
|
if(NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION)
|
||||||
|
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||||
|
else(NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION)
|
||||||
|
set(PACKAGE_VERSION_UNSUITABLE TRUE)
|
||||||
|
endif(NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION)
|
||||||
|
|
||||||
|
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
|
||||||
|
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@CMAKE_SIZEOF_VOID_P@")
|
||||||
|
math(EXPR installedBits "8 * 8")
|
||||||
|
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
|
||||||
|
set(PACKAGE_VERSION_UNSUITABLE TRUE)
|
||||||
|
endif()
|
79
3party/raylib/cmake/raylib-config.cmake
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
# - Try to find raylib
|
||||||
|
# Options:
|
||||||
|
# raylib_USE_STATIC_LIBS - OFF by default
|
||||||
|
# raylib_VERBOSE - OFF by default
|
||||||
|
# Once done, this defines a raylib target that can be passed to
|
||||||
|
# target_link_libraries as well as following variables:
|
||||||
|
#
|
||||||
|
# raylib_FOUND - System has raylib installed
|
||||||
|
# raylib_INCLUDE_DIRS - The include directories for the raylib header(s)
|
||||||
|
# raylib_LIBRARIES - The libraries needed to use raylib
|
||||||
|
# raylib_LDFLAGS - The linker flags needed with raylib
|
||||||
|
# raylib_DEFINITIONS - Compiler switches required for using raylib
|
||||||
|
|
||||||
|
if (NOT TARGET raylib)
|
||||||
|
set(XPREFIX PC_RAYLIB)
|
||||||
|
|
||||||
|
find_package(PkgConfig QUIET)
|
||||||
|
pkg_check_modules(${XPREFIX} QUIET raylib)
|
||||||
|
|
||||||
|
if (raylib_USE_STATIC_LIBS)
|
||||||
|
set(XPREFIX ${XPREFIX}_STATIC)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(raylib_DEFINITIONS ${${XPREFIX}_CFLAGS})
|
||||||
|
|
||||||
|
find_path(raylib_INCLUDE_DIR
|
||||||
|
NAMES raylib.h
|
||||||
|
HINTS ${${XPREFIX}_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
set(RAYLIB_NAMES raylib)
|
||||||
|
|
||||||
|
if (raylib_USE_STATIC_LIBS)
|
||||||
|
set(RAYLIB_NAMES libraylib.a raylib.lib ${RAYLIB_NAMES})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_library(raylib_LIBRARY
|
||||||
|
NAMES ${RAYLIB_NAMES}
|
||||||
|
HINTS ${${XPREFIX}_LIBRARY_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
set(raylib_LIBRARIES ${raylib_LIBRARY})
|
||||||
|
set(raylib_LIBRARY_DIRS ${${XPREFIX}_LIBRARY_DIRS})
|
||||||
|
set(raylib_LIBRARY_DIR ${raylib_LIBRARY_DIRS})
|
||||||
|
set(raylib_INCLUDE_DIRS ${raylib_INCLUDE_DIR})
|
||||||
|
set(raylib_LDFLAGS ${${XPREFIX}_LDFLAGS})
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(raylib DEFAULT_MSG
|
||||||
|
raylib_LIBRARY
|
||||||
|
raylib_INCLUDE_DIR
|
||||||
|
)
|
||||||
|
|
||||||
|
mark_as_advanced(raylib_LIBRARY raylib_INCLUDE_DIR)
|
||||||
|
|
||||||
|
if (raylib_USE_STATIC_LIBS)
|
||||||
|
add_library(raylib STATIC IMPORTED GLOBAL)
|
||||||
|
else()
|
||||||
|
add_library(raylib SHARED IMPORTED GLOBAL)
|
||||||
|
endif()
|
||||||
|
string (REPLACE ";" " " raylib_LDFLAGS "${raylib_LDFLAGS}")
|
||||||
|
|
||||||
|
set_target_properties(raylib
|
||||||
|
PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${raylib_LIBRARIES}"
|
||||||
|
IMPORTED_IMPLIB "${raylib_LIBRARIES}"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${raylib_INCLUDE_DIRS}"
|
||||||
|
INTERFACE_LINK_LIBRARIES "${raylib_LDFLAGS}"
|
||||||
|
INTERFACE_COMPILE_OPTIONS "${raylib_DEFINITIONS}"
|
||||||
|
)
|
||||||
|
|
||||||
|
if (raylib_VERBOSE)
|
||||||
|
message(STATUS "raylib_FOUND: ${raylib_FOUND}")
|
||||||
|
message(STATUS "raylib_INCLUDE_DIRS: ${raylib_INCLUDE_DIRS}")
|
||||||
|
message(STATUS "raylib_LIBRARIES: ${raylib_LIBRARIES}")
|
||||||
|
message(STATUS "raylib_LDFLAGS: ${raylib_LDFLAGS}")
|
||||||
|
message(STATUS "raylib_DEFINITIONS: ${raylib_DEFINITIONS}")
|
||||||
|
endif()
|
||||||
|
endif()
|
BIN
3party/raylib/logo/raylib.ico
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
3party/raylib/logo/raylib_128x128.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
3party/raylib/logo/raylib_144x144.png
Normal file
After Width: | Height: | Size: 422 B |
BIN
3party/raylib/logo/raylib_16x16.png
Normal file
After Width: | Height: | Size: 256 B |
BIN
3party/raylib/logo/raylib_180x180.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
3party/raylib/logo/raylib_24x24.png
Normal file
After Width: | Height: | Size: 346 B |
BIN
3party/raylib/logo/raylib_256x256.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
3party/raylib/logo/raylib_32x32.png
Normal file
After Width: | Height: | Size: 515 B |
BIN
3party/raylib/logo/raylib_36x36.png
Normal file
After Width: | Height: | Size: 319 B |
BIN
3party/raylib/logo/raylib_48x48.png
Normal file
After Width: | Height: | Size: 885 B |
BIN
3party/raylib/logo/raylib_512x512.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
3party/raylib/logo/raylib_64x64.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
3party/raylib/logo/raylib_72x72.png
Normal file
After Width: | Height: | Size: 344 B |
BIN
3party/raylib/logo/raylib_96x96.png
Normal file
After Width: | Height: | Size: 714 B |
BIN
3party/raylib/logo/raylib_logo_animation.gif
Normal file
After Width: | Height: | Size: 41 KiB |
16
3party/raylib/parser/LICENSE
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
Copyright (c) 2021-2023 Ramon Santamaria (@raysan5)
|
||||||
|
|
||||||
|
This software is provided "as-is", without any express or implied warranty. In no event
|
||||||
|
will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|
||||||
|
Permission is granted to anyone to use this software for any purpose, including commercial
|
||||||
|
applications, and to alter it and redistribute it freely, subject to the following restrictions:
|
||||||
|
|
||||||
|
1. The origin of this software must not be misrepresented; you must not claim that you
|
||||||
|
wrote the original software. If you use this software in a product, an acknowledgment
|
||||||
|
in the product documentation would be appreciated but is not required.
|
||||||
|
|
||||||
|
2. Altered source versions must be plainly marked as such, and must not be misrepresented
|
||||||
|
as being the original software.
|
||||||
|
|
||||||
|
3. This notice may not be removed or altered from any source distribution.
|
50
3party/raylib/parser/Makefile
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
EXTENSION?=txt
|
||||||
|
FORMAT?=DEFAULT
|
||||||
|
.PHONY: all parse clean raylib_api
|
||||||
|
|
||||||
|
|
||||||
|
raylib_parser: raylib_parser.c
|
||||||
|
cc raylib_parser.c -o raylib_parser
|
||||||
|
|
||||||
|
raylib_api: ../src/raylib.h raylib_parser
|
||||||
|
FORMAT=DEFAULT EXTENSION=txt $(MAKE) raylib_api.txt
|
||||||
|
FORMAT=JSON EXTENSION=json $(MAKE) raylib_api.json
|
||||||
|
FORMAT=XML EXTENSION=xml $(MAKE) raylib_api.xml
|
||||||
|
FORMAT=LUA EXTENSION=lua $(MAKE) raylib_api.lua
|
||||||
|
|
||||||
|
raylib_api.$(EXTENSION): ../src/raylib.h raylib_parser
|
||||||
|
./raylib_parser -i ../src/raylib.h -o raylib_api.$(EXTENSION) -f $(FORMAT) -d RLAPI
|
||||||
|
|
||||||
|
raymath_api.$(EXTENSION): ../src/raymath.h raylib_parser
|
||||||
|
./raylib_parser -i ../src/raymath.h -o raymath_api.$(EXTENSION) -f $(FORMAT) -d RMAPI
|
||||||
|
|
||||||
|
rlgl_api.$(EXTENSION): ../src/rlgl.h raylib_parser
|
||||||
|
./raylib_parser -i ../src/rlgl.h -o rlgl_api.$(EXTENSION) -f $(FORMAT) -d RLAPI -t "RLGL IMPLEMENTATION"
|
||||||
|
|
||||||
|
reasings_api.$(EXTENSION): ../examples/others/reasings.h raylib_parser
|
||||||
|
./raylib_parser -i ../examples/others/reasings.h -o reasings_api.$(EXTENSION) -f $(FORMAT) -d EASEDEF
|
||||||
|
|
||||||
|
rmem_api.$(EXTENSION): ../rmem.h raylib_parser
|
||||||
|
./raylib_parser -i ../rmem.h -o rmem_api.$(EXTENSION) -f $(FORMAT) -d RMEMAPI -t "RMEM IMPLEMENTATION"
|
||||||
|
|
||||||
|
physac_api.$(EXTENSION): ../physac.h raylib_parser
|
||||||
|
./raylib_parser -i ../physac.h -o physac_api.$(EXTENSION) -f $(FORMAT) -d PHYSACDEF -t "PHYSAC IMPLEMENTATION"
|
||||||
|
|
||||||
|
raygui_api.$(EXTENSION): ../raygui.h raylib_parser
|
||||||
|
./raylib_parser -i ../raygui.h -o raygui_api.$(EXTENSION) -f $(FORMAT) -d RAYGUIAPI -t "RAYGUI IMPLEMENTATION"
|
||||||
|
|
||||||
|
parse: raylib_api.$(EXTENSION) raymath_api.$(EXTENSION) rlgl_api.$(EXTENSION) rmem_api.$(EXTENSION) physac_api.$(EXTENSION) raygui_api.$(EXTENSION)
|
||||||
|
|
||||||
|
|
||||||
|
# `make parse` (and therefore `make all) requires
|
||||||
|
# rmem.h, physac.h and raygui.h to exist in the correct directory
|
||||||
|
# API files for individual headers can be created likeso, provided the relevant header exists:
|
||||||
|
# FORMAT=JSON EXTENSION=json make raygui_api.json
|
||||||
|
all: raylib_parser
|
||||||
|
FORMAT=DEFAULT EXTENSION=txt $(MAKE) parse
|
||||||
|
FORMAT=JSON EXTENSION=json $(MAKE) parse
|
||||||
|
FORMAT=XML EXTENSION=xml $(MAKE) parse
|
||||||
|
FORMAT=LUA EXTENSION=lua $(MAKE) parse
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f raylib_parser *.json *.txt *.xml *.lua
|
107
3party/raylib/parser/README.md
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
# raylib parser
|
||||||
|
|
||||||
|
This parser scans [`raylib.h`](../src/raylib.h) to get information about `defines`, `structs`, `enums` and `functions`.
|
||||||
|
All data is separated into parts, usually as strings. The following types are used for data:
|
||||||
|
|
||||||
|
- `struct DefineInfo`
|
||||||
|
- `struct FunctionInfo`
|
||||||
|
- `struct StructInfo`
|
||||||
|
- `struct EnumInfo`
|
||||||
|
|
||||||
|
Check `raylib_parser.c` for details about those structs.
|
||||||
|
|
||||||
|
## Command Line
|
||||||
|
|
||||||
|
```
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// //
|
||||||
|
// raylib API parser //
|
||||||
|
// //
|
||||||
|
// more info and bugs-report: github.com/raysan5/raylib/parser //
|
||||||
|
// //
|
||||||
|
// Copyright (c) 2021-2023 Ramon Santamaria (@raysan5) //
|
||||||
|
// //
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
USAGE:
|
||||||
|
|
||||||
|
> raylib_parser [--help] [--input <filename.h>] [--output <filename.ext>] [--format <type>]
|
||||||
|
|
||||||
|
OPTIONS:
|
||||||
|
|
||||||
|
-h, --help : Show tool version and command line usage help
|
||||||
|
|
||||||
|
-i, --input <filename.h> : Define input header file to parse.
|
||||||
|
NOTE: If not specified, defaults to: raylib.h
|
||||||
|
|
||||||
|
-o, --output <filename.ext> : Define output file and format.
|
||||||
|
Supported extensions: .txt, .json, .xml, .h
|
||||||
|
NOTE: If not specified, defaults to: raylib_api.txt
|
||||||
|
|
||||||
|
-f, --format <type> : Define output format for parser data.
|
||||||
|
Supported types: DEFAULT, JSON, XML, LUA
|
||||||
|
|
||||||
|
-d, --define <DEF> : Define functions specifiers (i.e. RLAPI for raylib.h, RMDEF for raymath.h, etc.)
|
||||||
|
NOTE: If no specifier defined, defaults to: RLAPI
|
||||||
|
|
||||||
|
-t, --truncate <after> : Define string to truncate input after (i.e. "RLGL IMPLEMENTATION" for rlgl.h)
|
||||||
|
NOTE: If not specified, the full input file is parsed.
|
||||||
|
|
||||||
|
|
||||||
|
EXAMPLES:
|
||||||
|
|
||||||
|
> raylib_parser --input raylib.h --output api.json
|
||||||
|
Process <raylib.h> to generate <api.json>
|
||||||
|
|
||||||
|
> raylib_parser --output raylib_data.info --format XML
|
||||||
|
Process <raylib.h> to generate <raylib_data.info> as XML text data
|
||||||
|
|
||||||
|
> raylib_parser --input raymath.h --output raymath_data.info --format XML
|
||||||
|
Process <raymath.h> to generate <raymath_data.info> as XML text data
|
||||||
|
```
|
||||||
|
|
||||||
|
## Constraints
|
||||||
|
|
||||||
|
This parser is specifically designed to work with raylib.h, so, it has some constraints:
|
||||||
|
|
||||||
|
- Functions are expected as a single line with the following structure:
|
||||||
|
```
|
||||||
|
<retType> <name>(<paramType[0]> <paramName[0]>, <paramType[1]> <paramName[1]>); <desc>
|
||||||
|
```
|
||||||
|
Be careful with functions broken into several lines, it breaks the process!
|
||||||
|
|
||||||
|
- Structures are expected as several lines with the following form:
|
||||||
|
```
|
||||||
|
<desc>
|
||||||
|
typedef struct <name> {
|
||||||
|
<fieldType[0]> <fieldName[0]>; <fieldDesc[0]>
|
||||||
|
<fieldType[1]> <fieldName[1]>; <fieldDesc[1]>
|
||||||
|
<fieldType[2]> <fieldName[2]>; <fieldDesc[2]>
|
||||||
|
} <name>;
|
||||||
|
```
|
||||||
|
- Enums are expected as several lines with the following form:
|
||||||
|
```
|
||||||
|
<desc>
|
||||||
|
typedef enum {
|
||||||
|
<valueName[0]> = <valueInteger[0]>, <valueDesc[0]>
|
||||||
|
<valueName[1]>,
|
||||||
|
<valueName[2]>, <valueDesc[2]>
|
||||||
|
<valueName[3]> <valueDesc[3]>
|
||||||
|
} <name>;
|
||||||
|
```
|
||||||
|
|
||||||
|
_NOTE: For enums, multiple options are supported:_
|
||||||
|
|
||||||
|
- If value is not provided, (<valueInteger[i -1]> + 1) is assigned
|
||||||
|
- Value description can be provided or not
|
||||||
|
|
||||||
|
## Additional notes
|
||||||
|
|
||||||
|
This parser _could_ work with other C header files if mentioned constraints are followed.
|
||||||
|
|
||||||
|
This parser **does not require `<string.h>` library**, all data is parsed directly from char buffers.
|
||||||
|
|
||||||
|
### LICENSE: zlib/libpng
|
||||||
|
|
||||||
|
raylib-parser is licensed under an unmodified zlib/libpng license, which is an OSI-certified, BSD-like license that allows static linking with closed source software. Check [LICENSE](LICENSE) for further details.
|
||||||
|
|
11134
3party/raylib/parser/output/raylib_api.json
Normal file
7717
3party/raylib/parser/output/raylib_api.lua
Normal file
4289
3party/raylib/parser/output/raylib_api.txt
Normal file
2849
3party/raylib/parser/output/raylib_api.xml
Normal file
1989
3party/raylib/parser/raylib_parser.c
Normal file
399
3party/raylib/projects/4coder/Makefile
Normal file
@ -0,0 +1,399 @@
|
|||||||
|
#**************************************************************************************************
|
||||||
|
#
|
||||||
|
# raylib makefile for Desktop platforms, Raspberry Pi, Android and HTML5
|
||||||
|
#
|
||||||
|
# Copyright (c) 2013-2023 Ramon Santamaria (@raysan5)
|
||||||
|
#
|
||||||
|
# This software is provided "as-is", without any express or implied warranty. In no event
|
||||||
|
# will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
#
|
||||||
|
# Permission is granted to anyone to use this software for any purpose, including commercial
|
||||||
|
# applications, and to alter it and redistribute it freely, subject to the following restrictions:
|
||||||
|
#
|
||||||
|
# 1. The origin of this software must not be misrepresented; you must not claim that you
|
||||||
|
# wrote the original software. If you use this software in a product, an acknowledgment
|
||||||
|
# in the product documentation would be appreciated but is not required.
|
||||||
|
#
|
||||||
|
# 2. Altered source versions must be plainly marked as such, and must not be misrepresented
|
||||||
|
# as being the original software.
|
||||||
|
#
|
||||||
|
# 3. This notice may not be removed or altered from any source distribution.
|
||||||
|
#
|
||||||
|
#**************************************************************************************************
|
||||||
|
|
||||||
|
.PHONY: all clean
|
||||||
|
|
||||||
|
# Define required raylib variables
|
||||||
|
PROJECT_NAME ?= game
|
||||||
|
RAYLIB_VERSION ?= 4.2.0
|
||||||
|
RAYLIB_PATH ?= ..\..
|
||||||
|
|
||||||
|
# Define default options
|
||||||
|
|
||||||
|
# One of PLATFORM_DESKTOP, PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB
|
||||||
|
PLATFORM ?= PLATFORM_DESKTOP
|
||||||
|
|
||||||
|
# Locations of your newly installed library and associated headers. See ../src/Makefile
|
||||||
|
# On Linux, if you have installed raylib but cannot compile the examples, check that
|
||||||
|
# the *_INSTALL_PATH values here are the same as those in src/Makefile or point to known locations.
|
||||||
|
# To enable system-wide compile-time and runtime linking to libraylib.so, run ../src/$ sudo make install RAYLIB_LIBTYPE_SHARED.
|
||||||
|
# To enable compile-time linking to a special version of libraylib.so, change these variables here.
|
||||||
|
# To enable runtime linking to a special version of libraylib.so, see EXAMPLE_RUNTIME_PATH below.
|
||||||
|
# If there is a libraylib in both EXAMPLE_RUNTIME_PATH and RAYLIB_INSTALL_PATH, at runtime,
|
||||||
|
# the library at EXAMPLE_RUNTIME_PATH, if present, will take precedence over the one at RAYLIB_INSTALL_PATH.
|
||||||
|
# RAYLIB_INSTALL_PATH should be the desired full path to libraylib. No relative paths.
|
||||||
|
DESTDIR ?= /usr/local
|
||||||
|
RAYLIB_INSTALL_PATH ?= $(DESTDIR)/lib
|
||||||
|
# RAYLIB_H_INSTALL_PATH locates the installed raylib header and associated source files.
|
||||||
|
RAYLIB_H_INSTALL_PATH ?= $(DESTDIR)/include
|
||||||
|
|
||||||
|
# Library type used for raylib: STATIC (.a) or SHARED (.so/.dll)
|
||||||
|
RAYLIB_LIBTYPE ?= STATIC
|
||||||
|
|
||||||
|
# Build mode for project: DEBUG or RELEASE
|
||||||
|
BUILD_MODE ?= RELEASE
|
||||||
|
|
||||||
|
# Use external GLFW library instead of rglfw module
|
||||||
|
# TODO: Review usage on Linux. Target version of choice. Switch on -lglfw or -lglfw3
|
||||||
|
USE_EXTERNAL_GLFW ?= FALSE
|
||||||
|
|
||||||
|
# Use Wayland display server protocol on Linux desktop
|
||||||
|
# by default it uses X11 windowing system
|
||||||
|
USE_WAYLAND_DISPLAY ?= FALSE
|
||||||
|
|
||||||
|
# Determine PLATFORM_OS in case PLATFORM_DESKTOP selected
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
|
# No uname.exe on MinGW!, but OS=Windows_NT on Windows!
|
||||||
|
# ifeq ($(UNAME),Msys) -> Windows
|
||||||
|
ifeq ($(OS),Windows_NT)
|
||||||
|
PLATFORM_OS=WINDOWS
|
||||||
|
else
|
||||||
|
UNAMEOS=$(shell uname)
|
||||||
|
ifeq ($(UNAMEOS),Linux)
|
||||||
|
PLATFORM_OS=LINUX
|
||||||
|
endif
|
||||||
|
ifeq ($(UNAMEOS),FreeBSD)
|
||||||
|
PLATFORM_OS=BSD
|
||||||
|
endif
|
||||||
|
ifeq ($(UNAMEOS),OpenBSD)
|
||||||
|
PLATFORM_OS=BSD
|
||||||
|
endif
|
||||||
|
ifeq ($(UNAMEOS),NetBSD)
|
||||||
|
PLATFORM_OS=BSD
|
||||||
|
endif
|
||||||
|
ifeq ($(UNAMEOS),DragonFly)
|
||||||
|
PLATFORM_OS=BSD
|
||||||
|
endif
|
||||||
|
ifeq ($(UNAMEOS),Darwin)
|
||||||
|
PLATFORM_OS=OSX
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
|
UNAMEOS=$(shell uname)
|
||||||
|
ifeq ($(UNAMEOS),Linux)
|
||||||
|
PLATFORM_OS=LINUX
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
# RAYLIB_PATH adjustment for different platforms.
|
||||||
|
# If using GNU make, we can get the full path to the top of the tree. Windows? BSD?
|
||||||
|
# Required for ldconfig or other tools that do not perform path expansion.
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
|
RAYLIB_PREFIX ?= ..
|
||||||
|
RAYLIB_PATH = $(realpath $(RAYLIB_PREFIX))
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
# Default path for raylib on Raspberry Pi, if installed in different path, update it!
|
||||||
|
# This is not currently used by src/Makefile. Not sure of its origin or usage. Refer to wiki.
|
||||||
|
# TODO: update install: target in src/Makefile for RPI, consider relation to LINUX.
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
|
RAYLIB_PATH ?= /home/pi/raylib
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
|
# Emscripten required variables
|
||||||
|
EMSDK_PATH ?= C:/emsdk
|
||||||
|
EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten
|
||||||
|
CLANG_PATH = $(EMSDK_PATH)/upstream/bin
|
||||||
|
PYTHON_PATH = $(EMSDK_PATH)/python/3.9.2-1_64bit
|
||||||
|
NODE_PATH = $(EMSDK_PATH)/node/14.15.5_64bit/bin
|
||||||
|
export PATH = $(EMSDK_PATH);$(EMSCRIPTEN_PATH);$(CLANG_PATH);$(NODE_PATH);$(PYTHON_PATH);C:\raylib\MinGW\bin:$$(PATH)
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Define raylib release directory for compiled library.
|
||||||
|
# RAYLIB_RELEASE_PATH points to provided binaries or your freshly built version
|
||||||
|
RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src
|
||||||
|
|
||||||
|
# EXAMPLE_RUNTIME_PATH embeds a custom runtime location of libraylib.so or other desired libraries
|
||||||
|
# into each example binary compiled with RAYLIB_LIBTYPE=SHARED. It defaults to RAYLIB_RELEASE_PATH
|
||||||
|
# so that these examples link at runtime with your version of libraylib.so in ../release/libs/linux
|
||||||
|
# without formal installation from ../src/Makefile. It aids portability and is useful if you have
|
||||||
|
# multiple versions of raylib, have raylib installed to a non-standard location, or want to
|
||||||
|
# bundle libraylib.so with your game. Change it to your liking.
|
||||||
|
# NOTE: If, at runtime, there is a libraylib.so at both EXAMPLE_RUNTIME_PATH and RAYLIB_INSTALL_PATH,
|
||||||
|
# The library at EXAMPLE_RUNTIME_PATH, if present, will take precedence over RAYLIB_INSTALL_PATH,
|
||||||
|
# Implemented for LINUX below with CFLAGS += -Wl,-rpath,$(EXAMPLE_RUNTIME_PATH)
|
||||||
|
# To see the result, run readelf -d core/core_basic_window; looking at the RPATH or RUNPATH attribute.
|
||||||
|
# To see which libraries a built example is linking to, ldd core/core_basic_window;
|
||||||
|
# Look for libraylib.so.1 => $(RAYLIB_INSTALL_PATH)/libraylib.so.1 or similar listing.
|
||||||
|
EXAMPLE_RUNTIME_PATH ?= $(RAYLIB_RELEASE_PATH)
|
||||||
|
|
||||||
|
# Define default C compiler: gcc
|
||||||
|
# NOTE: define g++ compiler if using C++
|
||||||
|
CC = gcc
|
||||||
|
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
|
ifeq ($(PLATFORM_OS),OSX)
|
||||||
|
# OSX default compiler
|
||||||
|
CC = clang
|
||||||
|
endif
|
||||||
|
ifeq ($(PLATFORM_OS),BSD)
|
||||||
|
# FreeBSD, OpenBSD, NetBSD, DragonFly default compiler
|
||||||
|
CC = clang
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
|
ifeq ($(USE_RPI_CROSS_COMPILER),TRUE)
|
||||||
|
# Define RPI cross-compiler
|
||||||
|
#CC = armv6j-hardfloat-linux-gnueabi-gcc
|
||||||
|
CC = $(RPI_TOOLCHAIN)/bin/arm-linux-gnueabihf-gcc
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
|
# HTML5 emscripten compiler
|
||||||
|
# WARNING: To compile to HTML5, code must be redesigned
|
||||||
|
# to use emscripten.h and emscripten_set_main_loop()
|
||||||
|
CC = emcc
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Define default make program: Mingw32-make
|
||||||
|
MAKE = mingw32-make
|
||||||
|
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
|
MAKE = make
|
||||||
|
endif
|
||||||
|
ifeq ($(PLATFORM_OS),OSX)
|
||||||
|
MAKE = make
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Define compiler flags:
|
||||||
|
# -O1 defines optimization level
|
||||||
|
# -g include debug information on compilation
|
||||||
|
# -s strip unnecessary data from build
|
||||||
|
# -Wall turns on most, but not all, compiler warnings
|
||||||
|
# -std=c99 defines C language mode (standard C from 1999 revision)
|
||||||
|
# -std=gnu99 defines C language mode (GNU C from 1999 revision)
|
||||||
|
# -Wno-missing-braces ignore invalid warning (GCC bug 53119)
|
||||||
|
# -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec
|
||||||
|
CFLAGS += -O1 -s -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces
|
||||||
|
|
||||||
|
ifeq ($(BUILD_MODE),DEBUG)
|
||||||
|
CFLAGS += -g
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Additional flags for compiler (if desired)
|
||||||
|
#CFLAGS += -Wextra -Wmissing-prototypes -Wstrict-prototypes
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
|
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||||
|
# resource file contains windows executable icon and properties
|
||||||
|
# -Wl,--subsystem,windows hides the console window
|
||||||
|
CFLAGS += $(RAYLIB_PATH)/src/raylib.rc.data -Wl,--subsystem,windows
|
||||||
|
endif
|
||||||
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
|
ifeq ($(RAYLIB_LIBTYPE),STATIC)
|
||||||
|
CFLAGS += -D_DEFAULT_SOURCE
|
||||||
|
endif
|
||||||
|
ifeq ($(RAYLIB_LIBTYPE),SHARED)
|
||||||
|
# Explicitly enable runtime link to libraylib.so
|
||||||
|
CFLAGS += -Wl,-rpath,$(EXAMPLE_RUNTIME_PATH)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
|
CFLAGS += -std=gnu99
|
||||||
|
endif
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
|
# -Os # size optimization
|
||||||
|
# -O2 # optimization level 2, if used, also set --memory-init-file 0
|
||||||
|
# -s USE_GLFW=3 # Use glfw3 library (context/input management)
|
||||||
|
# -s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL!
|
||||||
|
# -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB)
|
||||||
|
# -s USE_PTHREADS=1 # multithreading support
|
||||||
|
# -s WASM=0 # disable Web Assembly, emitted by default
|
||||||
|
# -s EMTERPRETIFY=1 # enable emscripten code interpreter (very slow)
|
||||||
|
# -s EMTERPRETIFY_ASYNC=1 # support synchronous loops by emterpreter
|
||||||
|
# -s FORCE_FILESYSTEM=1 # force filesystem to load/save files data
|
||||||
|
# -s ASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off)
|
||||||
|
# --profiling # include information for code profiling
|
||||||
|
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
|
||||||
|
# --preload-file resources # specify a resources folder for data compilation
|
||||||
|
CFLAGS += -Os -s USE_GLFW=3 -s TOTAL_MEMORY=16777216 --preload-file resources
|
||||||
|
ifeq ($(BUILD_MODE), DEBUG)
|
||||||
|
CFLAGS += -s ASSERTIONS=1 --profiling
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Define a custom shell .html and output extension
|
||||||
|
CFLAGS += --shell-file $(RAYLIB_PATH)/src/shell.html
|
||||||
|
EXT = .html
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Define include paths for required headers
|
||||||
|
# NOTE: Several external required libraries (stb and others)
|
||||||
|
INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external
|
||||||
|
|
||||||
|
# Define additional directories containing required header files
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
|
# RPI required libraries
|
||||||
|
INCLUDE_PATHS += -I/opt/vc/include
|
||||||
|
INCLUDE_PATHS += -I/opt/vc/include/interface/vmcs_host/linux
|
||||||
|
INCLUDE_PATHS += -I/opt/vc/include/interface/vcos/pthreads
|
||||||
|
endif
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
|
ifeq ($(PLATFORM_OS),BSD)
|
||||||
|
# Consider -L$(RAYLIB_H_INSTALL_PATH)
|
||||||
|
INCLUDE_PATHS += -I/usr/local/include
|
||||||
|
endif
|
||||||
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
|
# Reset everything.
|
||||||
|
# Precedence: immediately local, installed version, raysan5 provided libs -I$(RAYLIB_H_INSTALL_PATH) -I$(RAYLIB_PATH)/release/include
|
||||||
|
INCLUDE_PATHS = -I$(RAYLIB_H_INSTALL_PATH) -isystem. -isystem$(RAYLIB_PATH)/src -isystem$(RAYLIB_PATH)/release/include -isystem$(RAYLIB_PATH)/src/external
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Define library paths containing required libs.
|
||||||
|
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
|
||||||
|
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
|
ifeq ($(PLATFORM_OS),BSD)
|
||||||
|
# Consider -L$(RAYLIB_INSTALL_PATH)
|
||||||
|
LDFLAGS += -L. -Lsrc -L/usr/local/lib
|
||||||
|
endif
|
||||||
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
|
# Reset everything.
|
||||||
|
# Precedence: immediately local, installed version, raysan5 provided libs
|
||||||
|
LDFLAGS = -L. -L$(RAYLIB_INSTALL_PATH) -L$(RAYLIB_RELEASE_PATH)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
|
LDFLAGS += -L/opt/vc/lib
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Define any libraries required on linking
|
||||||
|
# if you want to link libraries (libname.so or libname.a), use the -lname
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
|
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||||
|
# Libraries for Windows desktop compilation
|
||||||
|
# NOTE: WinMM library required to set high-res timer resolution
|
||||||
|
LDLIBS = -lraylib -lopengl32 -lgdi32 -lwinmm
|
||||||
|
endif
|
||||||
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
|
# Libraries for Debian GNU/Linux desktop compiling
|
||||||
|
# NOTE: Required packages: libegl1-mesa-dev
|
||||||
|
LDLIBS = -lraylib -lGL -lm -lpthread -ldl -lrt
|
||||||
|
|
||||||
|
# On X11 requires also below libraries
|
||||||
|
LDLIBS += -lX11
|
||||||
|
# NOTE: It seems additional libraries are not required any more, latest GLFW just dlopen them
|
||||||
|
#LDLIBS += -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
|
||||||
|
|
||||||
|
# On Wayland windowing system, additional libraries requires
|
||||||
|
ifeq ($(USE_WAYLAND_DISPLAY),TRUE)
|
||||||
|
LDLIBS += -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon
|
||||||
|
endif
|
||||||
|
# Explicit link to libc
|
||||||
|
ifeq ($(RAYLIB_LIBTYPE),SHARED)
|
||||||
|
LDLIBS += -lc
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
ifeq ($(PLATFORM_OS),OSX)
|
||||||
|
# Libraries for OSX 10.9 desktop compiling
|
||||||
|
# NOTE: Required packages: libopenal-dev libegl1-mesa-dev
|
||||||
|
LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa
|
||||||
|
endif
|
||||||
|
ifeq ($(PLATFORM_OS),BSD)
|
||||||
|
# Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling
|
||||||
|
# NOTE: Required packages: mesa-libs
|
||||||
|
LDLIBS = -lraylib -lGL -lpthread -lm
|
||||||
|
|
||||||
|
# On XWindow requires also below libraries
|
||||||
|
LDLIBS += -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
|
||||||
|
endif
|
||||||
|
ifeq ($(USE_EXTERNAL_GLFW),TRUE)
|
||||||
|
# NOTE: It could require additional packages installed: libglfw3-dev
|
||||||
|
LDLIBS += -lglfw
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
|
# Libraries for Raspberry Pi compiling
|
||||||
|
# NOTE: Required packages: libasound2-dev (ALSA)
|
||||||
|
LDLIBS = -lraylib -lbrcmGLESv2 -lbrcmEGL -lpthread -lrt -lm -lbcm_host -ldl
|
||||||
|
endif
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
|
# Libraries for web (HTML5) compiling
|
||||||
|
LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.bc
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Define a recursive wildcard function
|
||||||
|
rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d))
|
||||||
|
|
||||||
|
# Define all source files required
|
||||||
|
SRC_DIR = src
|
||||||
|
OBJ_DIR = obj
|
||||||
|
|
||||||
|
# Define all object files from source files
|
||||||
|
SRC = $(call rwildcard, *.c, *.h)
|
||||||
|
#OBJS = $(SRC:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o)
|
||||||
|
OBJS = main.c
|
||||||
|
|
||||||
|
# For Android platform we call a custom Makefile.Android
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_ANDROID)
|
||||||
|
MAKEFILE_PARAMS = -f Makefile.Android
|
||||||
|
export PROJECT_NAME
|
||||||
|
export SRC_DIR
|
||||||
|
else
|
||||||
|
MAKEFILE_PARAMS = $(PROJECT_NAME)
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Default target entry
|
||||||
|
# NOTE: We call this Makefile target or Makefile.Android target
|
||||||
|
all:
|
||||||
|
$(MAKE) $(MAKEFILE_PARAMS)
|
||||||
|
|
||||||
|
# Project target defined by PROJECT_NAME
|
||||||
|
$(PROJECT_NAME): $(OBJS)
|
||||||
|
$(CC) -o $(PROJECT_NAME)$(EXT) $(OBJS) $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
||||||
|
|
||||||
|
# Compile source files
|
||||||
|
# NOTE: This pattern will compile every module defined on $(OBJS)
|
||||||
|
#%.o: %.c
|
||||||
|
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c
|
||||||
|
$(CC) -c $< -o $@ $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM)
|
||||||
|
|
||||||
|
# Clean everything
|
||||||
|
clean:
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
|
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||||
|
del *.o *.exe /s
|
||||||
|
endif
|
||||||
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
|
find -type f -executable | xargs file -i | grep -E 'x-object|x-archive|x-sharedlib|x-executable' | rev | cut -d ':' -f 2- | rev | xargs rm -fv
|
||||||
|
endif
|
||||||
|
ifeq ($(PLATFORM_OS),OSX)
|
||||||
|
find . -type f -perm +ugo+x -delete
|
||||||
|
rm -f *.o
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
|
find . -type f -executable -delete
|
||||||
|
rm -fv *.o
|
||||||
|
endif
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
|
del *.o *.html *.js
|
||||||
|
endif
|
||||||
|
@echo Cleaning done
|
||||||
|
|
300
3party/raylib/projects/4coder/Makefile.Android
Normal file
@ -0,0 +1,300 @@
|
|||||||
|
#**************************************************************************************************
|
||||||
|
#
|
||||||
|
# raylib makefile for Android project (APK building)
|
||||||
|
#
|
||||||
|
# Copyright (c) 2017 Ramon Santamaria (@raysan5)
|
||||||
|
#
|
||||||
|
# This software is provided "as-is", without any express or implied warranty. In no event
|
||||||
|
# will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
#
|
||||||
|
# Permission is granted to anyone to use this software for any purpose, including commercial
|
||||||
|
# applications, and to alter it and redistribute it freely, subject to the following restrictions:
|
||||||
|
#
|
||||||
|
# 1. The origin of this software must not be misrepresented; you must not claim that you
|
||||||
|
# wrote the original software. If you use this software in a product, an acknowledgment
|
||||||
|
# in the product documentation would be appreciated but is not required.
|
||||||
|
#
|
||||||
|
# 2. Altered source versions must be plainly marked as such, and must not be misrepresented
|
||||||
|
# as being the original software.
|
||||||
|
#
|
||||||
|
# 3. This notice may not be removed or altered from any source distribution.
|
||||||
|
#
|
||||||
|
#**************************************************************************************************
|
||||||
|
|
||||||
|
# Define required raylib variables
|
||||||
|
PLATFORM ?= PLATFORM_ANDROID
|
||||||
|
RAYLIB_PATH ?= ..\..
|
||||||
|
|
||||||
|
# Define Android architecture (armeabi-v7a, arm64-v8a, x86, x86-64) and API version
|
||||||
|
ANDROID_ARCH ?= ARM
|
||||||
|
ANDROID_API_VERSION = 21
|
||||||
|
ifeq ($(ANDROID_ARCH),ARM)
|
||||||
|
ANDROID_ARCH_NAME = armeabi-v7a
|
||||||
|
endif
|
||||||
|
ifeq ($(ANDROID_ARCH),ARM64)
|
||||||
|
ANDROID_ARCH_NAME = arm64-v8a
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Required path variables
|
||||||
|
# NOTE: JAVA_HOME must be set to JDK
|
||||||
|
JAVA_HOME ?= C:/JavaJDK
|
||||||
|
ANDROID_HOME = C:/android-sdk
|
||||||
|
ANDROID_TOOLCHAIN = C:/android_toolchain_$(ANDROID_ARCH)_API$(ANDROID_API_VERSION)
|
||||||
|
ANDROID_BUILD_TOOLS = $(ANDROID_HOME)/build-tools/28.0.1
|
||||||
|
ANDROID_PLATFORM_TOOLS = $(ANDROID_HOME)/platform-tools
|
||||||
|
|
||||||
|
# Android project configuration variables
|
||||||
|
PROJECT_NAME ?= raylib_game
|
||||||
|
PROJECT_LIBRARY_NAME ?= main
|
||||||
|
PROJECT_BUILD_PATH ?= android.$(PROJECT_NAME)
|
||||||
|
PROJECT_RESOURCES_PATH ?= resources
|
||||||
|
PROJECT_SOURCE_FILES ?= raylib_game.c
|
||||||
|
|
||||||
|
# Some source files are placed in directories, when compiling to some
|
||||||
|
# output directory other than source, that directory must pre-exist.
|
||||||
|
# Here we get a list of required folders that need to be created on
|
||||||
|
# code output folder $(PROJECT_BUILD_PATH)\obj to avoid GCC errors.
|
||||||
|
PROJECT_SOURCE_DIRS = $(sort $(dir $(PROJECT_SOURCE_FILES)))
|
||||||
|
|
||||||
|
# Android app configuration variables
|
||||||
|
APP_LABEL_NAME ?= rGame
|
||||||
|
APP_COMPANY_NAME ?= raylib
|
||||||
|
APP_PRODUCT_NAME ?= rgame
|
||||||
|
APP_VERSION_CODE ?= 1
|
||||||
|
APP_VERSION_NAME ?= 1.0
|
||||||
|
APP_ICON_LDPI ?= $(RAYLIB_PATH)\logo\raylib_36x36.png
|
||||||
|
APP_ICON_MDPI ?= $(RAYLIB_PATH)\logo\raylib_48x48.png
|
||||||
|
APP_ICON_HDPI ?= $(RAYLIB_PATH)\logo\raylib_72x72.png
|
||||||
|
APP_SCREEN_ORIENTATION ?= landscape
|
||||||
|
APP_KEYSTORE_PASS ?= raylib
|
||||||
|
|
||||||
|
# Library type used for raylib: STATIC (.a) or SHARED (.so/.dll)
|
||||||
|
RAYLIB_LIBTYPE ?= STATIC
|
||||||
|
|
||||||
|
# Library path for libraylib.a/libraylib.so
|
||||||
|
RAYLIB_LIB_PATH = $(RAYLIB_PATH)\src
|
||||||
|
|
||||||
|
# Shared libs must be added to APK if required
|
||||||
|
# NOTE: Generated NativeLoader.java automatically load those libraries
|
||||||
|
ifeq ($(RAYLIB_LIBTYPE),SHARED)
|
||||||
|
PROJECT_SHARED_LIBS = lib/$(ANDROID_ARCH_NAME)/libraylib.so
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Compiler and archiver
|
||||||
|
# NOTE: GCC is being deprecated in Android NDK r16
|
||||||
|
ifeq ($(ANDROID_ARCH),ARM)
|
||||||
|
CC = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-clang
|
||||||
|
AR = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-ar
|
||||||
|
endif
|
||||||
|
ifeq ($(ANDROID_ARCH),ARM64)
|
||||||
|
CC = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-clang
|
||||||
|
AR = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-ar
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Compiler flags for arquitecture
|
||||||
|
ifeq ($(ANDROID_ARCH),ARM)
|
||||||
|
CFLAGS = -std=c99 -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16
|
||||||
|
endif
|
||||||
|
ifeq ($(ANDROID_ARCH),ARM64)
|
||||||
|
CFLAGS = -std=c99 -target aarch64 -mfix-cortex-a53-835769
|
||||||
|
endif
|
||||||
|
# Compilation functions attributes options
|
||||||
|
CFLAGS += -ffunction-sections -funwind-tables -fstack-protector-strong -fPIC
|
||||||
|
# Compiler options for the linker
|
||||||
|
CFLAGS += -Wall -Wa,--noexecstack -Wformat -Werror=format-security -no-canonical-prefixes
|
||||||
|
# Preprocessor macro definitions
|
||||||
|
CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=$(ANDROID_API_VERSION)
|
||||||
|
|
||||||
|
# Paths containing required header files
|
||||||
|
INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external/android/native_app_glue
|
||||||
|
|
||||||
|
# Linker options
|
||||||
|
LDFLAGS = -Wl,-soname,lib$(PROJECT_LIBRARY_NAME).so -Wl,--exclude-libs,libatomic.a
|
||||||
|
LDFLAGS += -Wl,--build-id -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings
|
||||||
|
# Force linking of library module to define symbol
|
||||||
|
LDFLAGS += -u ANativeActivity_onCreate
|
||||||
|
# Library paths containing required libs
|
||||||
|
LDFLAGS += -L. -L$(PROJECT_BUILD_PATH)/obj -L$(PROJECT_BUILD_PATH)/lib/$(ANDROID_ARCH_NAME) -L$(ANDROID_TOOLCHAIN)\sysroot\usr\lib
|
||||||
|
|
||||||
|
# Define any libraries to link into executable
|
||||||
|
# if you want to link libraries (libname.so or libname.a), use the -lname
|
||||||
|
LDLIBS = -lm -lc -lraylib -llog -landroid -lEGL -lGLESv2 -lOpenSLES -ldl
|
||||||
|
|
||||||
|
# Generate target objects list from PROJECT_SOURCE_FILES
|
||||||
|
OBJS = $(patsubst %.c, $(PROJECT_BUILD_PATH)/obj/%.o, $(PROJECT_SOURCE_FILES))
|
||||||
|
|
||||||
|
# Android APK building process... some steps required...
|
||||||
|
# NOTE: typing 'make' will invoke the default target entry called 'all',
|
||||||
|
all: create_temp_project_dirs \
|
||||||
|
copy_project_required_libs \
|
||||||
|
copy_project_resources \
|
||||||
|
generate_loader_script \
|
||||||
|
generate_android_manifest \
|
||||||
|
generate_apk_keystore \
|
||||||
|
config_project_package \
|
||||||
|
compile_project_code \
|
||||||
|
compile_project_class \
|
||||||
|
compile_project_class_dex \
|
||||||
|
create_project_apk_package \
|
||||||
|
sign_project_apk_package \
|
||||||
|
zipalign_project_apk_package
|
||||||
|
|
||||||
|
# Create required temp directories for APK building
|
||||||
|
create_temp_project_dirs:
|
||||||
|
if not exist $(PROJECT_BUILD_PATH) mkdir $(PROJECT_BUILD_PATH)
|
||||||
|
if not exist $(PROJECT_BUILD_PATH)\obj mkdir $(PROJECT_BUILD_PATH)\obj
|
||||||
|
if not exist $(PROJECT_BUILD_PATH)\src mkdir $(PROJECT_BUILD_PATH)\src
|
||||||
|
if not exist $(PROJECT_BUILD_PATH)\src\com mkdir $(PROJECT_BUILD_PATH)\src\com
|
||||||
|
if not exist $(PROJECT_BUILD_PATH)\src\com\$(APP_COMPANY_NAME) mkdir $(PROJECT_BUILD_PATH)\src\com\$(APP_COMPANY_NAME)
|
||||||
|
if not exist $(PROJECT_BUILD_PATH)\src\com\$(APP_COMPANY_NAME)\$(APP_PRODUCT_NAME) mkdir $(PROJECT_BUILD_PATH)\src\com\$(APP_COMPANY_NAME)\$(APP_PRODUCT_NAME)
|
||||||
|
if not exist $(PROJECT_BUILD_PATH)\lib mkdir $(PROJECT_BUILD_PATH)\lib
|
||||||
|
if not exist $(PROJECT_BUILD_PATH)\lib\$(ANDROID_ARCH_NAME) mkdir $(PROJECT_BUILD_PATH)\lib\$(ANDROID_ARCH_NAME)
|
||||||
|
if not exist $(PROJECT_BUILD_PATH)\bin mkdir $(PROJECT_BUILD_PATH)\bin
|
||||||
|
if not exist $(PROJECT_BUILD_PATH)\res mkdir $(PROJECT_BUILD_PATH)\res
|
||||||
|
if not exist $(PROJECT_BUILD_PATH)\res\drawable-ldpi mkdir $(PROJECT_BUILD_PATH)\res\drawable-ldpi
|
||||||
|
if not exist $(PROJECT_BUILD_PATH)\res\drawable-mdpi mkdir $(PROJECT_BUILD_PATH)\res\drawable-mdpi
|
||||||
|
if not exist $(PROJECT_BUILD_PATH)\res\drawable-hdpi mkdir $(PROJECT_BUILD_PATH)\res\drawable-hdpi
|
||||||
|
if not exist $(PROJECT_BUILD_PATH)\res\values mkdir $(PROJECT_BUILD_PATH)\res\values
|
||||||
|
if not exist $(PROJECT_BUILD_PATH)\assets mkdir $(PROJECT_BUILD_PATH)\assets
|
||||||
|
if not exist $(PROJECT_BUILD_PATH)\assets\$(PROJECT_RESOURCES_PATH) mkdir $(PROJECT_BUILD_PATH)\assets\$(PROJECT_RESOURCES_PATH)
|
||||||
|
if not exist $(PROJECT_BUILD_PATH)\obj\screens mkdir $(PROJECT_BUILD_PATH)\obj\screens
|
||||||
|
$(foreach dir, $(PROJECT_SOURCE_DIRS), $(call create_dir, $(dir)))
|
||||||
|
|
||||||
|
define create_dir
|
||||||
|
if not exist $(PROJECT_BUILD_PATH)\obj\$(1) mkdir $(PROJECT_BUILD_PATH)\obj\$(1)
|
||||||
|
endef
|
||||||
|
|
||||||
|
# Copy required shared libs for integration into APK
|
||||||
|
# NOTE: If using shared libs they are loaded by generated NativeLoader.java
|
||||||
|
copy_project_required_libs:
|
||||||
|
ifeq ($(RAYLIB_LIBTYPE),SHARED)
|
||||||
|
copy /Y $(RAYLIB_LIB_PATH)\libraylib.so $(PROJECT_BUILD_PATH)\lib\$(ANDROID_ARCH_NAME)\libraylib.so
|
||||||
|
endif
|
||||||
|
ifeq ($(RAYLIB_LIBTYPE),STATIC)
|
||||||
|
copy /Y $(RAYLIB_LIB_PATH)\libraylib.a $(PROJECT_BUILD_PATH)\lib\$(ANDROID_ARCH_NAME)\libraylib.a
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Copy project required resources: strings.xml, icon.png, assets
|
||||||
|
# NOTE: Required strings.xml is generated and game resources are copied to assets folder
|
||||||
|
# TODO: Review xcopy usage, it can not be found in some systems!
|
||||||
|
copy_project_resources:
|
||||||
|
copy $(APP_ICON_LDPI) $(PROJECT_BUILD_PATH)\res\drawable-ldpi\icon.png /Y
|
||||||
|
copy $(APP_ICON_MDPI) $(PROJECT_BUILD_PATH)\res\drawable-mdpi\icon.png /Y
|
||||||
|
copy $(APP_ICON_HDPI) $(PROJECT_BUILD_PATH)\res\drawable-hdpi\icon.png /Y
|
||||||
|
@echo ^<?xml version="1.0" encoding="utf-8"^?^> > $(PROJECT_BUILD_PATH)/res/values/strings.xml
|
||||||
|
@echo ^<resources^>^<string name="app_name"^>$(APP_LABEL_NAME)^</string^>^</resources^> >> $(PROJECT_BUILD_PATH)/res/values/strings.xml
|
||||||
|
if exist $(PROJECT_RESOURCES_PATH) C:\Windows\System32\xcopy $(PROJECT_RESOURCES_PATH) $(PROJECT_BUILD_PATH)\assets\$(PROJECT_RESOURCES_PATH) /Y /E /F
|
||||||
|
|
||||||
|
# Generate NativeLoader.java to load required shared libraries
|
||||||
|
# NOTE: Probably not the bet way to generate this file... but it works.
|
||||||
|
generate_loader_script:
|
||||||
|
@echo package com.$(APP_COMPANY_NAME).$(APP_PRODUCT_NAME); > $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
|
||||||
|
@echo. >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
|
||||||
|
@echo public class NativeLoader extends android.app.NativeActivity { >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
|
||||||
|
@echo static { >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
|
||||||
|
ifeq ($(RAYLIB_LIBTYPE),SHARED)
|
||||||
|
@echo System.loadLibrary("raylib"); >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
|
||||||
|
endif
|
||||||
|
@echo System.loadLibrary("$(PROJECT_LIBRARY_NAME)"); >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
|
||||||
|
@echo } >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
|
||||||
|
@echo } >> $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
|
||||||
|
|
||||||
|
# Generate AndroidManifest.xml with all the required options
|
||||||
|
# NOTE: Probably not the bet way to generate this file... but it works.
|
||||||
|
generate_android_manifest:
|
||||||
|
@echo ^<?xml version="1.0" encoding="utf-8"^?^> > $(PROJECT_BUILD_PATH)/AndroidManifest.xml
|
||||||
|
@echo ^<manifest xmlns:android="http://schemas.android.com/apk/res/android" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
|
||||||
|
@echo package="com.$(APP_COMPANY_NAME).$(APP_PRODUCT_NAME)" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
|
||||||
|
@echo android:versionCode="$(APP_VERSION_CODE)" android:versionName="$(APP_VERSION_NAME)" ^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
|
||||||
|
@echo ^<uses-sdk android:minSdkVersion="$(ANDROID_API_VERSION)" /^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
|
||||||
|
@echo ^<uses-feature android:glEsVersion="0x00020000" android:required="true" /^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
|
||||||
|
@echo ^<application android:allowBackup="false" android:label="@string/app_name" android:icon="@drawable/icon" ^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
|
||||||
|
@echo ^<activity android:name="com.$(APP_COMPANY_NAME).$(APP_PRODUCT_NAME).NativeLoader" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
|
||||||
|
@echo android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
|
||||||
|
@echo android:configChanges="orientation|keyboardHidden|screenSize" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
|
||||||
|
@echo android:screenOrientation="$(APP_SCREEN_ORIENTATION)" android:launchMode="singleTask" >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
|
||||||
|
@echo android:clearTaskOnLaunch="true"^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
|
||||||
|
@echo ^<meta-data android:name="android.app.lib_name" android:value="$(PROJECT_LIBRARY_NAME)" /^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
|
||||||
|
@echo ^<intent-filter^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
|
||||||
|
@echo ^<action android:name="android.intent.action.MAIN" /^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
|
||||||
|
@echo ^<category android:name="android.intent.category.LAUNCHER" /^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
|
||||||
|
@echo ^</intent-filter^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
|
||||||
|
@echo ^</activity^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
|
||||||
|
@echo ^</application^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
|
||||||
|
@echo ^</manifest^> >> $(PROJECT_BUILD_PATH)/AndroidManifest.xml
|
||||||
|
|
||||||
|
# Generate storekey for APK signing: $(PROJECT_NAME).keystore
|
||||||
|
# NOTE: Configure here your Distinguished Names (-dname) if required!
|
||||||
|
generate_apk_keystore:
|
||||||
|
if not exist $(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore $(JAVA_HOME)/bin/keytool -genkeypair -validity 1000 -dname "CN=$(APP_COMPANY_NAME),O=Android,C=ES" -keystore $(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore -storepass $(APP_KEYSTORE_PASS) -keypass $(APP_KEYSTORE_PASS) -alias $(PROJECT_NAME)Key -keyalg RSA
|
||||||
|
|
||||||
|
# Config project package and resource using AndroidManifest.xml and res/values/strings.xml
|
||||||
|
# NOTE: Generates resources file: src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/R.java
|
||||||
|
config_project_package:
|
||||||
|
$(ANDROID_BUILD_TOOLS)/aapt package -f -m -S $(PROJECT_BUILD_PATH)/res -J $(PROJECT_BUILD_PATH)/src -M $(PROJECT_BUILD_PATH)/AndroidManifest.xml -I $(ANDROID_HOME)/platforms/android-$(ANDROID_API_VERSION)/android.jar
|
||||||
|
|
||||||
|
# Compile native_app_glue code as static library: obj/libnative_app_glue.a
|
||||||
|
compile_native_app_glue:
|
||||||
|
$(CC) -c $(RAYLIB_PATH)/src/external/android/native_app_glue/android_native_app_glue.c -o $(PROJECT_BUILD_PATH)/obj/native_app_glue.o $(CFLAGS)
|
||||||
|
$(AR) rcs $(PROJECT_BUILD_PATH)/obj/libnative_app_glue.a $(PROJECT_BUILD_PATH)/obj/native_app_glue.o
|
||||||
|
|
||||||
|
# Compile project code into a shared library: lib/lib$(PROJECT_LIBRARY_NAME).so
|
||||||
|
compile_project_code: $(OBJS)
|
||||||
|
$(CC) -o $(PROJECT_BUILD_PATH)/lib/$(ANDROID_ARCH_NAME)/lib$(PROJECT_LIBRARY_NAME).so $(OBJS) -shared $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS)
|
||||||
|
|
||||||
|
# Compile all .c files required into object (.o) files
|
||||||
|
# NOTE: Those files will be linked into a shared library
|
||||||
|
$(PROJECT_BUILD_PATH)/obj/%.o:%.c
|
||||||
|
$(CC) -c $^ -o $@ $(INCLUDE_PATHS) $(CFLAGS) --sysroot=$(ANDROID_TOOLCHAIN)/sysroot
|
||||||
|
|
||||||
|
# Compile project .java code into .class (Java bytecode)
|
||||||
|
compile_project_class:
|
||||||
|
$(JAVA_HOME)/bin/javac -verbose -source 1.7 -target 1.7 -d $(PROJECT_BUILD_PATH)/obj -bootclasspath $(JAVA_HOME)/jre/lib/rt.jar -classpath $(ANDROID_HOME)/platforms/android-$(ANDROID_API_VERSION)/android.jar;$(PROJECT_BUILD_PATH)/obj -sourcepath $(PROJECT_BUILD_PATH)/src $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/R.java $(PROJECT_BUILD_PATH)/src/com/$(APP_COMPANY_NAME)/$(APP_PRODUCT_NAME)/NativeLoader.java
|
||||||
|
|
||||||
|
# Compile .class files into Dalvik executable bytecode (.dex)
|
||||||
|
# NOTE: Since Android 5.0, Dalvik interpreter (JIT) has been replaced by ART (AOT)
|
||||||
|
compile_project_class_dex:
|
||||||
|
$(ANDROID_BUILD_TOOLS)/dx --verbose --dex --output=$(PROJECT_BUILD_PATH)/bin/classes.dex $(PROJECT_BUILD_PATH)/obj
|
||||||
|
|
||||||
|
# Create Android APK package: bin/$(PROJECT_NAME).unsigned.apk
|
||||||
|
# NOTE: Requires compiled classes.dex and lib$(PROJECT_LIBRARY_NAME).so
|
||||||
|
# NOTE: Use -A resources to define additional directory in which to find raw asset files
|
||||||
|
create_project_apk_package:
|
||||||
|
$(ANDROID_BUILD_TOOLS)/aapt package -f -M $(PROJECT_BUILD_PATH)/AndroidManifest.xml -S $(PROJECT_BUILD_PATH)/res -A $(PROJECT_BUILD_PATH)/assets -I $(ANDROID_HOME)/platforms/android-$(ANDROID_API_VERSION)/android.jar -F $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).unsigned.apk $(PROJECT_BUILD_PATH)/bin
|
||||||
|
cd $(PROJECT_BUILD_PATH) && $(ANDROID_BUILD_TOOLS)/aapt add bin/$(PROJECT_NAME).unsigned.apk lib/$(ANDROID_ARCH_NAME)/lib$(PROJECT_LIBRARY_NAME).so $(PROJECT_SHARED_LIBS)
|
||||||
|
|
||||||
|
# Create signed APK package using generated Key: bin/$(PROJECT_NAME).signed.apk
|
||||||
|
sign_project_apk_package:
|
||||||
|
$(JAVA_HOME)/bin/jarsigner -keystore $(PROJECT_BUILD_PATH)/$(PROJECT_NAME).keystore -storepass $(APP_KEYSTORE_PASS) -keypass $(APP_KEYSTORE_PASS) -signedjar $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).signed.apk $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).unsigned.apk $(PROJECT_NAME)Key
|
||||||
|
|
||||||
|
# Create zip-aligned APK package: $(PROJECT_NAME).apk
|
||||||
|
zipalign_project_apk_package:
|
||||||
|
$(ANDROID_BUILD_TOOLS)/zipalign -f 4 $(PROJECT_BUILD_PATH)/bin/$(PROJECT_NAME).signed.apk $(PROJECT_NAME).apk
|
||||||
|
|
||||||
|
# Install $(PROJECT_NAME).apk to default emulator/device
|
||||||
|
# NOTE: Use -e (emulator) or -d (device) parameters if required
|
||||||
|
install:
|
||||||
|
$(ANDROID_PLATFORM_TOOLS)/adb install --abi $(ANDROID_ARCH_NAME) -rds $(PROJECT_NAME).apk
|
||||||
|
|
||||||
|
# Check supported ABI for the device (armeabi-v7a, arm64-v8a, x86, x86_64)
|
||||||
|
check_device_abi:
|
||||||
|
$(ANDROID_PLATFORM_TOOLS)/adb shell getprop ro.product.cpu.abi
|
||||||
|
|
||||||
|
# Monitorize output log coming from device, only raylib tag
|
||||||
|
logcat:
|
||||||
|
$(ANDROID_PLATFORM_TOOLS)/adb logcat -c
|
||||||
|
$(ANDROID_PLATFORM_TOOLS)/adb logcat raylib:V *:S
|
||||||
|
|
||||||
|
# Install and monitorize $(PROJECT_NAME).apk to default emulator/device
|
||||||
|
deploy:
|
||||||
|
$(ANDROID_PLATFORM_TOOLS)/adb install -r $(PROJECT_NAME).apk
|
||||||
|
$(ANDROID_PLATFORM_TOOLS)/adb logcat -c
|
||||||
|
$(ANDROID_PLATFORM_TOOLS)/adb logcat raylib:V *:S
|
||||||
|
|
||||||
|
#$(ANDROID_PLATFORM_TOOLS)/adb logcat *:W
|
||||||
|
|
||||||
|
# Clean everything
|
||||||
|
clean:
|
||||||
|
del $(PROJECT_BUILD_PATH)\* /f /s /q
|
||||||
|
rmdir $(PROJECT_BUILD_PATH) /s /q
|
||||||
|
@echo Cleaning done
|
38
3party/raylib/projects/4coder/main.c
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
#include <math.h>
|
||||||
|
#include "raylib.h"
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int screenWidth = 800;
|
||||||
|
int screenHeight = 450;
|
||||||
|
|
||||||
|
InitWindow(screenWidth, screenHeight, "raylib");
|
||||||
|
|
||||||
|
Camera cam;
|
||||||
|
cam.position = (Vector3){ 0.0f, 10.0f, 8.f };
|
||||||
|
cam.target = (Vector3){ 0.0f, 0.0f, 0.0f };
|
||||||
|
cam.up = (Vector3){ 0.0f, 1.f, 0.0f };
|
||||||
|
cam.fovy = 60.0f;
|
||||||
|
|
||||||
|
Vector3 cubePos = { 0.0f, 0.0f, 0.0f };
|
||||||
|
|
||||||
|
SetTargetFPS(60);
|
||||||
|
|
||||||
|
while (!WindowShouldClose()) {
|
||||||
|
cam.position.x = sin(GetTime()) * 10.0f;
|
||||||
|
cam.position.z = cos(GetTime()) * 10.0f;
|
||||||
|
|
||||||
|
BeginDrawing();
|
||||||
|
ClearBackground(RAYWHITE);
|
||||||
|
BeginMode3D(cam);
|
||||||
|
DrawCube(cubePos, 2.f, 2.f, 2.f, RED);
|
||||||
|
DrawCubeWires(cubePos, 2.f, 2.f, 2.f, MAROON);
|
||||||
|
DrawGrid(10, 1.f);
|
||||||
|
EndMode3D();
|
||||||
|
DrawText("This is a raylib example", 10, 40, 20, DARKGRAY);
|
||||||
|
DrawFPS(10, 10);
|
||||||
|
EndDrawing();
|
||||||
|
}
|
||||||
|
|
||||||
|
CloseWindow();
|
||||||
|
return 0;
|
||||||
|
}
|
54
3party/raylib/projects/4coder/project.4coder
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
version(1);
|
||||||
|
|
||||||
|
project_name = "raylib-example";
|
||||||
|
|
||||||
|
patterns = {
|
||||||
|
"*.cpp",
|
||||||
|
"*.c",
|
||||||
|
"*.h",
|
||||||
|
"*.bat",
|
||||||
|
"*.sh",
|
||||||
|
"*.4coder",
|
||||||
|
"Makefile",
|
||||||
|
};
|
||||||
|
|
||||||
|
blacklist_patterns = {
|
||||||
|
".*",
|
||||||
|
};
|
||||||
|
|
||||||
|
load_paths = {
|
||||||
|
{ { {".", .relative = true, .recursive = true, } }, .os = "win" },
|
||||||
|
{ { {".", .relative = true, .recursive = true, } }, .os = "linux" },
|
||||||
|
{ { {".", .relative = true, .recursive = true, } }, .os = "mac" },
|
||||||
|
};
|
||||||
|
|
||||||
|
command_list = {
|
||||||
|
{ .name = "clean",
|
||||||
|
.out = "*clean*", .footer_panel = true, .save_dirty_files = false, .cursor_at_end = true,
|
||||||
|
.cmd = {
|
||||||
|
{"mingw32-make clean", .os = "win"},
|
||||||
|
{"make clean", .os = "linux"},
|
||||||
|
{"make clean", .os = "mac"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ .name = "build",
|
||||||
|
.out = "*compile*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false,
|
||||||
|
.cmd = {
|
||||||
|
{"mingw32-make", .os = "win"},
|
||||||
|
{"make", .os = "linux"},
|
||||||
|
{"make", .os = "mac"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ .name = "run",
|
||||||
|
.out = "*run*", .footer_panel = true, .save_dirty_files = false, .cursor_at_end = true,
|
||||||
|
.cmd = {
|
||||||
|
{".\game.exe", .os = "win"},
|
||||||
|
{"./game", .os = "linux"},
|
||||||
|
{"./game", .os = "mac"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
fkey_command[3] = "clean";
|
||||||
|
fkey_command[4] = "build";
|
||||||
|
fkey_command[5] = "run";
|
24
3party/raylib/projects/Builder/README.md
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# Builder project template
|
||||||
|
|
||||||
|
This is a project template to be used with [GNOME Builder](https://raw.githubusercontent.com/jubalh/raymario/master/meson.build).
|
||||||
|
It uses the [meson](https://raw.githubusercontent.com/jubalh/raymario/master/meson.build) build system.
|
||||||
|
|
||||||
|
Project can be compiled via the command line using:
|
||||||
|
```
|
||||||
|
meson build
|
||||||
|
cd build
|
||||||
|
ninja
|
||||||
|
ninja install
|
||||||
|
```
|
||||||
|
|
||||||
|
Or it can be opened with Building simply clicking on the `meson.build` file.
|
||||||
|
Alternatively, open Builder first and click on the `open` button at the top-left.
|
||||||
|
|
||||||
|
There are comments to the `meson.build` file to note the values that should be edited.
|
||||||
|
For a full overview of options please check the [meson manual](http://mesonbuild.com/Manual.html).
|
||||||
|
|
||||||
|
In the provided file, it's assumed that the build file is located at the root folder of the project, and that all the sources are in a `src` subfolder.
|
||||||
|
|
||||||
|
Check out the `examples` directory for a simple example on how to use this template.
|
||||||
|
|
||||||
|
You can also look at [raymario](https://github.com/jubalh/raymario) for a slightly more complex example which also installs resource files.
|
1
3party/raylib/projects/Builder/examples/README.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
Open `meson.build` with Builder or run `meson build; cd build; ninja; ./core_basic_window` on the commandline to launch the example.
|
25
3party/raylib/projects/Builder/examples/meson.build
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# This file should be in the main folder of your project
|
||||||
|
|
||||||
|
# Replace 'projectname' with the name of your project
|
||||||
|
# Replace '1.0' with its version
|
||||||
|
project('core_basic_window', 'c', version: '1.0',
|
||||||
|
meson_version: '>= 0.39.1')
|
||||||
|
|
||||||
|
# We want a C Compiler to be present
|
||||||
|
cc = meson.get_compiler('c')
|
||||||
|
|
||||||
|
# Find dependencies
|
||||||
|
gl_dep = dependency('gl')
|
||||||
|
m_dep = cc.find_library('m', required : false)
|
||||||
|
raylib_dep = cc.find_library('raylib', required : false)
|
||||||
|
|
||||||
|
# List your source files here
|
||||||
|
source_c = [
|
||||||
|
'../../../examples/core/core_basic_window.c',
|
||||||
|
]
|
||||||
|
|
||||||
|
# Build executable
|
||||||
|
core_basic_window = executable('core_basic_window',
|
||||||
|
source_c,
|
||||||
|
dependencies : [ raylib_dep, gl_dep, m_dep ],
|
||||||
|
install : true)
|
25
3party/raylib/projects/Builder/meson.build
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# This file should be in the main folder of your project
|
||||||
|
|
||||||
|
# Replace 'projectname' with the name of your project
|
||||||
|
# Replace '1.0' with its version
|
||||||
|
project('projectname', 'c', version: '1.0',
|
||||||
|
meson_version: '>= 0.39.1')
|
||||||
|
|
||||||
|
# We want a C Compiler to be present
|
||||||
|
cc = meson.get_compiler('c')
|
||||||
|
|
||||||
|
# Find dependencies
|
||||||
|
gl_dep = dependency('gl')
|
||||||
|
m_dep = cc.find_library('m', required : false)
|
||||||
|
raylib_dep = cc.find_library('raylib', required : false)
|
||||||
|
|
||||||
|
# List your source files here
|
||||||
|
source_c = [
|
||||||
|
'src/main.c',
|
||||||
|
]
|
||||||
|
|
||||||
|
# Build executable
|
||||||
|
projectname = executable('projectname',
|
||||||
|
source_c,
|
||||||
|
dependencies : [ raylib_dep, gl_dep, m_dep ],
|
||||||
|
install : true)
|
43
3party/raylib/projects/CMake/CMakeLists.txt
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.11) # FetchContent is available in 3.11+
|
||||||
|
project(example)
|
||||||
|
|
||||||
|
# Generate compile_commands.json
|
||||||
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
|
# Dependencies
|
||||||
|
set(RAYLIB_VERSION 4.5.0)
|
||||||
|
find_package(raylib ${RAYLIB_VERSION} QUIET) # QUIET or REQUIRED
|
||||||
|
if (NOT raylib_FOUND) # If there's none, fetch and build raylib
|
||||||
|
include(FetchContent)
|
||||||
|
FetchContent_Declare(
|
||||||
|
raylib
|
||||||
|
DOWNLOAD_EXTRACT_TIMESTAMP OFF
|
||||||
|
URL https://github.com/raysan5/raylib/archive/refs/tags/${RAYLIB_VERSION}.tar.gz
|
||||||
|
)
|
||||||
|
FetchContent_GetProperties(raylib)
|
||||||
|
if (NOT raylib_POPULATED) # Have we downloaded raylib yet?
|
||||||
|
set(FETCHCONTENT_QUIET NO)
|
||||||
|
FetchContent_Populate(raylib)
|
||||||
|
set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) # don't build the supplied examples
|
||||||
|
add_subdirectory(${raylib_SOURCE_DIR} ${raylib_BINARY_DIR})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Our Project
|
||||||
|
|
||||||
|
add_executable(${PROJECT_NAME} core_basic_window.c)
|
||||||
|
#set(raylib_VERBOSE 1)
|
||||||
|
target_link_libraries(${PROJECT_NAME} raylib)
|
||||||
|
|
||||||
|
# Web Configurations
|
||||||
|
if (${PLATFORM} STREQUAL "Web")
|
||||||
|
# Tell Emscripten to build an example.html file.
|
||||||
|
set_target_properties(${PROJECT_NAME} PROPERTIES SUFFIX ".html")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Checks if OSX and links appropriate frameworks (Only required on MacOS)
|
||||||
|
if (APPLE)
|
||||||
|
target_link_libraries(${PROJECT_NAME} "-framework IOKit")
|
||||||
|
target_link_libraries(${PROJECT_NAME} "-framework Cocoa")
|
||||||
|
target_link_libraries(${PROJECT_NAME} "-framework OpenGL")
|
||||||
|
endif()
|
27
3party/raylib/projects/CMake/README.md
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# raylib CMake Project
|
||||||
|
|
||||||
|
This provides a base project template which builds with [CMake](https://cmake.org).
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
To compile the example, use one of the following dependending on your build target...
|
||||||
|
|
||||||
|
### Desktop
|
||||||
|
|
||||||
|
Use the following to build for desktop:
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
cmake -B build
|
||||||
|
cmake --build build
|
||||||
|
```
|
||||||
|
|
||||||
|
### Web
|
||||||
|
|
||||||
|
Compiling for the web requires the [Emscripten SDK](https://emscripten.org/docs/getting_started/downloads.html):
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
emcmake cmake .. -DPLATFORM=Web -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS="-s USE_GLFW=3" -DCMAKE_EXECUTABLE_SUFFIX=".html"
|
||||||
|
emmake make
|
||||||
|
```
|
83
3party/raylib/projects/CMake/core_basic_window.c
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
/*******************************************************************************************
|
||||||
|
*
|
||||||
|
* raylib [core] example - Basic window (adapted for HTML5 platform)
|
||||||
|
*
|
||||||
|
* This example is prepared to compile for PLATFORM_WEB and PLATFORM_DESKTOP
|
||||||
|
* As you will notice, code structure is slightly different to the other examples...
|
||||||
|
* To compile it for PLATFORM_WEB just uncomment #define PLATFORM_WEB at beginning
|
||||||
|
*
|
||||||
|
* This example has been created using raylib 1.3 (www.raylib.com)
|
||||||
|
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
|
||||||
|
*
|
||||||
|
********************************************************************************************/
|
||||||
|
|
||||||
|
#include "raylib.h"
|
||||||
|
|
||||||
|
#if defined(PLATFORM_WEB)
|
||||||
|
#include <emscripten/emscripten.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
// Global Variables Definition
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
int screenWidth = 800;
|
||||||
|
int screenHeight = 450;
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
// Module Functions Declaration
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
void UpdateDrawFrame(void); // Update and Draw one frame
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
// Main Entry Point
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
// Initialization
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");
|
||||||
|
|
||||||
|
#if defined(PLATFORM_WEB)
|
||||||
|
emscripten_set_main_loop(UpdateDrawFrame, 0, 1);
|
||||||
|
#else
|
||||||
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Main game loop
|
||||||
|
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||||
|
{
|
||||||
|
UpdateDrawFrame();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// De-Initialization
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
CloseWindow(); // Close window and OpenGL context
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
// Module Functions Definition
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
void UpdateDrawFrame(void)
|
||||||
|
{
|
||||||
|
// Update
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
// TODO: Update your variables here
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Draw
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
BeginDrawing();
|
||||||
|
|
||||||
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
|
DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
|
||||||
|
|
||||||
|
EndDrawing();
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
}
|
22
3party/raylib/projects/CodeBlocks/README.md
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# raylib template for Code::Blocks
|
||||||
|
|
||||||
|
1. Install raylib.
|
||||||
|
|
||||||
|
On Windows you should install the **Windows Installer (with MinGW compiler)** package.
|
||||||
|
On other platforms you can install however you like following the instructions in the wiki.
|
||||||
|
|
||||||
|
* https://github.com/raysan5/raylib/releases/download/4.2.0/raylib_installer_v420.mingw.exe
|
||||||
|
* https://github.com/raysan5/raylib/wiki/Working-on-GNU-Linux
|
||||||
|
* https://github.com/raysan5/raylib/wiki/Working-on-macOS
|
||||||
|
|
||||||
|
2. Install and run Code::Blocks.
|
||||||
|
|
||||||
|
3. **Windows only**: Select `Settings` `Compiler` `Toolchain executables`.
|
||||||
|
Change `Compiler's installation directory` to `C:\raylib\MingGW`. Do *not* press auto-detect.
|
||||||
|
There is a screenshot below showing how it should look. Press `OK`.
|
||||||
|
|
||||||
|
4. Select `File` `Open` and open the `core_basic_windows.cbp` file.
|
||||||
|
|
||||||
|
![Compiler Settings](compiler_settings.png)
|
||||||
|
|
||||||
|
For an example with resources, see https://github.com/electronstudio/raylib-game-template-codeblocks
|
BIN
3party/raylib/projects/CodeBlocks/compiler_settings.png
Executable file
After Width: | Height: | Size: 52 KiB |
58
3party/raylib/projects/CodeBlocks/core_basic_window.c
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
/*******************************************************************************************
|
||||||
|
* raylib [core] example - Basic window
|
||||||
|
*
|
||||||
|
* Welcome to raylib!
|
||||||
|
*
|
||||||
|
* You can find all basic examples on C:\raylib\raylib\examples folder or
|
||||||
|
* raylib official webpage: www.raylib.com
|
||||||
|
*
|
||||||
|
* Enjoy using raylib. :)
|
||||||
|
*
|
||||||
|
* This example has been created using raylib 1.0 (www.raylib.com)
|
||||||
|
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2016 Ramon Santamaria (@raysan5)
|
||||||
|
*
|
||||||
|
********************************************************************************************/
|
||||||
|
|
||||||
|
#include "raylib.h"
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
// Initialization
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
int screenWidth = 800;
|
||||||
|
int screenHeight = 450;
|
||||||
|
|
||||||
|
InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");
|
||||||
|
|
||||||
|
SetTargetFPS(60);
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Main game loop
|
||||||
|
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||||
|
{
|
||||||
|
// Update
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
// TODO: Update your variables here
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Draw
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
BeginDrawing();
|
||||||
|
|
||||||
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
|
DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
|
||||||
|
|
||||||
|
EndDrawing();
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
}
|
||||||
|
|
||||||
|
// De-Initialization
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
CloseWindow(); // Close window and OpenGL context
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
137
3party/raylib/projects/CodeBlocks/core_basic_window.cbp
Normal file
@ -0,0 +1,137 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||||
|
<CodeBlocks_project_file>
|
||||||
|
<FileVersion major="1" minor="6" />
|
||||||
|
<Project>
|
||||||
|
<Option title="raylib-game-template" />
|
||||||
|
<Option execution_dir="." />
|
||||||
|
<Option pch_mode="2" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Build>
|
||||||
|
<Target title="Debug (Mac)">
|
||||||
|
<Option platforms="Mac;" />
|
||||||
|
<Option output="bin/Debug/raylib-game-template" prefix_auto="1" extension_auto="1" />
|
||||||
|
<Option working_dir="." />
|
||||||
|
<Option object_output="obj/Debug/" />
|
||||||
|
<Option type="1" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-g" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add library="raylib" />
|
||||||
|
<Add option="-framework OpenGL" />
|
||||||
|
<Add option="-framework Cocoa" />
|
||||||
|
<Add option="-framework IOKit" />
|
||||||
|
<Add option="-framework CoreAudio" />
|
||||||
|
<Add option="-framework CoreVideo" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
<Target title="Release (Mac)">
|
||||||
|
<Option platforms="Mac;" />
|
||||||
|
<Option output="bin/Release/raylib-game-template" prefix_auto="1" extension_auto="1" />
|
||||||
|
<Option working_dir="." />
|
||||||
|
<Option object_output="obj/Release/" />
|
||||||
|
<Option type="1" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-O2" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-s" />
|
||||||
|
<Add library="raylib" />
|
||||||
|
<Add option="-framework OpenGL" />
|
||||||
|
<Add option="-framework Cocoa" />
|
||||||
|
<Add option="-framework IOKit" />
|
||||||
|
<Add option="-framework CoreAudio" />
|
||||||
|
<Add option="-framework CoreVideo" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
<Target title="Debug (Linux)">
|
||||||
|
<Option platforms="Unix;" />
|
||||||
|
<Option output="bin/Debug/raylib-game-template" prefix_auto="1" extension_auto="1" />
|
||||||
|
<Option working_dir="." />
|
||||||
|
<Option object_output="obj/Debug/" />
|
||||||
|
<Option type="1" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-g" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add library="raylib" />
|
||||||
|
<Add library="GL" />
|
||||||
|
<Add library="m" />
|
||||||
|
<Add library="pthread" />
|
||||||
|
<Add library="dl" />
|
||||||
|
<Add library="rt" />
|
||||||
|
<Add library="X11" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
<Target title="Release (Linux)">
|
||||||
|
<Option platforms="Unix;" />
|
||||||
|
<Option output="bin/Release/raylib-game-template" prefix_auto="1" extension_auto="1" />
|
||||||
|
<Option working_dir="." />
|
||||||
|
<Option object_output="obj/Release/" />
|
||||||
|
<Option type="1" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-O2" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-s" />
|
||||||
|
<Add library="raylib" />
|
||||||
|
<Add library="GL" />
|
||||||
|
<Add library="m" />
|
||||||
|
<Add library="pthread" />
|
||||||
|
<Add library="dl" />
|
||||||
|
<Add library="rt" />
|
||||||
|
<Add library="X11" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
<Target title="Debug (Windows)">
|
||||||
|
<Option platforms="Windows;" />
|
||||||
|
<Option output="bin/Debug/raylib-game-template" prefix_auto="1" extension_auto="1" />
|
||||||
|
<Option working_dir="." />
|
||||||
|
<Option object_output="obj/Debug/" />
|
||||||
|
<Option type="1" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-g" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add library="raylib" />
|
||||||
|
<Add library="opengl32" />
|
||||||
|
<Add library="gdi32" />
|
||||||
|
<Add library="winmm" />
|
||||||
|
<Add option="-static" />
|
||||||
|
<Add library="pthread" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
<Target title="Release (Windows)">
|
||||||
|
<Option platforms="Windows;" />
|
||||||
|
<Option output="bin/Release/raylib-game-template" prefix_auto="1" extension_auto="1" />
|
||||||
|
<Option working_dir="." />
|
||||||
|
<Option object_output="obj/Release/" />
|
||||||
|
<Option type="1" />
|
||||||
|
<Option compiler="gcc" />
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-O2" />
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Add option="-s" />
|
||||||
|
<Add library="raylib" />
|
||||||
|
<Add library="opengl32" />
|
||||||
|
<Add library="gdi32" />
|
||||||
|
<Add library="winmm" />
|
||||||
|
<Add option="-static" />
|
||||||
|
<Add library="pthread" />
|
||||||
|
</Linker>
|
||||||
|
</Target>
|
||||||
|
</Build>
|
||||||
|
<Compiler>
|
||||||
|
<Add option="-Wall" />
|
||||||
|
</Compiler>
|
||||||
|
<Unit filename="core_basic_window.c">
|
||||||
|
<Option compilerVar="CC" />
|
||||||
|
</Unit>
|
||||||
|
</Project>
|
||||||
|
</CodeBlocks_project_file>
|
52
3party/raylib/projects/Geany/core_basic_window.c
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
/*******************************************************************************************
|
||||||
|
*
|
||||||
|
* raylib [core] example - Basic window
|
||||||
|
*
|
||||||
|
* This example has been created using raylib 1.0 (www.raylib.com)
|
||||||
|
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2023 Ramon Santamaria (@raysan5)
|
||||||
|
*
|
||||||
|
********************************************************************************************/
|
||||||
|
|
||||||
|
#include "raylib.h"
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
// Initialization
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
int screenWidth = 800;
|
||||||
|
int screenHeight = 450;
|
||||||
|
|
||||||
|
InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");
|
||||||
|
|
||||||
|
SetTargetFPS(60);
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Main game loop
|
||||||
|
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||||
|
{
|
||||||
|
// Update
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
// TODO: Update your variables here
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Draw
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
BeginDrawing();
|
||||||
|
|
||||||
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
|
DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
|
||||||
|
|
||||||
|
EndDrawing();
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
}
|
||||||
|
|
||||||
|
// De-Initialization
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
CloseWindow(); // Close window and OpenGL context
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
453
3party/raylib/projects/Geany/raylib.c.tags
Normal file
@ -0,0 +1,453 @@
|
|||||||
|
# format=pipe
|
||||||
|
InitWindow|void|(int width, int height, const char *title);|
|
||||||
|
WindowShouldClose|bool|(void);|
|
||||||
|
CloseWindow|void|(void);|
|
||||||
|
IsWindowReady|bool|(void);|
|
||||||
|
IsWindowMinimized|bool|(void);|
|
||||||
|
IsWindowResized|bool|(void);|
|
||||||
|
IsWindowHidden|bool|(void);|
|
||||||
|
ToggleFullscreen|void|(void);|
|
||||||
|
UnhideWindow|void|(void);|
|
||||||
|
HideWindow|void|(void);|
|
||||||
|
SetWindowIcon|void|(Image image);|
|
||||||
|
SetWindowTitle|void|(const char *title);|
|
||||||
|
SetWindowPosition|void|(int x, int y);|
|
||||||
|
SetWindowMonitor|void|(int monitor);|
|
||||||
|
SetWindowMinSize|void|(int width, int height);|
|
||||||
|
SetWindowSize|void|(int width, int height);|
|
||||||
|
GetWindowHandle|void *|(void);|
|
||||||
|
GetScreenWidth|int|(void);|
|
||||||
|
GetScreenHeight|int|(void);|
|
||||||
|
GetMonitorCount|int|(void);|
|
||||||
|
GetMonitorWidth|int|(int monitor);|
|
||||||
|
GetMonitorHeight|int|(int monitor);|
|
||||||
|
GetMonitorPhysicalWidth|int|(int monitor);|
|
||||||
|
GetMonitorPhysicalHeight|int|(int monitor);|
|
||||||
|
GetMonitorName|const char *|(int monitor);|
|
||||||
|
GetClipboardText|const char *|(void);|
|
||||||
|
SetClipboardText|void|(const char *text);|
|
||||||
|
ShowCursor|void|(void);|
|
||||||
|
HideCursor|void|(void);|
|
||||||
|
IsCursorHidden|bool|(void);|
|
||||||
|
EnableCursor|void|(void);|
|
||||||
|
DisableCursor|void|(void);|
|
||||||
|
ClearBackground|void|(Color color);|
|
||||||
|
BeginDrawing|void|(void);|
|
||||||
|
EndDrawing|void|(void);|
|
||||||
|
BeginMode2D|void|(Camera2D camera);|
|
||||||
|
EndMode2D|void|(void);|
|
||||||
|
BeginMode3D|void|(Camera3D camera);|
|
||||||
|
EndMode3D|void|(void);|
|
||||||
|
BeginTextureMode|void|(RenderTexture2D target);|
|
||||||
|
EndTextureMode|void|(void);|
|
||||||
|
GetMouseRay|Ray|(Vector2 mousePosition, Camera camera);|
|
||||||
|
GetWorldToScreen|Vector2|(Vector3 position, Camera camera);|
|
||||||
|
GetCameraMatrix|Matrix|(Camera camera);|
|
||||||
|
SetTargetFPS|void|(int fps);|
|
||||||
|
GetFPS|int|(void);|
|
||||||
|
GetFrameTime|float|(void);|
|
||||||
|
GetTime|double|(void);|
|
||||||
|
ColorToInt|int|(Color color);|
|
||||||
|
ColorNormalize|Vector4|(Color color);|
|
||||||
|
ColorToHSV|Vector3|(Color color);|
|
||||||
|
ColorFromHSV|Color|(Vector3 hsv);|
|
||||||
|
GetColor|Color|(int hexValue);|
|
||||||
|
Fade|Color|(Color color, float alpha);|
|
||||||
|
SetConfigFlags|void|(unsigned char flags);|
|
||||||
|
SetTraceLogLevel|void|(int logType);|
|
||||||
|
SetTraceLogExit|void|(int logType);|
|
||||||
|
SetTraceLogCallback|void|(TraceLogCallback callback);|
|
||||||
|
TraceLog|void|(int logType, const char *text, ...);|
|
||||||
|
TakeScreenshot|void|(const char *fileName);|
|
||||||
|
GetRandomValue|int|(int min, int max);|
|
||||||
|
FileExists|bool|(const char *fileName);|
|
||||||
|
IsFileExtension|bool|(const char *fileName, const char *ext);|
|
||||||
|
GetExtension|const char *|(const char *fileName);|
|
||||||
|
GetFileName|const char *|(const char *filePath);|
|
||||||
|
GetFileNameWithoutExt|const char *|(const char *filePath);|
|
||||||
|
GetDirectoryPath|const char *|(const char *fileName);|
|
||||||
|
GetWorkingDirectory|const char *|(void);|
|
||||||
|
GetDirectoryFiles|char **|(const char *dirPath, int *count);|
|
||||||
|
ClearDirectoryFiles|void|(void);|
|
||||||
|
ChangeDirectory|bool|(const char *dir);|
|
||||||
|
IsFileDropped|bool|(void);|
|
||||||
|
GetDroppedFiles|char **|(int *count);|
|
||||||
|
ClearDroppedFiles|void|(void);|
|
||||||
|
GetFileModTime|long|(const char *fileName);|
|
||||||
|
StorageSaveValue|void|(int position, int value);|
|
||||||
|
StorageLoadValue|int|(int position);|
|
||||||
|
OpenURL|void|(const char *url);|
|
||||||
|
IsKeyPressed|bool|(int key);|
|
||||||
|
IsKeyDown|bool|(int key);|
|
||||||
|
IsKeyReleased|bool|(int key);|
|
||||||
|
IsKeyUp|bool|(int key);|
|
||||||
|
GetKeyPressed|int|(void);|
|
||||||
|
SetExitKey|void|(int key);|
|
||||||
|
IsGamepadAvailable|bool|(int gamepad);|
|
||||||
|
IsGamepadName|bool|(int gamepad, const char *name);|
|
||||||
|
GetGamepadName|const char *|(int gamepad);|
|
||||||
|
IsGamepadButtonPressed|bool|(int gamepad, int button);|
|
||||||
|
IsGamepadButtonDown|bool|(int gamepad, int button);|
|
||||||
|
IsGamepadButtonReleased|bool|(int gamepad, int button);|
|
||||||
|
IsGamepadButtonUp|bool|(int gamepad, int button);|
|
||||||
|
GetGamepadButtonPressed|int|(void);|
|
||||||
|
GetGamepadAxisCount|int|(int gamepad);|
|
||||||
|
GetGamepadAxisMovement|float|(int gamepad, int axis);|
|
||||||
|
IsMouseButtonPressed|bool|(int button);|
|
||||||
|
IsMouseButtonDown|bool|(int button);|
|
||||||
|
IsMouseButtonReleased|bool|(int button);|
|
||||||
|
IsMouseButtonUp|bool|(int button);|
|
||||||
|
GetMouseX|int|(void);|
|
||||||
|
GetMouseY|int|(void);|
|
||||||
|
GetMousePosition|Vector2|(void);|
|
||||||
|
SetMousePosition|void|(int x, int y);|
|
||||||
|
SetMouseOffset|void|(int offsetX, int offsetY);|
|
||||||
|
SetMouseScale|void|(float scaleX, float scaleY);|
|
||||||
|
GetMouseWheelMove|float|(void);|
|
||||||
|
GetTouchX|int|(void);|
|
||||||
|
GetTouchY|int|(void);|
|
||||||
|
GetTouchPosition|Vector2|(int index);|
|
||||||
|
SetGesturesEnabled|void|(unsigned int gestureFlags);|
|
||||||
|
IsGestureDetected|bool|(int gesture);|
|
||||||
|
GetGestureDetected|int|(void);|
|
||||||
|
GetTouchPointsCount|int|(void);|
|
||||||
|
GetGestureHoldDuration|float|(void);|
|
||||||
|
GetGestureDragVector|Vector2|(void);|
|
||||||
|
GetGestureDragAngle|float|(void);|
|
||||||
|
GetGesturePinchVector|Vector2|(void);|
|
||||||
|
GetGesturePinchAngle|float|(void);|
|
||||||
|
SetCameraMode|void|(Camera camera, int mode);|
|
||||||
|
UpdateCamera|void|(Camera *camera);|
|
||||||
|
SetCameraPanControl|void|(int panKey);|
|
||||||
|
SetCameraAltControl|void|(int altKey);|
|
||||||
|
SetCameraSmoothZoomControl|void|(int szKey);|
|
||||||
|
SetCameraMoveControls|void|(int frontKey, int backKey, int rightKey, int leftKey, int upKey, int downKey);|
|
||||||
|
DrawPixel|void|(int posX, int posY, Color color);|
|
||||||
|
DrawPixelV|void|(Vector2 position, Color color);|
|
||||||
|
DrawLine|void|(int startPosX, int startPosY, int endPosX, int endPosY, Color color);|
|
||||||
|
DrawLineV|void|(Vector2 startPos, Vector2 endPos, Color color);|
|
||||||
|
DrawLineEx|void|(Vector2 startPos, Vector2 endPos, float thick, Color color);|
|
||||||
|
DrawLineBezier|void|(Vector2 startPos, Vector2 endPos, float thick, Color color);|
|
||||||
|
DrawCircle|void|(int centerX, int centerY, float radius, Color color);|
|
||||||
|
DrawCircleSector|void|(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color);|
|
||||||
|
DrawCircleSectorLines|void|(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color); // Draw circle sector outline
|
||||||
|
DrawCircleGradient|void|(int centerX, int centerY, float radius, Color color1, Color color2);|
|
||||||
|
DrawCircleV|void|(Vector2 center, float radius, Color color);|
|
||||||
|
DrawCircleLines|void|(int centerX, int centerY, float radius, Color color);|
|
||||||
|
DrawRing|void|(Vector2 center, float innerRadius, float outerRadius, int startAngle, int endAngle, int segments, Color color);|
|
||||||
|
DrawRingLines|void|(Vector2 center, float innerRadius, float outerRadius, int startAngle, int endAngle, int segments, Color color);|
|
||||||
|
DrawRectangle|void|(int posX, int posY, int width, int height, Color color);|
|
||||||
|
DrawRectangleV|void|(Vector2 position, Vector2 size, Color color);|
|
||||||
|
DrawRectangleRec|void|(Rectangle rec, Color color);|
|
||||||
|
DrawRectanglePro|void|(Rectangle rec, Vector2 origin, float rotation, Color color);|
|
||||||
|
DrawRectangleGradientV|void|(int posX, int posY, int width, int height, Color color1, Color color2);|
|
||||||
|
DrawRectangleGradientH|void|(int posX, int posY, int width, int height, Color color1, Color color2);|
|
||||||
|
DrawRectangleGradientEx|void|(Rectangle rec, Color col1, Color col2, Color col3, Color col4);|
|
||||||
|
DrawRectangleLines|void|(int posX, int posY, int width, int height, Color color);|
|
||||||
|
DrawRectangleLinesEx|void|(Rectangle rec, int lineThick, Color color);|
|
||||||
|
DrawRectangleRounded|void|(Rectangle rec, float roundness, int segments, Color color);|
|
||||||
|
DrawRectangleRoundedLines|void|(Rectangle rec, float roundness, int segments, int lineThick, Color color);|
|
||||||
|
DrawTriangle|void|(Vector2 v1, Vector2 v2, Vector2 v3, Color color);|
|
||||||
|
DrawTriangleLines|void|(Vector2 v1, Vector2 v2, Vector2 v3, Color color);|
|
||||||
|
DrawPoly|void|(Vector2 center, int sides, float radius, float rotation, Color color);|
|
||||||
|
DrawPolyEx|void|(Vector2 *points, int numPoints, Color color);|
|
||||||
|
DrawPolyExLines|void|(Vector2 *points, int numPoints, Color color);|
|
||||||
|
SetShapesTexture|void|(Texture2D texture, Rectangle source);|
|
||||||
|
CheckCollisionRecs|bool|(Rectangle rec1, Rectangle rec2);|
|
||||||
|
CheckCollisionCircles|bool|(Vector2 center1, float radius1, Vector2 center2, float radius2);|
|
||||||
|
CheckCollisionCircleRec|bool|(Vector2 center, float radius, Rectangle rec);|
|
||||||
|
GetCollisionRec|Rectangle|(Rectangle rec1, Rectangle rec2);|
|
||||||
|
CheckCollisionPointRec|bool|(Vector2 point, Rectangle rec);|
|
||||||
|
CheckCollisionPointCircle|bool|(Vector2 point, Vector2 center, float radius);|
|
||||||
|
CheckCollisionPointTriangle|bool|(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3);|
|
||||||
|
LoadImage|Image|(const char *fileName);|
|
||||||
|
LoadImageEx|Image|(Color *pixels, int width, int height);|
|
||||||
|
LoadImagePro|Image|(void *data, int width, int height, int format);|
|
||||||
|
LoadImageRaw|Image|(const char *fileName, int width, int height, int format, int headerSize);|
|
||||||
|
ExportImage|void|(Image image, const char *fileName);|
|
||||||
|
ExportImageAsCode|void|(Image image, const char *fileName);|
|
||||||
|
LoadTexture|Texture2D|(const char *fileName);|
|
||||||
|
LoadTextureFromImage|Texture2D|(Image image);|
|
||||||
|
LoadTextureCubemap|TextureCubemap|(Image image, int layoutType);|
|
||||||
|
LoadRenderTexture|RenderTexture2D|(int width, int height);|
|
||||||
|
UnloadImage|void|(Image image);|
|
||||||
|
UnloadTexture|void|(Texture2D texture);|
|
||||||
|
UnloadRenderTexture|void|(RenderTexture2D target);|
|
||||||
|
GetImageData|Color *|(Image image);|
|
||||||
|
GetImageDataNormalized|Vector4 *|(Image image);|
|
||||||
|
GetPixelDataSize|int|(int width, int height, int format);|
|
||||||
|
GetTextureData|Image|(Texture2D texture);|
|
||||||
|
GetScreenData|Image|(void);|
|
||||||
|
UpdateTexture|void|(Texture2D texture, const void *pixels);|
|
||||||
|
ImageCopy|Image|(Image image);|
|
||||||
|
ImageToPOT|void|(Image *image, Color fillColor);|
|
||||||
|
ImageFormat|void|(Image *image, int newFormat);|
|
||||||
|
ImageAlphaMask|void|(Image *image, Image alphaMask);|
|
||||||
|
ImageAlphaClear|void|(Image *image, Color color, float threshold);
|
||||||
|
ImageAlphaCrop|void|(Image *image, float threshold);|
|
||||||
|
ImageAlphaPremultiply|void|(Image *image);|
|
||||||
|
ImageCrop|void|(Image *image, Rectangle crop);|
|
||||||
|
ImageResize|void|(Image *image, int newWidth, int newHeight);|
|
||||||
|
ImageResizeNN|void|(Image *image, int newWidth,int newHeight);|void|
|
||||||
|
ImageResizeCanvas|void|(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color color);|
|
||||||
|
ImageMipmaps|void|(Image *image);|
|
||||||
|
ImageDither|void|(Image *image, int rBpp, int gBpp, int bBpp, int aBpp);|
|
||||||
|
ImageExtractPalette|Color *|(Image image, int maxPaletteSize, int *extractCount);|
|
||||||
|
ImageText|Image|(const char *text, int fontSize, Color color);|
|
||||||
|
ImageTextEx|Image|(Font font, const char *text, float fontSize, float spacing, Color tint);|
|
||||||
|
ImageDraw|void|(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec);|
|
||||||
|
ImageDrawRectangle|void|(Image *dst, Rectangle rec, Color color);|
|
||||||
|
ImageDrawRectangleLines|void|(Image *dst, Rectangle rec, int thick, Color color);|
|
||||||
|
ImageDrawText|void|(Image *dst, Vector2 position, const char *text, int fontSize, Color color);|
|
||||||
|
ImageDrawTextEx|void|(Image *dst, Vector2 position, Font font, const char *text, float fontSize, float spacing, Color color);|
|
||||||
|
ImageFlipVertical|void|(Image *image);|
|
||||||
|
ImageFlipHorizontal|void|(Image *image);|
|
||||||
|
ImageRotate|void|(Image *image, int degrees);|
|
||||||
|
ImageRotateCW|void|(Image *image);|
|
||||||
|
ImageRotateCCW|void|(Image *image);|
|
||||||
|
ImageColorTint|void|(Image *image, Color color);|
|
||||||
|
ImageColorInvert|void|(Image *image);|
|
||||||
|
ImageColorGrayscale|void|(Image *image);|
|
||||||
|
ImageColorContrast|void|(Image *image, float contrast);|
|
||||||
|
ImageColorBrightness|void|(Image *image, int brightness);|
|
||||||
|
ImageColorReplace|void|(Image *image, Color color, Color replace);|
|
||||||
|
GenImageColor|Image|(int width, int height, Color color);|
|
||||||
|
GenImageGradientLinear|Image|(int width, int height, int direction, Color start, Color end);|
|
||||||
|
GenImageGradientRadial|Image|(int width, int height, float density, Color inner, Color outer);|
|
||||||
|
GenImageGradientSquare|Image|(int width, int height, float density, Color inner, Color outer);|
|
||||||
|
GenImageChecked|Image|(int width, int height, int checksX, int checksY, Color col1, Color col2);|
|
||||||
|
GenImageWhiteNoise|Image|(int width, int height, float factor);|
|
||||||
|
GenImagePerlinNoise|Image|(int width, int height, int offsetX, int offsetY, float scale);|
|
||||||
|
GenImageCellular|Image|(int width, int height, int tileSize);|
|
||||||
|
GenTextureMipmaps|void|(Texture2D *texture);|
|
||||||
|
SetTextureFilter|void|(Texture2D texture, int filterMode);|
|
||||||
|
SetTextureWrap|void|(Texture2D texture, int wrapMode);|
|
||||||
|
DrawTexture|void|(Texture2D texture, int posX, int posY, Color tint);|
|
||||||
|
DrawTextureV|void|(Texture2D texture, Vector2 position, Color tint);|
|
||||||
|
DrawTextureEx|void|(Texture2D texture, Vector2 position, float rotation, float scale, Color tint);|
|
||||||
|
DrawTextureRec|void|(Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint);|
|
||||||
|
DrawTextureQuad|void|(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint);|
|
||||||
|
DrawTexturePro|void|(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, Color tint);|
|
||||||
|
DrawTextureNPatch|void|(Texture2D texture, NPatchInfo nPatchInfo, Rectangle destRec, Vector2 origin, float rotation, Color tint);|
|
||||||
|
GetFontDefault|Font|(void);|
|
||||||
|
LoadFont|Font|(const char *fileName);|
|
||||||
|
LoadFontEx|Font|(const char *fileName, int fontSize, int *fontChars, int charsCount);|
|
||||||
|
LoadFontFromImage|Font|(Image image, Color key, int firstChar);|
|
||||||
|
LoadFontData|CharInfo *|(const char *fileName, int fontSize, int *fontChars, int charsCount, int type);|
|
||||||
|
GenImageFontAtlas|Image|(CharInfo *chars, int charsCount, int fontSize, int padding, int packMethod);|
|
||||||
|
UnloadFont|void|(Font font);|
|
||||||
|
DrawFPS|void|(int posX, int posY);|
|
||||||
|
DrawText|void|(const char *text, int posX, int posY, int fontSize, Color color);|
|
||||||
|
DrawTextEx|void|(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint);|
|
||||||
|
DrawTextRec|void|(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint);|
|
||||||
|
DrawTextRecEx|void|(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint, int selectStart, int selectLength, Color selectText, Color selectBack);|
|
||||||
|
MeasureText|int|(const char *text, int fontSize);|
|
||||||
|
MeasureTextEx|Vector2|(Font font, const char *text, float fontSize, float spacing);|
|
||||||
|
GetGlyphIndex|int|(Font font, int character);|
|
||||||
|
TextIsEqual|bool|(const char *text1, const char *text2);|
|
||||||
|
TextLength|unsigned int|(const char *text);|
|
||||||
|
TextFormat|const char *|(const char *text, ...);|
|
||||||
|
TextSubtext|const char *|(const char *text, int position, int length);|
|
||||||
|
TextReplace|const char *|(char *text, const char *replace, const char *by);|
|
||||||
|
TextInsert|const char *|(const char *text, const char *insert, int position);|
|
||||||
|
TextJoin|const char *|(const char **textList, int count, const char *delimiter);|
|
||||||
|
TextSplit|const char **|(const char *text, char delimiter, int *count);|
|
||||||
|
TextAppend|void|(char *text, const char *append, int *position);|
|
||||||
|
TextFindIndex|int|(const char *text, const char *find);|
|
||||||
|
TextToUpper|const char *|(const char *text);|
|
||||||
|
TextToLower|const char *|(const char *text);|
|
||||||
|
TextToPascal|const char *|(const char *text);|
|
||||||
|
TextToInteger|int|(const char *text);|
|
||||||
|
DrawLine3D|void|(Vector3 startPos, Vector3 endPos, Color color);|
|
||||||
|
DrawCircle3D|void|(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color);|
|
||||||
|
DrawCube|void|(Vector3 position, float width, float height, float length, Color color);|
|
||||||
|
DrawCubeV|void|(Vector3 position, Vector3 size, Color color);|
|
||||||
|
DrawCubeWires|void|(Vector3 position, float width, float height, float length, Color color);|
|
||||||
|
DrawCubeWiresV|void|(Vector3 position, Vector3 size, Color color);|
|
||||||
|
DrawCubeTexture|void|(Texture2D texture, Vector3 position, float width, float height, float length, Color color);|
|
||||||
|
DrawSphere|void|(Vector3 centerPos, float radius, Color color);|
|
||||||
|
DrawSphereEx|void|(Vector3 centerPos, float radius, int rings, int slices, Color color);|
|
||||||
|
DrawSphereWires|void|(Vector3 centerPos, float radius, int rings, int slices, Color color);|
|
||||||
|
DrawCylinder|void|(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color);|
|
||||||
|
DrawCylinderWires|void|(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color);|
|
||||||
|
DrawPlane|void|(Vector3 centerPos, Vector2 size, Color color);|
|
||||||
|
DrawRay|void|(Ray ray, Color color);|
|
||||||
|
DrawGrid|void|(int slices, float spacing);|
|
||||||
|
DrawGizmo|void|(Vector3 position);|
|
||||||
|
LoadModel|Model|(const char *fileName);|
|
||||||
|
LoadModelFromMesh|Model|(Mesh mesh);|
|
||||||
|
UnloadModel|void|(Model model);|
|
||||||
|
LoadMeshes|Mesh *|(const char *fileName, int *meshCount);|
|
||||||
|
ExportMesh|void|(Mesh mesh, const char *fileName);|
|
||||||
|
UnloadMesh|void|(Mesh *mesh);|
|
||||||
|
LoadMaterials|Material *|(const char *fileName, int *materialCount);|
|
||||||
|
LoadMaterialDefault|Material|(void);|
|
||||||
|
UnloadMaterial|void|(Material material);|
|
||||||
|
SetMaterialTexture|void|(Material *material, int mapType, Texture2D texture);|
|
||||||
|
SetModelMeshMaterial|void|(Model *model, int meshId, int materialId);|
|
||||||
|
LoadModelAnimations|ModelAnimation *|(const char *fileName, int *animsCount);|
|
||||||
|
UpdateModelAnimation|void|(Model model, ModelAnimation anim, int frame);|
|
||||||
|
UnloadModelAnimation|void|(ModelAnimation anim);|
|
||||||
|
IsModelAnimationValid|bool|(Model model, ModelAnimation anim);|
|
||||||
|
GenMeshPoly|Mesh|(int sides, float radius);|
|
||||||
|
GenMeshPlane|Mesh|(float width, float length, int resX, int resZ);|
|
||||||
|
GenMeshCube|Mesh|(float width, float height, float length);|
|
||||||
|
GenMeshSphere|Mesh|(float radius, int rings, int slices);|
|
||||||
|
GenMeshHemiSphere|Mesh|(float radius, int rings, int slices);|
|
||||||
|
GenMeshCylinder|Mesh|(float radius, float height, int slices);|
|
||||||
|
GenMeshTorus|Mesh|(float radius, float size, int radSeg, int sides);|
|
||||||
|
GenMeshKnot|Mesh|(float radius, float size, int radSeg, int sides);|
|
||||||
|
GenMeshHeightmap|Mesh|(Image heightmap, Vector3 size);|
|
||||||
|
GenMeshCubicmap|Mesh|(Image cubicmap, Vector3 cubeSize);|
|
||||||
|
GetMeshBoundingBox|BoundingBox|(Mesh mesh);|
|
||||||
|
MeshTangents|void|(Mesh *mesh);|
|
||||||
|
MeshBinormals|void|(Mesh *mesh);|
|
||||||
|
DrawModel|void|(Model model, Vector3 position, float scale, Color tint);|
|
||||||
|
DrawModelEx|void|(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint);|
|
||||||
|
DrawModelWires|void|(Model model, Vector3 position, float scale, Color tint);|
|
||||||
|
DrawModelWiresEx|void|(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint);|
|
||||||
|
DrawBoundingBox|void|(BoundingBox box, Color color);|
|
||||||
|
DrawBillboard|void|(Camera camera, Texture2D texture, Vector3 center, float size, Color tint);|
|
||||||
|
DrawBillboardRec|void|(Camera camera, Texture2D texture, Rectangle sourceRec, Vector3 center, float size, Color tint);|
|
||||||
|
CheckCollisionSpheres|bool|(Vector3 centerA, float radiusA, Vector3 centerB, float radiusB);|
|
||||||
|
CheckCollisionBoxes|bool|(BoundingBox box1, BoundingBox box2);|
|
||||||
|
CheckCollisionBoxSphere|bool|(BoundingBox box, Vector3 centerSphere, float radiusSphere);|
|
||||||
|
CheckCollisionRaySphere|bool|(Ray ray, Vector3 spherePosition, float sphereRadius);|
|
||||||
|
CheckCollisionRaySphereEx|bool|(Ray ray, Vector3 spherePosition, float sphereRadius, Vector3 *collisionPoint);|
|
||||||
|
CheckCollisionRayBox|bool|(Ray ray, BoundingBox box);|
|
||||||
|
GetCollisionRayModel|RayHitInfo|(Ray ray, Model *model);|
|
||||||
|
GetCollisionRayTriangle|RayHitInfo|(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3);|
|
||||||
|
GetCollisionRayGround|RayHitInfo|(Ray ray, float groundHeight);|
|
||||||
|
LoadText|char *|(const char *fileName);|
|
||||||
|
LoadShader|Shader|(const char *vsFileName, const char *fsFileName);|
|
||||||
|
LoadShaderCode|Shader|(char *vsCode, char *fsCode);|
|
||||||
|
UnloadShader|void|(Shader shader);|
|
||||||
|
GetShaderDefault|Shader|(void);|
|
||||||
|
GetTextureDefault|Texture2D|(void);|
|
||||||
|
GetShaderLocation|int|(Shader shader, const char *uniformName);|
|
||||||
|
SetShaderValue|void|(Shader shader, int uniformLoc, const void *value, int uniformType);|
|
||||||
|
SetShaderValueV|void|(Shader shader, int uniformLoc, const void *value, int uniformType, int count);|
|
||||||
|
SetShaderValueMatrix|void|(Shader shader, int uniformLoc, Matrix mat);|
|
||||||
|
SetShaderValueTexture|void|(Shader shader, int uniformLoc, Texture2D texture);|
|
||||||
|
SetMatrixProjection|void|(Matrix proj);|
|
||||||
|
SetMatrixModelview|void|(Matrix view);|
|
||||||
|
GetMatrixModelview|Matrix|();|
|
||||||
|
BeginShaderMode|void|(Shader shader);|
|
||||||
|
EndShaderMode|void|(void);|
|
||||||
|
BeginBlendMode|void|(int mode);|
|
||||||
|
EndBlendMode|void|(void);|
|
||||||
|
BeginScissorMode|void|(int x, int y, int width, int height);|
|
||||||
|
EndScissorMode|void|(void);|
|
||||||
|
InitVrSimulator|void|(void);|
|
||||||
|
CloseVrSimulator|void|(void);|
|
||||||
|
UpdateVrTracking|void|(Camera *camera);|
|
||||||
|
SetVrConfiguration|void|(VrDeviceInfo info, Shader distortion);|
|
||||||
|
IsVrSimulatorReady|bool|(void);|
|
||||||
|
ToggleVrMode|void|(void);|
|
||||||
|
BeginVrDrawing|void|(void);|
|
||||||
|
EndVrDrawing|void|(void);|
|
||||||
|
InitAudioDevice|void|(void);|
|
||||||
|
CloseAudioDevice|void|(void);|
|
||||||
|
IsAudioDeviceReady|bool|(void);|
|
||||||
|
SetMasterVolume|void|(float volume);|
|
||||||
|
LoadWave|Wave|(const char *fileName);|
|
||||||
|
LoadWaveEx|Wave|(void *data, int sampleCount, int sampleRate, int sampleSize, int channels);|
|
||||||
|
LoadSound|Sound|(const char *fileName);|
|
||||||
|
LoadSoundFromWave|Sound|(Wave wave);|
|
||||||
|
UpdateSound|void|(Sound sound, const void *data, int samplesCount);|
|
||||||
|
UnloadWave|void|(Wave wave);|
|
||||||
|
UnloadSound|void|(Sound sound);|
|
||||||
|
ExportWave|void|(Wave wave, const char *fileName);|
|
||||||
|
ExportWaveAsCode|void|(Wave wave, const char *fileName);|
|
||||||
|
PlaySound|void|(Sound sound);|
|
||||||
|
PauseSound|void|(Sound sound);|
|
||||||
|
ResumeSound|void|(Sound sound);|
|
||||||
|
StopSound|void|(Sound sound);|
|
||||||
|
IsSoundPlaying|bool|(Sound sound);|
|
||||||
|
SetSoundVolume|void|(Sound sound, float volume);|
|
||||||
|
SetSoundPitch|void|(Sound sound, float pitch);|
|
||||||
|
WaveFormat|void|(Wave *wave, int sampleRate, int sampleSize, int channels);|
|
||||||
|
WaveCopy|Wave|(Wave wave);|
|
||||||
|
WaveCrop|void|(Wave *wave, int initSample, int finalSample);|
|
||||||
|
GetWaveData|float *|(Wave wave);|
|
||||||
|
LoadMusicStream|Music|(const char *fileName);|
|
||||||
|
UnloadMusicStream|void|(Music music);|
|
||||||
|
PlayMusicStream|void|(Music music);|
|
||||||
|
UpdateMusicStream|void|(Music music);|
|
||||||
|
StopMusicStream|void|(Music music);|
|
||||||
|
PauseMusicStream|void|(Music music);|
|
||||||
|
ResumeMusicStream|void|(Music music);|
|
||||||
|
IsMusicPlaying|bool|(Music music);|
|
||||||
|
SetMusicVolume|void|(Music music, float volume);|
|
||||||
|
SetMusicPitch|void|(Music music, float pitch);|
|
||||||
|
SetMusicLoopCount|void|(Music music, int count);|
|
||||||
|
GetMusicTimeLength|float|(Music music);|
|
||||||
|
GetMusicTimePlayed|float|(Music music);|
|
||||||
|
InitAudioStream|AudioStream|(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels);|
|
||||||
|
UpdateAudioStream|void|(AudioStream stream, const void *data, int samplesCount);|
|
||||||
|
CloseAudioStream|void|(AudioStream stream);|
|
||||||
|
IsAudioBufferProcessed|bool|(AudioStream stream);|
|
||||||
|
PlayAudioStream|void|(AudioStream stream);|
|
||||||
|
PauseAudioStream|void|(AudioStream stream);|
|
||||||
|
ResumeAudioStream|void|(AudioStream stream);|
|
||||||
|
IsAudioStreamPlaying|bool|(AudioStream stream);|
|
||||||
|
StopAudioStream|void|(AudioStream stream);|
|
||||||
|
SetAudioStreamVolume|void|(AudioStream stream, float volume);|
|
||||||
|
SetAudioStreamPitch|void|(AudioStream stream, float pitch);|
|
||||||
|
Vector2|struct||
|
||||||
|
Vector3|struct||
|
||||||
|
Vector4|struct||
|
||||||
|
Quaternion|struct||
|
||||||
|
Matrix|struct||
|
||||||
|
Color|struct||
|
||||||
|
Rectangle|struct||
|
||||||
|
Image|struct||
|
||||||
|
Texture|struct||
|
||||||
|
RenderTexture|struct||
|
||||||
|
NPatchInfo|struct||
|
||||||
|
CharInfo|struct||
|
||||||
|
Font|struct||
|
||||||
|
Camera|struct||
|
||||||
|
Camera2D|struct||
|
||||||
|
Mesh|struct||
|
||||||
|
Shader|struct||
|
||||||
|
MaterialMap|struct||
|
||||||
|
Material|struct||
|
||||||
|
Model|struct||
|
||||||
|
Transform|struct||
|
||||||
|
BoneInfo|struct||
|
||||||
|
ModelAnimation|struct||
|
||||||
|
Ray|struct||
|
||||||
|
RayHitInfo|struct||
|
||||||
|
BoundingBox|struct||
|
||||||
|
Wave|struct||
|
||||||
|
Sound|struct||
|
||||||
|
Music|struct||
|
||||||
|
AudioStream|struct||
|
||||||
|
VrDeviceInfo|struct||
|
||||||
|
LIGHTGRAY|#define||
|
||||||
|
GRAY|#define||
|
||||||
|
DARKGRAY|#define||
|
||||||
|
YELLOW|#define||
|
||||||
|
GOLD|#define||
|
||||||
|
ORANGE|#define||
|
||||||
|
PINK|#define||
|
||||||
|
RED|#define||
|
||||||
|
MAROON|#define||
|
||||||
|
GREEN|#define||
|
||||||
|
LIME|#define||
|
||||||
|
DARKGREEN|#define||
|
||||||
|
SKYBLUE|#define||
|
||||||
|
BLUE|#define||
|
||||||
|
DARKBLUE|#define||
|
||||||
|
PURPLE|#define||
|
||||||
|
VIOLET|#define||
|
||||||
|
DARKPURPLE|#define||
|
||||||
|
BEIGE|#define||
|
||||||
|
BROWN|#define||
|
||||||
|
DARKBROWN|#define||
|
||||||
|
WHITE|#define||
|
||||||
|
BLACK|#define||
|
||||||
|
BLANK|#define||
|
||||||
|
MAGENTA|#define||
|
||||||
|
RAYWHITE|#define||
|
21
3party/raylib/projects/Geany/raylib_compile_execute.bat
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
::@echo off
|
||||||
|
:: > Setup required Environment
|
||||||
|
:: -------------------------------------
|
||||||
|
set RAYLIB_DIR=C:\raylib
|
||||||
|
set COMPILER_DIR=C:\raylib\mingw\bin
|
||||||
|
set PATH=%PATH%;%COMPILER_DIR%
|
||||||
|
set FILE_NAME=%1
|
||||||
|
set NAME_PART=%FILE_NAME:~0,-2%
|
||||||
|
cd %~dp0
|
||||||
|
:: .
|
||||||
|
:: > Cleaning latest build
|
||||||
|
:: ---------------------------
|
||||||
|
cmd /c if exist %NAME_PART%.exe del /F %NAME_PART%.exe
|
||||||
|
:: .
|
||||||
|
:: > Compiling program
|
||||||
|
:: --------------------------
|
||||||
|
gcc -o %NAME_PART%.exe %FILE_NAME% %RAYLIB_DIR%\src\raylib.rc.data -s -O2 -I../../src -Iexternal -lraylib -lopengl32 -lgdi32 -lwinmm -std=c99 -Wall -mwindows
|
||||||
|
:: .
|
||||||
|
:: . > Executing program
|
||||||
|
:: -------------------------
|
||||||
|
cmd /c if exist %NAME_PART%.exe %NAME_PART%.exe
|
42
3party/raylib/projects/Geany/raylib_compile_sources.bat
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
::@echo off
|
||||||
|
:: > Choose compile options
|
||||||
|
:: -------------------------------
|
||||||
|
:: Set desired OpenGL API version: 1.1, 2.1, 3.3
|
||||||
|
set GRAPHICS_API=GRAPHICS_API_OPENGL_33
|
||||||
|
:: .
|
||||||
|
:: > Setup required Environment
|
||||||
|
:: -------------------------------------
|
||||||
|
set RAYLIB_DIR=C:\raylib
|
||||||
|
set COMPILER_DIR=C:\raylib\mingw\bin
|
||||||
|
set PATH=%PATH%;%COMPILER_DIR%
|
||||||
|
cd %RAYLIB_DIR%\raylib\src
|
||||||
|
:: .
|
||||||
|
:: > Cleaning latest build
|
||||||
|
:: ---------------------------
|
||||||
|
cmd /c del /F *.o
|
||||||
|
cmd /c del /F libraylib.a
|
||||||
|
:: .
|
||||||
|
:: > Compile raylib modules
|
||||||
|
:: ------------------------------
|
||||||
|
gcc -O2 -c rglfw.c -Wall -I. -Iexternal/glfw/include
|
||||||
|
gcc -O2 -c rcore.c -std=c99 -Wall -Iexternal/glfw/include -DPLATFORM_DESKTOP -D%GRAPHICS_API%
|
||||||
|
gcc -O2 -c rshapes.c -std=c99 -Wall -DPLATFORM_DESKTOP
|
||||||
|
gcc -O2 -c rtextures.c -std=c99 -Wall -DPLATFORM_DESKTOP
|
||||||
|
gcc -O2 -c rtext.c -std=c99 -Wall -DPLATFORM_DESKTOP
|
||||||
|
gcc -O2 -c rmodels.c -std=c99 -Wall -DPLATFORM_DESKTOP
|
||||||
|
gcc -O2 -c raudio.c -std=c99 -Wall -DPLATFORM_DESKTOP
|
||||||
|
gcc -O2 -c utils.c -std=c99 -Wall -DPLATFORM_DESKTOP
|
||||||
|
|
||||||
|
:: .
|
||||||
|
:: . > Generate raylib library
|
||||||
|
:: ------------------------------
|
||||||
|
ar rcs libraylib.a rcore.o rglfw.o rshapes.o rtextures.o rtext.o rmodels.o raudio.o utils.o
|
||||||
|
:: .
|
||||||
|
:: > Installing raylib library
|
||||||
|
:: -----------------------------
|
||||||
|
cmd /c copy raylib.h %RAYLIB_DIR%\mingw\i686-w64-mingw32\include /Y
|
||||||
|
cmd /c copy libraylib.a %RAYLIB_DIR%\mingw\i686-w64-mingw32\lib /Y
|
||||||
|
:: .
|
||||||
|
:: > Restore environment
|
||||||
|
:: -----------------------------
|
||||||
|
cd %~dp0
|
41
3party/raylib/projects/Geany/raylib_project.geany
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
[editor]
|
||||||
|
line_wrapping=false
|
||||||
|
line_break_column=72
|
||||||
|
auto_continue_multiline=true
|
||||||
|
|
||||||
|
[file_prefs]
|
||||||
|
final_new_line=true
|
||||||
|
ensure_convert_new_lines=false
|
||||||
|
strip_trailing_spaces=false
|
||||||
|
replace_tabs=true
|
||||||
|
|
||||||
|
[indentation]
|
||||||
|
indent_width=4
|
||||||
|
indent_type=0
|
||||||
|
indent_hard_tab_width=8
|
||||||
|
detect_indent=false
|
||||||
|
detect_indent_width=false
|
||||||
|
indent_mode=2
|
||||||
|
|
||||||
|
[project]
|
||||||
|
name=raylib_project
|
||||||
|
base_path=./
|
||||||
|
description=raylib project template
|
||||||
|
file_patterns=
|
||||||
|
|
||||||
|
[long line marker]
|
||||||
|
long_line_behaviour=1
|
||||||
|
long_line_column=72
|
||||||
|
|
||||||
|
[files]
|
||||||
|
current_page=0
|
||||||
|
FILE_NAME_0=0;C;0;EUTF-8;1;1;0;C%3A%5CGitHub%5Craylib%5Cprojects%5CGeany%5Ccore_basic_window.c;0;4
|
||||||
|
|
||||||
|
[build-menu]
|
||||||
|
filetypes=C;
|
||||||
|
EX_00_LB=_Execute
|
||||||
|
EX_00_CM="./%e"
|
||||||
|
EX_00_WD=
|
||||||
|
CFT_00_LB=_Compile
|
||||||
|
CFT_00_CM=raylib_compile_execute.bat %f
|
||||||
|
CFT_00_WD=
|
19
3party/raylib/projects/Notepad++/README.md
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
### Notepad++ raylib config files
|
||||||
|
|
||||||
|
This folder includes some useful files to config Notepad++ for raylib.
|
||||||
|
|
||||||
|
#### raylib functions autocomplete - c_raylib.xml
|
||||||
|
|
||||||
|
Autocomplete information for Notepad++. The contents of this file should be copied inside raylib\Notepad++\plugins\APIs\c.xml file.
|
||||||
|
|
||||||
|
This file has been automatically generated using the provided tool: `raylib_npp_parser`
|
||||||
|
|
||||||
|
This simple tool basically parses raylib.h header for functions starting by RLAPI, extracts all required information and generates de Notepad++ autocomplete XML equivalent.
|
||||||
|
|
||||||
|
To use the tool, just drag and drop raylib.h over raylib_npp_parser program.
|
||||||
|
|
||||||
|
#### Notepad++ NppExec compilation scripts - npes_saved.txt
|
||||||
|
|
||||||
|
A series of scripts for Notepad++ NppExec plugin to compile raylib library and examples.
|
||||||
|
|
||||||
|
|
BIN
3party/raylib/projects/Notepad++/npes_saved_mingw.txt
Normal file
BIN
3party/raylib/projects/Notepad++/npes_saved_tcc.txt
Normal file
BIN
3party/raylib/projects/Notepad++/npes_saved_w64devkit.txt
Normal file
BIN
3party/raylib/projects/Notepad++/npes_saved_zig.txt
Normal file
3235
3party/raylib/projects/Notepad++/raylib_npp_parser/raylib_npp.xml
Normal file
@ -0,0 +1,150 @@
|
|||||||
|
/**********************************************************************************************
|
||||||
|
|
||||||
|
raylib_npp_parser - raylib header parser to generate Notepad++ autocompletion data
|
||||||
|
|
||||||
|
This parser scans raylib.h for functions that start with RLAPI and generates Notepad++
|
||||||
|
autocompletion xml equivalent for function and parameters.
|
||||||
|
|
||||||
|
Converts:
|
||||||
|
RLAPI Color Fade(Color color, float alpha); // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f
|
||||||
|
|
||||||
|
To:
|
||||||
|
<KeyWord name="Fade" func="yes">
|
||||||
|
<Overload retVal="Color" descr="Color fade-in or fade-out, alpha goes from 0.0 to 1.0">
|
||||||
|
<Param name="Color color" />
|
||||||
|
<Param name="float alpha" />
|
||||||
|
</Overload>
|
||||||
|
</KeyWord>
|
||||||
|
|
||||||
|
NOTE: Generated XML text should be copied inside raylib\Notepad++\plugins\APIs\c.xml
|
||||||
|
|
||||||
|
WARNING: Be careful with functions that split parameters into several lines, it breaks the process!
|
||||||
|
|
||||||
|
LICENSE: zlib/libpng
|
||||||
|
|
||||||
|
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) 2018 Ramon Santamaria (@raysan5)
|
||||||
|
|
||||||
|
**********************************************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#define MAX_BUFFER_SIZE 512
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
if (argc > 1)
|
||||||
|
{
|
||||||
|
FILE *rFile = fopen(argv[1], "rt");
|
||||||
|
FILE *rxmlFile = fopen("raylib_npp.xml", "wt");
|
||||||
|
|
||||||
|
if ((rFile == NULL) || (rxmlFile == NULL))
|
||||||
|
{
|
||||||
|
printf("File could not be opened.\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *buffer = (char *)calloc(MAX_BUFFER_SIZE, 1);
|
||||||
|
int count = 0;
|
||||||
|
|
||||||
|
while (!feof(rFile))
|
||||||
|
{
|
||||||
|
// Read one full line
|
||||||
|
fgets(buffer, MAX_BUFFER_SIZE, rFile);
|
||||||
|
|
||||||
|
if (buffer[0] == '/') fprintf(rxmlFile, " <!--%.*s -->\n", strlen(buffer) - 3, buffer + 2);
|
||||||
|
else if (buffer[0] == '\n') fprintf(rxmlFile, "%s", buffer); // Direct copy of code comments
|
||||||
|
else if (strncmp(buffer, "RLAPI", 5) == 0) // raylib function declaration
|
||||||
|
{
|
||||||
|
char funcType[64];
|
||||||
|
char funcTypeAux[64];
|
||||||
|
char funcName[64];
|
||||||
|
char funcDesc[256];
|
||||||
|
|
||||||
|
char params[128];
|
||||||
|
char paramType[16][16];
|
||||||
|
char paramName[16][32];
|
||||||
|
|
||||||
|
int index = 0;
|
||||||
|
char *ptr = NULL;
|
||||||
|
|
||||||
|
sscanf(buffer, "RLAPI %s %[^(]s", funcType, funcName);
|
||||||
|
|
||||||
|
if (strcmp(funcType, "const") == 0)
|
||||||
|
{
|
||||||
|
sscanf(buffer, "RLAPI %s %s %[^(]s", funcType, funcTypeAux, funcName);
|
||||||
|
strcat(funcType, " ");
|
||||||
|
strcat(funcType, funcTypeAux);
|
||||||
|
}
|
||||||
|
|
||||||
|
ptr = strchr(buffer, '/');
|
||||||
|
index = (int)(ptr - buffer);
|
||||||
|
|
||||||
|
sscanf(buffer + index, "%[^\n]s", funcDesc); // Read function comment after declaration
|
||||||
|
|
||||||
|
ptr = strchr(buffer, '(');
|
||||||
|
|
||||||
|
if (ptr != NULL) index = (int)(ptr - buffer);
|
||||||
|
else printf("Character not found!\n");
|
||||||
|
|
||||||
|
sscanf(buffer + (index + 1), "%[^)]s", params); // Read what's inside '(' and ')'
|
||||||
|
|
||||||
|
// Scan params string for number of func params, type and name
|
||||||
|
char *paramPtr[16]; // Allocate 16 pointers for possible parameters
|
||||||
|
int paramsCount = 0;
|
||||||
|
paramPtr[paramsCount] = strtok(params, ",");
|
||||||
|
|
||||||
|
if ((funcName[0] == '*') && (funcName[1] == '*')) fprintf(rxmlFile, " <KeyWord name=\"%s\" func=\"yes\">\n", funcName + 2);
|
||||||
|
else if (funcName[0] == '*') fprintf(rxmlFile, " <KeyWord name=\"%s\" func=\"yes\">\n", funcName + 1);
|
||||||
|
else fprintf(rxmlFile, " <KeyWord name=\"%s\" func=\"yes\">\n", funcName);
|
||||||
|
|
||||||
|
fprintf(rxmlFile, " <Overload retVal=\"%s\" descr=\"%s\">", funcType, funcDesc + 3);
|
||||||
|
|
||||||
|
bool paramsVoid = false;
|
||||||
|
|
||||||
|
char paramConst[8][16];
|
||||||
|
|
||||||
|
while (paramPtr[paramsCount] != NULL)
|
||||||
|
{
|
||||||
|
sscanf(paramPtr[paramsCount], "%s %s\n", paramType[paramsCount], paramName[paramsCount]);
|
||||||
|
|
||||||
|
if (strcmp(paramType[paramsCount], "void") == 0)
|
||||||
|
{
|
||||||
|
paramsVoid = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((strcmp(paramType[paramsCount], "const") == 0) || (strcmp(paramType[paramsCount], "unsigned") == 0))
|
||||||
|
{
|
||||||
|
sscanf(paramPtr[paramsCount], "%s %s %s\n", paramConst[paramsCount], paramType[paramsCount], paramName[paramsCount]);
|
||||||
|
fprintf(rxmlFile, "\n <Param name=\"%s %s %s\" />", paramConst[paramsCount], paramType[paramsCount], paramName[paramsCount]);
|
||||||
|
}
|
||||||
|
else if (strcmp(paramType[paramsCount], "...") == 0) fprintf(rxmlFile, "\n <Param name=\"...\" />");
|
||||||
|
else fprintf(rxmlFile, "\n <Param name=\"%s %s\" />", paramType[paramsCount], paramName[paramsCount]);
|
||||||
|
|
||||||
|
paramsCount++;
|
||||||
|
paramPtr[paramsCount] = strtok(NULL, ",");
|
||||||
|
}
|
||||||
|
|
||||||
|
fprintf(rxmlFile, "%s</Overload>\n", paramsVoid ? "" : "\n ");
|
||||||
|
fprintf(rxmlFile, " </KeyWord>\n");
|
||||||
|
|
||||||
|
count++;
|
||||||
|
printf("Function processed %02i: %s\n", count, funcName);
|
||||||
|
|
||||||
|
memset(buffer, 0, MAX_BUFFER_SIZE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
free(buffer);
|
||||||
|
fclose(rFile);
|
||||||
|
fclose(rxmlFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
@ -0,0 +1,663 @@
|
|||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Window and Graphics Device Functions (Module: core)
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Window-related functions
|
||||||
|
RLAPI void InitWindow(int width, int height, const char *title); // Initialize window and OpenGL context
|
||||||
|
RLAPI bool WindowShouldClose(void); // Check if KEY_ESCAPE pressed or Close icon pressed
|
||||||
|
RLAPI void CloseWindow(void); // Close window and unload OpenGL context
|
||||||
|
RLAPI bool IsWindowReady(void); // Check if window has been initialized successfully
|
||||||
|
RLAPI bool IsWindowFullscreen(void); // Check if window is currently fullscreen
|
||||||
|
RLAPI bool IsWindowHidden(void); // Check if window is currently hidden (only PLATFORM_DESKTOP)
|
||||||
|
RLAPI bool IsWindowMinimized(void); // Check if window is currently minimized (only PLATFORM_DESKTOP)
|
||||||
|
RLAPI bool IsWindowMaximized(void); // Check if window is currently maximized (only PLATFORM_DESKTOP)
|
||||||
|
RLAPI bool IsWindowFocused(void); // Check if window is currently focused (only PLATFORM_DESKTOP)
|
||||||
|
RLAPI bool IsWindowResized(void); // Check if window has been resized last frame
|
||||||
|
RLAPI bool IsWindowState(unsigned int flag); // Check if one specific window flag is enabled
|
||||||
|
RLAPI void SetWindowState(unsigned int flags); // Set window configuration state using flags (only PLATFORM_DESKTOP)
|
||||||
|
RLAPI void ClearWindowState(unsigned int flags); // Clear window configuration state flags
|
||||||
|
RLAPI void ToggleFullscreen(void); // Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP)
|
||||||
|
RLAPI void MaximizeWindow(void); // Set window state: maximized, if resizable (only PLATFORM_DESKTOP)
|
||||||
|
RLAPI void MinimizeWindow(void); // Set window state: minimized, if resizable (only PLATFORM_DESKTOP)
|
||||||
|
RLAPI void RestoreWindow(void); // Set window state: not minimized/maximized (only PLATFORM_DESKTOP)
|
||||||
|
RLAPI void SetWindowIcon(Image image); // Set icon for window (single image, RGBA 32bit, only PLATFORM_DESKTOP)
|
||||||
|
RLAPI void SetWindowIcons(Image *images, int count); // Set icon for window (multiple images, RGBA 32bit, only PLATFORM_DESKTOP)
|
||||||
|
RLAPI void SetWindowTitle(const char *title); // Set title for window (only PLATFORM_DESKTOP)
|
||||||
|
RLAPI void SetWindowPosition(int x, int y); // Set window position on screen (only PLATFORM_DESKTOP)
|
||||||
|
RLAPI void SetWindowMonitor(int monitor); // Set monitor for the current window (fullscreen mode)
|
||||||
|
RLAPI void SetWindowMinSize(int width, int height); // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)
|
||||||
|
RLAPI void SetWindowSize(int width, int height); // Set window dimensions
|
||||||
|
RLAPI void SetWindowOpacity(float opacity); // Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP)
|
||||||
|
RLAPI void *GetWindowHandle(void); // Get native window handle
|
||||||
|
RLAPI int GetScreenWidth(void); // Get current screen width
|
||||||
|
RLAPI int GetScreenHeight(void); // Get current screen height
|
||||||
|
RLAPI int GetRenderWidth(void); // Get current render width (it considers HiDPI)
|
||||||
|
RLAPI int GetRenderHeight(void); // Get current render height (it considers HiDPI)
|
||||||
|
RLAPI int GetMonitorCount(void); // Get number of connected monitors
|
||||||
|
RLAPI int GetCurrentMonitor(void); // Get current connected monitor
|
||||||
|
RLAPI Vector2 GetMonitorPosition(int monitor); // Get specified monitor position
|
||||||
|
RLAPI int GetMonitorWidth(int monitor); // Get specified monitor width (current video mode used by monitor)
|
||||||
|
RLAPI int GetMonitorHeight(int monitor); // Get specified monitor height (current video mode used by monitor)
|
||||||
|
RLAPI int GetMonitorPhysicalWidth(int monitor); // Get specified monitor physical width in millimetres
|
||||||
|
RLAPI int GetMonitorPhysicalHeight(int monitor); // Get specified monitor physical height in millimetres
|
||||||
|
RLAPI int GetMonitorRefreshRate(int monitor); // Get specified monitor refresh rate
|
||||||
|
RLAPI Vector2 GetWindowPosition(void); // Get window position XY on monitor
|
||||||
|
RLAPI Vector2 GetWindowScaleDPI(void); // Get window scale DPI factor
|
||||||
|
RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the primary monitor
|
||||||
|
RLAPI void SetClipboardText(const char *text); // Set clipboard text content
|
||||||
|
RLAPI const char *GetClipboardText(void); // Get clipboard text content
|
||||||
|
RLAPI void EnableEventWaiting(void); // Enable waiting for events on EndDrawing(), no automatic event polling
|
||||||
|
RLAPI void DisableEventWaiting(void); // Disable waiting for events on EndDrawing(), automatic events polling
|
||||||
|
|
||||||
|
// Custom frame control functions
|
||||||
|
// NOTE: Those functions are intended for advance users that want full control over the frame processing
|
||||||
|
// By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timing + PollInputEvents()
|
||||||
|
// To avoid that behaviour and control frame processes manually, enable in config.h: SUPPORT_CUSTOM_FRAME_CONTROL
|
||||||
|
RLAPI void SwapScreenBuffer(void); // Swap back buffer with front buffer (screen drawing)
|
||||||
|
RLAPI void PollInputEvents(void); // Register all input events
|
||||||
|
RLAPI void WaitTime(double seconds); // Wait for some time (halt program execution)
|
||||||
|
|
||||||
|
// Cursor-related functions
|
||||||
|
RLAPI void ShowCursor(void); // Shows cursor
|
||||||
|
RLAPI void HideCursor(void); // Hides cursor
|
||||||
|
RLAPI bool IsCursorHidden(void); // Check if cursor is not visible
|
||||||
|
RLAPI void EnableCursor(void); // Enables cursor (unlock cursor)
|
||||||
|
RLAPI void DisableCursor(void); // Disables cursor (lock cursor)
|
||||||
|
RLAPI bool IsCursorOnScreen(void); // Check if cursor is on the screen
|
||||||
|
|
||||||
|
// Drawing-related functions
|
||||||
|
RLAPI void ClearBackground(Color color); // Set background color (framebuffer clear color)
|
||||||
|
RLAPI void BeginDrawing(void); // Setup canvas (framebuffer) to start drawing
|
||||||
|
RLAPI void EndDrawing(void); // End canvas drawing and swap buffers (double buffering)
|
||||||
|
RLAPI void BeginMode2D(Camera2D camera); // Begin 2D mode with custom camera (2D)
|
||||||
|
RLAPI void EndMode2D(void); // Ends 2D mode with custom camera
|
||||||
|
RLAPI void BeginMode3D(Camera3D camera); // Begin 3D mode with custom camera (3D)
|
||||||
|
RLAPI void EndMode3D(void); // Ends 3D mode and returns to default 2D orthographic mode
|
||||||
|
RLAPI void BeginTextureMode(RenderTexture2D target); // Begin drawing to render texture
|
||||||
|
RLAPI void EndTextureMode(void); // Ends drawing to render texture
|
||||||
|
RLAPI void BeginShaderMode(Shader shader); // Begin custom shader drawing
|
||||||
|
RLAPI void EndShaderMode(void); // End custom shader drawing (use default shader)
|
||||||
|
RLAPI void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied, subtract, custom)
|
||||||
|
RLAPI void EndBlendMode(void); // End blending mode (reset to default: alpha blending)
|
||||||
|
RLAPI void BeginScissorMode(int x, int y, int width, int height); // Begin scissor mode (define screen area for following drawing)
|
||||||
|
RLAPI void EndScissorMode(void); // End scissor mode
|
||||||
|
RLAPI void BeginVrStereoMode(VrStereoConfig config); // Begin stereo rendering (requires VR simulator)
|
||||||
|
RLAPI void EndVrStereoMode(void); // End stereo rendering (requires VR simulator)
|
||||||
|
|
||||||
|
// VR stereo config functions for VR simulator
|
||||||
|
RLAPI VrStereoConfig LoadVrStereoConfig(VrDeviceInfo device); // Load VR stereo config for VR simulator device parameters
|
||||||
|
RLAPI void UnloadVrStereoConfig(VrStereoConfig config); // Unload VR stereo config
|
||||||
|
|
||||||
|
// Shader management functions
|
||||||
|
// NOTE: Shader functionality is not available on OpenGL 1.1
|
||||||
|
RLAPI Shader LoadShader(const char *vsFileName, const char *fsFileName); // Load shader from files and bind default locations
|
||||||
|
RLAPI Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode); // Load shader from code strings and bind default locations
|
||||||
|
RLAPI bool IsShaderReady(Shader shader); // Check if a shader is ready
|
||||||
|
RLAPI int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location
|
||||||
|
RLAPI int GetShaderLocationAttrib(Shader shader, const char *attribName); // Get shader attribute location
|
||||||
|
RLAPI void SetShaderValue(Shader shader, int locIndex, const void *value, int uniformType); // Set shader uniform value
|
||||||
|
RLAPI void SetShaderValueV(Shader shader, int locIndex, const void *value, int uniformType, int count); // Set shader uniform value vector
|
||||||
|
RLAPI void SetShaderValueMatrix(Shader shader, int locIndex, Matrix mat); // Set shader uniform value (matrix 4x4)
|
||||||
|
RLAPI void SetShaderValueTexture(Shader shader, int locIndex, Texture2D texture); // Set shader uniform value for texture (sampler2d)
|
||||||
|
RLAPI void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM)
|
||||||
|
|
||||||
|
// Screen-space-related functions
|
||||||
|
RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Get a ray trace from mouse position
|
||||||
|
RLAPI Matrix GetCameraMatrix(Camera camera); // Get camera transform matrix (view matrix)
|
||||||
|
RLAPI Matrix GetCameraMatrix2D(Camera2D camera); // Get camera 2d transform matrix
|
||||||
|
RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Get the screen space position for a 3d world space position
|
||||||
|
RLAPI Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera); // Get the world space position for a 2d camera screen space position
|
||||||
|
RLAPI Vector2 GetWorldToScreenEx(Vector3 position, Camera camera, int width, int height); // Get size position for a 3d world space position
|
||||||
|
RLAPI Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera); // Get the screen space position for a 2d camera world space position
|
||||||
|
|
||||||
|
// Timing-related functions
|
||||||
|
RLAPI void SetTargetFPS(int fps); // Set target FPS (maximum)
|
||||||
|
RLAPI int GetFPS(void); // Get current FPS
|
||||||
|
RLAPI float GetFrameTime(void); // Get time in seconds for last frame drawn (delta time)
|
||||||
|
RLAPI double GetTime(void); // Get elapsed time in seconds since InitWindow()
|
||||||
|
|
||||||
|
// Misc. functions
|
||||||
|
RLAPI int GetRandomValue(int min, int max); // Get a random value between min and max (both included)
|
||||||
|
RLAPI void SetRandomSeed(unsigned int seed); // Set the seed for the random number generator
|
||||||
|
RLAPI void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (filename extension defines format)
|
||||||
|
RLAPI void SetConfigFlags(unsigned int flags); // Setup init configuration flags (view FLAGS)
|
||||||
|
|
||||||
|
RLAPI void TraceLog(int logLevel, const char *text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...)
|
||||||
|
RLAPI void SetTraceLogLevel(int logLevel); // Set the current threshold (minimum) log level
|
||||||
|
RLAPI void *MemAlloc(unsigned int size); // Internal memory allocator
|
||||||
|
RLAPI void *MemRealloc(void *ptr, unsigned int size); // Internal memory reallocator
|
||||||
|
RLAPI void MemFree(void *ptr); // Internal memory free
|
||||||
|
|
||||||
|
RLAPI void OpenURL(const char *url); // Open URL with default system browser (if available)
|
||||||
|
|
||||||
|
// Set custom callbacks
|
||||||
|
// WARNING: Callbacks setup is intended for advance users
|
||||||
|
RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set custom trace log
|
||||||
|
RLAPI void SetLoadFileDataCallback(LoadFileDataCallback callback); // Set custom file binary data loader
|
||||||
|
RLAPI void SetSaveFileDataCallback(SaveFileDataCallback callback); // Set custom file binary data saver
|
||||||
|
RLAPI void SetLoadFileTextCallback(LoadFileTextCallback callback); // Set custom file text data loader
|
||||||
|
RLAPI void SetSaveFileTextCallback(SaveFileTextCallback callback); // Set custom file text data saver
|
||||||
|
|
||||||
|
// Files management functions
|
||||||
|
RLAPI unsigned char *LoadFileData(const char *fileName, unsigned int *bytesRead); // Load file data as byte array (read)
|
||||||
|
RLAPI void UnloadFileData(unsigned char *data); // Unload file data allocated by LoadFileData()
|
||||||
|
RLAPI bool SaveFileData(const char *fileName, void *data, unsigned int bytesToWrite); // Save data to file from byte array (write), returns true on success
|
||||||
|
RLAPI bool ExportDataAsCode(const unsigned char *data, unsigned int size, const char *fileName); // Export data to code (.h), returns true on success
|
||||||
|
RLAPI char *LoadFileText(const char *fileName); // Load text data from file (read), returns a '\0' terminated string
|
||||||
|
RLAPI void UnloadFileText(char *text); // Unload file text data allocated by LoadFileText()
|
||||||
|
RLAPI bool SaveFileText(const char *fileName, char *text); // Save text data to file (write), string must be '\0' terminated, returns true on success
|
||||||
|
RLAPI bool FileExists(const char *fileName); // Check if file exists
|
||||||
|
RLAPI bool DirectoryExists(const char *dirPath); // Check if a directory path exists
|
||||||
|
RLAPI bool IsFileExtension(const char *fileName, const char *ext); // Check file extension (including point: .png, .wav)
|
||||||
|
RLAPI int GetFileLength(const char *fileName); // Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h)
|
||||||
|
RLAPI const char *GetFileExtension(const char *fileName); // Get pointer to extension for a filename string (includes dot: '.png')
|
||||||
|
RLAPI const char *GetFileName(const char *filePath); // Get pointer to filename for a path string
|
||||||
|
RLAPI const char *GetFileNameWithoutExt(const char *filePath); // Get filename string without extension (uses static string)
|
||||||
|
RLAPI const char *GetDirectoryPath(const char *filePath); // Get full path for a given fileName with path (uses static string)
|
||||||
|
RLAPI const char *GetPrevDirectoryPath(const char *dirPath); // Get previous directory path for a given path (uses static string)
|
||||||
|
RLAPI const char *GetWorkingDirectory(void); // Get current working directory (uses static string)
|
||||||
|
RLAPI const char *GetApplicationDirectory(void); // Get the directory if the running application (uses static string)
|
||||||
|
RLAPI bool ChangeDirectory(const char *dir); // Change working directory, return true on success
|
||||||
|
RLAPI bool IsPathFile(const char *path); // Check if a given path is a file or a directory
|
||||||
|
RLAPI FilePathList LoadDirectoryFiles(const char *dirPath); // Load directory filepaths
|
||||||
|
RLAPI FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdirs); // Load directory filepaths with extension filtering and recursive directory scan
|
||||||
|
RLAPI void UnloadDirectoryFiles(FilePathList files); // Unload filepaths
|
||||||
|
RLAPI bool IsFileDropped(void); // Check if a file has been dropped into window
|
||||||
|
RLAPI FilePathList LoadDroppedFiles(void); // Load dropped filepaths
|
||||||
|
RLAPI void UnloadDroppedFiles(FilePathList files); // Unload dropped filepaths
|
||||||
|
RLAPI long GetFileModTime(const char *fileName); // Get file modification time (last write time)
|
||||||
|
|
||||||
|
// Compression/Encoding functionality
|
||||||
|
RLAPI unsigned char *CompressData(const unsigned char *data, int dataSize, int *compDataSize); // Compress data (DEFLATE algorithm), memory must be MemFree()
|
||||||
|
RLAPI unsigned char *DecompressData(const unsigned char *compData, int compDataSize, int *dataSize); // Decompress data (DEFLATE algorithm), memory must be MemFree()
|
||||||
|
RLAPI char *EncodeDataBase64(const unsigned char *data, int dataSize, int *outputSize); // Encode data to Base64 string, memory must be MemFree()
|
||||||
|
RLAPI unsigned char *DecodeDataBase64(const unsigned char *data, int *outputSize); // Decode Base64 string data, memory must be MemFree()
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Input Handling Functions (Module: core)
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Input-related functions: keyboard
|
||||||
|
RLAPI bool IsKeyPressed(int key); // Check if a key has been pressed once
|
||||||
|
RLAPI bool IsKeyDown(int key); // Check if a key is being pressed
|
||||||
|
RLAPI bool IsKeyReleased(int key); // Check if a key has been released once
|
||||||
|
RLAPI bool IsKeyUp(int key); // Check if a key is NOT being pressed
|
||||||
|
RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC)
|
||||||
|
RLAPI int GetKeyPressed(void); // Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty
|
||||||
|
RLAPI int GetCharPressed(void); // Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty
|
||||||
|
|
||||||
|
// Input-related functions: gamepads
|
||||||
|
RLAPI bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available
|
||||||
|
RLAPI const char *GetGamepadName(int gamepad); // Get gamepad internal name id
|
||||||
|
RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Check if a gamepad button has been pressed once
|
||||||
|
RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Check if a gamepad button is being pressed
|
||||||
|
RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Check if a gamepad button has been released once
|
||||||
|
RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Check if a gamepad button is NOT being pressed
|
||||||
|
RLAPI int GetGamepadButtonPressed(void); // Get the last gamepad button pressed
|
||||||
|
RLAPI int GetGamepadAxisCount(int gamepad); // Get gamepad axis count for a gamepad
|
||||||
|
RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Get axis movement value for a gamepad axis
|
||||||
|
RLAPI int SetGamepadMappings(const char *mappings); // Set internal gamepad mappings (SDL_GameControllerDB)
|
||||||
|
|
||||||
|
// Input-related functions: mouse
|
||||||
|
RLAPI bool IsMouseButtonPressed(int button); // Check if a mouse button has been pressed once
|
||||||
|
RLAPI bool IsMouseButtonDown(int button); // Check if a mouse button is being pressed
|
||||||
|
RLAPI bool IsMouseButtonReleased(int button); // Check if a mouse button has been released once
|
||||||
|
RLAPI bool IsMouseButtonUp(int button); // Check if a mouse button is NOT being pressed
|
||||||
|
RLAPI int GetMouseX(void); // Get mouse position X
|
||||||
|
RLAPI int GetMouseY(void); // Get mouse position Y
|
||||||
|
RLAPI Vector2 GetMousePosition(void); // Get mouse position XY
|
||||||
|
RLAPI Vector2 GetMouseDelta(void); // Get mouse delta between frames
|
||||||
|
RLAPI void SetMousePosition(int x, int y); // Set mouse position XY
|
||||||
|
RLAPI void SetMouseOffset(int offsetX, int offsetY); // Set mouse offset
|
||||||
|
RLAPI void SetMouseScale(float scaleX, float scaleY); // Set mouse scaling
|
||||||
|
RLAPI float GetMouseWheelMove(void); // Get mouse wheel movement for X or Y, whichever is larger
|
||||||
|
RLAPI Vector2 GetMouseWheelMoveV(void); // Get mouse wheel movement for both X and Y
|
||||||
|
RLAPI void SetMouseCursor(int cursor); // Set mouse cursor
|
||||||
|
|
||||||
|
// Input-related functions: touch
|
||||||
|
RLAPI int GetTouchX(void); // Get touch position X for touch point 0 (relative to screen size)
|
||||||
|
RLAPI int GetTouchY(void); // Get touch position Y for touch point 0 (relative to screen size)
|
||||||
|
RLAPI Vector2 GetTouchPosition(int index); // Get touch position XY for a touch point index (relative to screen size)
|
||||||
|
RLAPI int GetTouchPointId(int index); // Get touch point identifier for given index
|
||||||
|
RLAPI int GetTouchPointCount(void); // Get number of touch points
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Gestures and Touch Handling Functions (Module: rgestures)
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
RLAPI void SetGesturesEnabled(unsigned int flags); // Enable a set of gestures using flags
|
||||||
|
RLAPI bool IsGestureDetected(int gesture); // Check if a gesture have been detected
|
||||||
|
RLAPI int GetGestureDetected(void); // Get latest detected gesture
|
||||||
|
RLAPI float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds
|
||||||
|
RLAPI Vector2 GetGestureDragVector(void); // Get gesture drag vector
|
||||||
|
RLAPI float GetGestureDragAngle(void); // Get gesture drag angle
|
||||||
|
RLAPI Vector2 GetGesturePinchVector(void); // Get gesture pinch delta
|
||||||
|
RLAPI float GetGesturePinchAngle(void); // Get gesture pinch angle
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Camera System Functions (Module: rcamera)
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
RLAPI void UpdateCamera(Camera *camera, int mode); // Update camera position for selected mode
|
||||||
|
RLAPI void UpdateCameraPro(Camera *camera, Vector3 movement, Vector3 rotation, float zoom); // Update camera movement/rotation
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Basic Shapes Drawing Functions (Module: shapes)
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Set texture and rectangle to be used on shapes drawing
|
||||||
|
// 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
|
||||||
|
RLAPI void SetShapesTexture(Texture2D texture, Rectangle source); // Set texture and rectangle to be used on shapes drawing
|
||||||
|
|
||||||
|
// Basic shapes drawing functions
|
||||||
|
RLAPI void DrawPixel(int posX, int posY, Color color); // Draw a pixel
|
||||||
|
RLAPI void DrawPixelV(Vector2 position, Color color); // Draw a pixel (Vector version)
|
||||||
|
RLAPI void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw a line
|
||||||
|
RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); // Draw a line (Vector version)
|
||||||
|
RLAPI void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line defining thickness
|
||||||
|
RLAPI void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line using cubic-bezier curves in-out
|
||||||
|
RLAPI void DrawLineBezierQuad(Vector2 startPos, Vector2 endPos, Vector2 controlPos, float thick, Color color); // Draw line using quadratic bezier curves with a control point
|
||||||
|
RLAPI void DrawLineBezierCubic(Vector2 startPos, Vector2 endPos, Vector2 startControlPos, Vector2 endControlPos, float thick, Color color); // Draw line using cubic bezier curves with 2 control points
|
||||||
|
RLAPI void DrawLineStrip(Vector2 *points, int pointCount, Color color); // Draw lines sequence
|
||||||
|
RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle
|
||||||
|
RLAPI void DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw a piece of a circle
|
||||||
|
RLAPI void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw circle sector outline
|
||||||
|
RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2); // Draw a gradient-filled circle
|
||||||
|
RLAPI void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version)
|
||||||
|
RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline
|
||||||
|
RLAPI void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse
|
||||||
|
RLAPI void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse outline
|
||||||
|
RLAPI void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring
|
||||||
|
RLAPI void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring outline
|
||||||
|
RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle
|
||||||
|
RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version)
|
||||||
|
RLAPI void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle
|
||||||
|
RLAPI void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters
|
||||||
|
RLAPI void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a vertical-gradient-filled rectangle
|
||||||
|
RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a horizontal-gradient-filled rectangle
|
||||||
|
RLAPI void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); // Draw a gradient-filled rectangle with custom vertex colors
|
||||||
|
RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline
|
||||||
|
RLAPI void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color); // Draw rectangle outline with extended parameters
|
||||||
|
RLAPI void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges
|
||||||
|
RLAPI void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, float lineThick, Color color); // Draw rectangle with rounded edges outline
|
||||||
|
RLAPI void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!)
|
||||||
|
RLAPI void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline (vertex in counter-clockwise order!)
|
||||||
|
RLAPI void DrawTriangleFan(Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points (first vertex is the center)
|
||||||
|
RLAPI void DrawTriangleStrip(Vector2 *points, int pointCount, Color color); // Draw a triangle strip defined by points
|
||||||
|
RLAPI void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a regular polygon (Vector version)
|
||||||
|
RLAPI void DrawPolyLines(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a polygon outline of n sides
|
||||||
|
RLAPI void DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, float lineThick, Color color); // Draw a polygon outline of n sides with extended parameters
|
||||||
|
|
||||||
|
// Basic shapes collision detection functions
|
||||||
|
RLAPI bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); // Check collision between two rectangles
|
||||||
|
RLAPI bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2); // Check collision between two circles
|
||||||
|
RLAPI bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec); // Check collision between circle and rectangle
|
||||||
|
RLAPI bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle
|
||||||
|
RLAPI bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius); // Check if point is inside circle
|
||||||
|
RLAPI bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); // Check if point is inside a triangle
|
||||||
|
RLAPI bool CheckCollisionPointPoly(Vector2 point, Vector2 *points, int pointCount); // Check if point is within a polygon described by array of vertices
|
||||||
|
RLAPI 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
|
||||||
|
RLAPI 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]
|
||||||
|
RLAPI Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // Get collision rectangle for two rectangles collision
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Texture Loading and Drawing Functions (Module: textures)
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Image loading functions
|
||||||
|
// NOTE: These functions do not require GPU access
|
||||||
|
RLAPI Image LoadImage(const char *fileName); // Load image from file into CPU memory (RAM)
|
||||||
|
RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image from RAW file data
|
||||||
|
RLAPI Image LoadImageAnim(const char *fileName, int *frames); // Load image sequence from file (frames appended to image.data)
|
||||||
|
RLAPI Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load image from memory buffer, fileType refers to extension: i.e. '.png'
|
||||||
|
RLAPI Image LoadImageFromTexture(Texture2D texture); // Load image from GPU texture data
|
||||||
|
RLAPI Image LoadImageFromScreen(void); // Load image from screen buffer and (screenshot)
|
||||||
|
RLAPI bool IsImageReady(Image image); // Check if an image is ready
|
||||||
|
RLAPI void UnloadImage(Image image); // Unload image from CPU memory (RAM)
|
||||||
|
RLAPI bool ExportImage(Image image, const char *fileName); // Export image data to file, returns true on success
|
||||||
|
RLAPI bool ExportImageAsCode(Image image, const char *fileName); // Export image as code file defining an array of bytes, returns true on success
|
||||||
|
|
||||||
|
// Image generation functions
|
||||||
|
RLAPI Image GenImageColor(int width, int height, Color color); // Generate image: plain color
|
||||||
|
RLAPI Image GenImageGradientLinear(int width, int height, int direction, Color start, Color end); // Generate image: linear gradient
|
||||||
|
RLAPI Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer); // Generate image: radial gradient
|
||||||
|
RLAPI Image GenImageGradientSquare(int width, int height, float density, Color inner, Color outer); // Generate image: square gradient
|
||||||
|
RLAPI Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2); // Generate image: checked
|
||||||
|
RLAPI Image GenImageWhiteNoise(int width, int height, float factor); // Generate image: white noise
|
||||||
|
RLAPI Image GenImagePerlinNoise(int width, int height, int offsetX, int offsetY, float scale); // Generate image: perlin noise
|
||||||
|
RLAPI Image GenImageCellular(int width, int height, int tileSize); // Generate image: cellular algorithm, bigger tileSize means bigger cells
|
||||||
|
RLAPI Image GenImageText(int width, int height, const char *text); // Generate image: grayscale image from text data
|
||||||
|
|
||||||
|
// Image manipulation functions
|
||||||
|
RLAPI Image ImageCopy(Image image); // Create an image duplicate (useful for transformations)
|
||||||
|
RLAPI Image ImageFromImage(Image image, Rectangle rec); // Create an image from another image piece
|
||||||
|
RLAPI Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font)
|
||||||
|
RLAPI Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Color tint); // Create an image from text (custom sprite font)
|
||||||
|
RLAPI void ImageFormat(Image *image, int newFormat); // Convert image data to desired format
|
||||||
|
RLAPI void ImageToPOT(Image *image, Color fill); // Convert image to POT (power-of-two)
|
||||||
|
RLAPI void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle
|
||||||
|
RLAPI void ImageAlphaCrop(Image *image, float threshold); // Crop image depending on alpha value
|
||||||
|
RLAPI void ImageAlphaClear(Image *image, Color color, float threshold); // Clear alpha channel to desired color
|
||||||
|
RLAPI void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image
|
||||||
|
RLAPI void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel
|
||||||
|
RLAPI void ImageBlurGaussian(Image *image, int blurSize); // Apply Gaussian blur using a box blur approximation
|
||||||
|
RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm)
|
||||||
|
RLAPI void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm)
|
||||||
|
RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); // Resize canvas and fill with color
|
||||||
|
RLAPI void ImageMipmaps(Image *image); // Compute all mipmap levels for a provided image
|
||||||
|
RLAPI void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering)
|
||||||
|
RLAPI void ImageFlipVertical(Image *image); // Flip image vertically
|
||||||
|
RLAPI void ImageFlipHorizontal(Image *image); // Flip image horizontally
|
||||||
|
RLAPI void ImageRotate(Image *image, int degrees); // Rotate image by input angle in degrees (-359 to 359)
|
||||||
|
RLAPI void ImageRotateCW(Image *image); // Rotate image clockwise 90deg
|
||||||
|
RLAPI void ImageRotateCCW(Image *image); // Rotate image counter-clockwise 90deg
|
||||||
|
RLAPI void ImageColorTint(Image *image, Color color); // Modify image color: tint
|
||||||
|
RLAPI void ImageColorInvert(Image *image); // Modify image color: invert
|
||||||
|
RLAPI void ImageColorGrayscale(Image *image); // Modify image color: grayscale
|
||||||
|
RLAPI void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100)
|
||||||
|
RLAPI void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255)
|
||||||
|
RLAPI void ImageColorReplace(Image *image, Color color, Color replace); // Modify image color: replace color
|
||||||
|
RLAPI Color *LoadImageColors(Image image); // Load color data from image as a Color array (RGBA - 32bit)
|
||||||
|
RLAPI Color *LoadImagePalette(Image image, int maxPaletteSize, int *colorCount); // Load colors palette from image as a Color array (RGBA - 32bit)
|
||||||
|
RLAPI void UnloadImageColors(Color *colors); // Unload color data loaded with LoadImageColors()
|
||||||
|
RLAPI void UnloadImagePalette(Color *colors); // Unload colors palette loaded with LoadImagePalette()
|
||||||
|
RLAPI Rectangle GetImageAlphaBorder(Image image, float threshold); // Get image alpha border rectangle
|
||||||
|
RLAPI Color GetImageColor(Image image, int x, int y); // Get image pixel color at (x, y) position
|
||||||
|
|
||||||
|
// Image drawing functions
|
||||||
|
// NOTE: Image software-rendering functions (CPU)
|
||||||
|
RLAPI void ImageClearBackground(Image *dst, Color color); // Clear image background with given color
|
||||||
|
RLAPI void ImageDrawPixel(Image *dst, int posX, int posY, Color color); // Draw pixel within an image
|
||||||
|
RLAPI void ImageDrawPixelV(Image *dst, Vector2 position, Color color); // Draw pixel within an image (Vector version)
|
||||||
|
RLAPI void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw line within an image
|
||||||
|
RLAPI void ImageDrawLineV(Image *dst, Vector2 start, Vector2 end, Color color); // Draw line within an image (Vector version)
|
||||||
|
RLAPI void ImageDrawCircle(Image *dst, int centerX, int centerY, int radius, Color color); // Draw a filled circle within an image
|
||||||
|
RLAPI void ImageDrawCircleV(Image *dst, Vector2 center, int radius, Color color); // Draw a filled circle within an image (Vector version)
|
||||||
|
RLAPI void ImageDrawCircleLines(Image *dst, int centerX, int centerY, int radius, Color color); // Draw circle outline within an image
|
||||||
|
RLAPI void ImageDrawCircleLinesV(Image *dst, Vector2 center, int radius, Color color); // Draw circle outline within an image (Vector version)
|
||||||
|
RLAPI void ImageDrawRectangle(Image *dst, int posX, int posY, int width, int height, Color color); // Draw rectangle within an image
|
||||||
|
RLAPI void ImageDrawRectangleV(Image *dst, Vector2 position, Vector2 size, Color color); // Draw rectangle within an image (Vector version)
|
||||||
|
RLAPI void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color); // Draw rectangle within an image
|
||||||
|
RLAPI void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image
|
||||||
|
RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); // Draw a source image within a destination image (tint applied to source)
|
||||||
|
RLAPI void ImageDrawText(Image *dst, const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) within an image (destination)
|
||||||
|
RLAPI 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)
|
||||||
|
|
||||||
|
// Texture loading functions
|
||||||
|
// NOTE: These functions require GPU access
|
||||||
|
RLAPI Texture2D LoadTexture(const char *fileName); // Load texture from file into GPU memory (VRAM)
|
||||||
|
RLAPI Texture2D LoadTextureFromImage(Image image); // Load texture from image data
|
||||||
|
RLAPI TextureCubemap LoadTextureCubemap(Image image, int layout); // Load cubemap from image, multiple image cubemap layouts supported
|
||||||
|
RLAPI RenderTexture2D LoadRenderTexture(int width, int height); // Load texture for rendering (framebuffer)
|
||||||
|
RLAPI bool IsTextureReady(Texture2D texture); // Check if a texture is ready
|
||||||
|
RLAPI void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM)
|
||||||
|
RLAPI bool IsRenderTextureReady(RenderTexture2D target); // Check if a render texture is ready
|
||||||
|
RLAPI void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM)
|
||||||
|
RLAPI void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data
|
||||||
|
RLAPI void UpdateTextureRec(Texture2D texture, Rectangle rec, const void *pixels); // Update GPU texture rectangle with new data
|
||||||
|
|
||||||
|
// Texture configuration functions
|
||||||
|
RLAPI void GenTextureMipmaps(Texture2D *texture); // Generate GPU mipmaps for a texture
|
||||||
|
RLAPI void SetTextureFilter(Texture2D texture, int filter); // Set texture scaling filter mode
|
||||||
|
RLAPI void SetTextureWrap(Texture2D texture, int wrap); // Set texture wrapping mode
|
||||||
|
|
||||||
|
// Texture drawing functions
|
||||||
|
RLAPI void DrawTexture(Texture2D texture, int posX, int posY, Color tint); // Draw a Texture2D
|
||||||
|
RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2
|
||||||
|
RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters
|
||||||
|
RLAPI void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle
|
||||||
|
RLAPI 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
|
||||||
|
RLAPI 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
|
||||||
|
RLAPI Color Fade(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f
|
||||||
|
RLAPI int ColorToInt(Color color); // Get hexadecimal value for a Color
|
||||||
|
RLAPI Vector4 ColorNormalize(Color color); // Get Color normalized as float [0..1]
|
||||||
|
RLAPI Color ColorFromNormalized(Vector4 normalized); // Get Color from normalized values [0..1]
|
||||||
|
RLAPI Vector3 ColorToHSV(Color color); // Get HSV values for a Color, hue [0..360], saturation/value [0..1]
|
||||||
|
RLAPI Color ColorFromHSV(float hue, float saturation, float value); // Get a Color from HSV values, hue [0..360], saturation/value [0..1]
|
||||||
|
RLAPI Color ColorTint(Color color, Color tint); // Get color multiplied with another color
|
||||||
|
RLAPI Color ColorBrightness(Color color, float factor); // Get color with brightness correction, brightness factor goes from -1.0f to 1.0f
|
||||||
|
RLAPI Color ColorContrast(Color color, float contrast); // Get color with contrast correction, contrast values between -1.0f and 1.0f
|
||||||
|
RLAPI Color ColorAlpha(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f
|
||||||
|
RLAPI Color ColorAlphaBlend(Color dst, Color src, Color tint); // Get src alpha-blended into dst color with tint
|
||||||
|
RLAPI Color GetColor(unsigned int hexValue); // Get Color structure from hexadecimal value
|
||||||
|
RLAPI Color GetPixelColor(void *srcPtr, int format); // Get Color from a source pixel pointer of certain format
|
||||||
|
RLAPI void SetPixelColor(void *dstPtr, Color color, int format); // Set color formatted into destination pixel pointer
|
||||||
|
RLAPI int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes for certain format
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Font Loading and Text Drawing Functions (Module: text)
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Font loading/unloading functions
|
||||||
|
RLAPI Font GetFontDefault(void); // Get the default Font
|
||||||
|
RLAPI Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM)
|
||||||
|
RLAPI Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int glyphCount); // Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set
|
||||||
|
RLAPI Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style)
|
||||||
|
RLAPI Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int glyphCount); // Load font from memory buffer, fileType refers to extension: i.e. '.ttf'
|
||||||
|
RLAPI bool IsFontReady(Font font); // Check if a font is ready
|
||||||
|
RLAPI GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int glyphCount, int type); // Load font data for further use
|
||||||
|
RLAPI Image GenImageFontAtlas(const GlyphInfo *chars, Rectangle **recs, int glyphCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info
|
||||||
|
RLAPI void UnloadFontData(GlyphInfo *chars, int glyphCount); // Unload font chars info data (RAM)
|
||||||
|
RLAPI void UnloadFont(Font font); // Unload font from GPU memory (VRAM)
|
||||||
|
RLAPI bool ExportFontAsCode(Font font, const char *fileName); // Export font as code file, returns true on success
|
||||||
|
|
||||||
|
// Text drawing functions
|
||||||
|
RLAPI void DrawFPS(int posX, int posY); // Draw current FPS
|
||||||
|
RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font)
|
||||||
|
RLAPI void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters
|
||||||
|
RLAPI void DrawTextPro(Font font, const char *text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint); // Draw text using Font and pro parameters (rotation)
|
||||||
|
RLAPI void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint); // Draw one character (codepoint)
|
||||||
|
RLAPI void DrawTextCodepoints(Font font, const int *codepoints, int count, Vector2 position, float fontSize, float spacing, Color tint); // Draw multiple character (codepoint)
|
||||||
|
|
||||||
|
// Text font info functions
|
||||||
|
RLAPI int MeasureText(const char *text, int fontSize); // Measure string width for default font
|
||||||
|
RLAPI Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font
|
||||||
|
RLAPI int GetGlyphIndex(Font font, int codepoint); // Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found
|
||||||
|
RLAPI GlyphInfo GetGlyphInfo(Font font, int codepoint); // Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found
|
||||||
|
RLAPI Rectangle GetGlyphAtlasRec(Font font, int codepoint); // Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found
|
||||||
|
|
||||||
|
// Text codepoints management functions (unicode characters)
|
||||||
|
RLAPI char *LoadUTF8(const int *codepoints, int length); // Load UTF-8 text encoded from codepoints array
|
||||||
|
RLAPI void UnloadUTF8(char *text); // Unload UTF-8 text encoded from codepoints array
|
||||||
|
RLAPI int *LoadCodepoints(const char *text, int *count); // Load all codepoints from a UTF-8 text string, codepoints count returned by parameter
|
||||||
|
RLAPI void UnloadCodepoints(int *codepoints); // Unload codepoints data from memory
|
||||||
|
RLAPI int GetCodepointCount(const char *text); // Get total number of codepoints in a UTF-8 encoded string
|
||||||
|
RLAPI int GetCodepoint(const char *text, int *codepointSize); // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure
|
||||||
|
RLAPI int GetCodepointNext(const char *text, int *codepointSize); // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure
|
||||||
|
RLAPI int GetCodepointPrevious(const char *text, int *codepointSize); // Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure
|
||||||
|
RLAPI const char *CodepointToUTF8(int codepoint, int *utf8Size); // Encode one codepoint into UTF-8 byte array (array length returned as parameter)
|
||||||
|
|
||||||
|
// Text strings management functions (no UTF-8 strings, only byte chars)
|
||||||
|
// NOTE: Some strings allocate memory internally for returned strings, just be careful!
|
||||||
|
RLAPI int TextCopy(char *dst, const char *src); // Copy one string to another, returns bytes copied
|
||||||
|
RLAPI bool TextIsEqual(const char *text1, const char *text2); // Check if two text string are equal
|
||||||
|
RLAPI unsigned int TextLength(const char *text); // Get text length, checks for '\0' ending
|
||||||
|
RLAPI const char *TextFormat(const char *text, ...); // Text formatting with variables (sprintf() style)
|
||||||
|
RLAPI const char *TextSubtext(const char *text, int position, int length); // Get a piece of a text string
|
||||||
|
RLAPI char *TextReplace(char *text, const char *replace, const char *by); // Replace text string (WARNING: memory must be freed!)
|
||||||
|
RLAPI char *TextInsert(const char *text, const char *insert, int position); // Insert text in a position (WARNING: memory must be freed!)
|
||||||
|
RLAPI const char *TextJoin(const char **textList, int count, const char *delimiter); // Join text strings with delimiter
|
||||||
|
RLAPI const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings
|
||||||
|
RLAPI void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor!
|
||||||
|
RLAPI int TextFindIndex(const char *text, const char *find); // Find first text occurrence within a string
|
||||||
|
RLAPI const char *TextToUpper(const char *text); // Get upper case version of provided string
|
||||||
|
RLAPI const char *TextToLower(const char *text); // Get lower case version of provided string
|
||||||
|
RLAPI const char *TextToPascal(const char *text); // Get Pascal case notation version of provided string
|
||||||
|
RLAPI int TextToInteger(const char *text); // Get integer value from text (negative values not supported)
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Basic 3d Shapes Drawing Functions (Module: models)
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Basic geometric 3D shapes drawing functions
|
||||||
|
RLAPI void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space
|
||||||
|
RLAPI void DrawPoint3D(Vector3 position, Color color); // Draw a point in 3D space, actually a small line
|
||||||
|
RLAPI void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color); // Draw a circle in 3D world space
|
||||||
|
RLAPI void DrawTriangle3D(Vector3 v1, Vector3 v2, Vector3 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!)
|
||||||
|
RLAPI void DrawTriangleStrip3D(Vector3 *points, int pointCount, Color color); // Draw a triangle strip defined by points
|
||||||
|
RLAPI void DrawCube(Vector3 position, float width, float height, float length, Color color); // Draw cube
|
||||||
|
RLAPI void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version)
|
||||||
|
RLAPI void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); // Draw cube wires
|
||||||
|
RLAPI void DrawCubeWiresV(Vector3 position, Vector3 size, Color color); // Draw cube wires (Vector version)
|
||||||
|
RLAPI void DrawSphere(Vector3 centerPos, float radius, Color color); // Draw sphere
|
||||||
|
RLAPI void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere with extended parameters
|
||||||
|
RLAPI void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere wires
|
||||||
|
RLAPI void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone
|
||||||
|
RLAPI void DrawCylinderEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color); // Draw a cylinder with base at startPos and top at endPos
|
||||||
|
RLAPI void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone wires
|
||||||
|
RLAPI void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color); // Draw a cylinder wires with base at startPos and top at endPos
|
||||||
|
RLAPI void DrawCapsule(Vector3 startPos, Vector3 endPos, float radius, int slices, int rings, Color color); // Draw a capsule with the center of its sphere caps at startPos and endPos
|
||||||
|
RLAPI void DrawCapsuleWires(Vector3 startPos, Vector3 endPos, float radius, int slices, int rings, Color color); // Draw capsule wireframe with the center of its sphere caps at startPos and endPos
|
||||||
|
RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color); // Draw a plane XZ
|
||||||
|
RLAPI void DrawRay(Ray ray, Color color); // Draw a ray line
|
||||||
|
RLAPI void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0))
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Model 3d Loading and Drawing Functions (Module: models)
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Model management functions
|
||||||
|
RLAPI Model LoadModel(const char *fileName); // Load model from files (meshes and materials)
|
||||||
|
RLAPI Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh (default material)
|
||||||
|
RLAPI bool IsModelReady(Model model); // Check if a model is ready
|
||||||
|
RLAPI void UnloadModel(Model model); // Unload model (including meshes) from memory (RAM and/or VRAM)
|
||||||
|
RLAPI BoundingBox GetModelBoundingBox(Model model); // Compute model bounding box limits (considers all meshes)
|
||||||
|
|
||||||
|
// Model drawing functions
|
||||||
|
RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set)
|
||||||
|
RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters
|
||||||
|
RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set)
|
||||||
|
RLAPI 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
|
||||||
|
RLAPI void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires)
|
||||||
|
RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float size, Color tint); // Draw a billboard texture
|
||||||
|
RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint); // Draw a billboard texture defined by source
|
||||||
|
RLAPI 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
|
||||||
|
RLAPI void UploadMesh(Mesh *mesh, bool dynamic); // Upload mesh vertex data in GPU and provide VAO/VBO ids
|
||||||
|
RLAPI void UpdateMeshBuffer(Mesh mesh, int index, const void *data, int dataSize, int offset); // Update mesh vertex data in GPU for a specific buffer index
|
||||||
|
RLAPI void UnloadMesh(Mesh mesh); // Unload mesh data from CPU and GPU
|
||||||
|
RLAPI void DrawMesh(Mesh mesh, Material material, Matrix transform); // Draw a 3d mesh with material and transform
|
||||||
|
RLAPI void DrawMeshInstanced(Mesh mesh, Material material, const Matrix *transforms, int instances); // Draw multiple mesh instances with material and different transforms
|
||||||
|
RLAPI bool ExportMesh(Mesh mesh, const char *fileName); // Export mesh data to file, returns true on success
|
||||||
|
RLAPI BoundingBox GetMeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits
|
||||||
|
RLAPI void GenMeshTangents(Mesh *mesh); // Compute mesh tangents
|
||||||
|
|
||||||
|
// Mesh generation functions
|
||||||
|
RLAPI Mesh GenMeshPoly(int sides, float radius); // Generate polygonal mesh
|
||||||
|
RLAPI Mesh GenMeshPlane(float width, float length, int resX, int resZ); // Generate plane mesh (with subdivisions)
|
||||||
|
RLAPI Mesh GenMeshCube(float width, float height, float length); // Generate cuboid mesh
|
||||||
|
RLAPI Mesh GenMeshSphere(float radius, int rings, int slices); // Generate sphere mesh (standard sphere)
|
||||||
|
RLAPI Mesh GenMeshHemiSphere(float radius, int rings, int slices); // Generate half-sphere mesh (no bottom cap)
|
||||||
|
RLAPI Mesh GenMeshCylinder(float radius, float height, int slices); // Generate cylinder mesh
|
||||||
|
RLAPI Mesh GenMeshCone(float radius, float height, int slices); // Generate cone/pyramid mesh
|
||||||
|
RLAPI Mesh GenMeshTorus(float radius, float size, int radSeg, int sides); // Generate torus mesh
|
||||||
|
RLAPI Mesh GenMeshKnot(float radius, float size, int radSeg, int sides); // Generate trefoil knot mesh
|
||||||
|
RLAPI Mesh GenMeshHeightmap(Image heightmap, Vector3 size); // Generate heightmap mesh from image data
|
||||||
|
RLAPI Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Generate cubes-based map mesh from image data
|
||||||
|
|
||||||
|
// Material loading/unloading functions
|
||||||
|
RLAPI Material *LoadMaterials(const char *fileName, int *materialCount); // Load materials from model file
|
||||||
|
RLAPI Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps)
|
||||||
|
RLAPI bool IsMaterialReady(Material material); // Check if a material is ready
|
||||||
|
RLAPI void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM)
|
||||||
|
RLAPI void SetMaterialTexture(Material *material, int mapType, Texture2D texture); // Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...)
|
||||||
|
RLAPI void SetModelMeshMaterial(Model *model, int meshId, int materialId); // Set material for a mesh
|
||||||
|
|
||||||
|
// Model animations loading/unloading functions
|
||||||
|
RLAPI ModelAnimation *LoadModelAnimations(const char *fileName, unsigned int *animCount); // Load model animations from file
|
||||||
|
RLAPI void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose
|
||||||
|
RLAPI void UnloadModelAnimation(ModelAnimation anim); // Unload animation data
|
||||||
|
RLAPI void UnloadModelAnimations(ModelAnimation *animations, unsigned int count); // Unload animation array data
|
||||||
|
RLAPI bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match
|
||||||
|
|
||||||
|
// Collision detection functions
|
||||||
|
RLAPI bool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, float radius2); // Check collision between two spheres
|
||||||
|
RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); // Check collision between two bounding boxes
|
||||||
|
RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius); // Check collision between box and sphere
|
||||||
|
RLAPI RayCollision GetRayCollisionSphere(Ray ray, Vector3 center, float radius); // Get collision info between ray and sphere
|
||||||
|
RLAPI RayCollision GetRayCollisionBox(Ray ray, BoundingBox box); // Get collision info between ray and box
|
||||||
|
RLAPI RayCollision GetRayCollisionMesh(Ray ray, Mesh mesh, Matrix transform); // Get collision info between ray and mesh
|
||||||
|
RLAPI RayCollision GetRayCollisionTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle
|
||||||
|
RLAPI RayCollision GetRayCollisionQuad(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4); // Get collision info between ray and quad
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
// Audio Loading and Playing Functions (Module: audio)
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
typedef void (*AudioCallback)(void *bufferData, unsigned int frames);
|
||||||
|
|
||||||
|
// Audio device management functions
|
||||||
|
RLAPI void InitAudioDevice(void); // Initialize audio device and context
|
||||||
|
RLAPI void CloseAudioDevice(void); // Close the audio device and context
|
||||||
|
RLAPI bool IsAudioDeviceReady(void); // Check if audio device has been initialized successfully
|
||||||
|
RLAPI void SetMasterVolume(float volume); // Set master volume (listener)
|
||||||
|
|
||||||
|
// Wave/Sound loading/unloading functions
|
||||||
|
RLAPI Wave LoadWave(const char *fileName); // Load wave data from file
|
||||||
|
RLAPI Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load wave from memory buffer, fileType refers to extension: i.e. '.wav'
|
||||||
|
RLAPI bool IsWaveReady(Wave wave); // Checks if wave data is ready
|
||||||
|
RLAPI Sound LoadSound(const char *fileName); // Load sound from file
|
||||||
|
RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound from wave data
|
||||||
|
RLAPI bool IsSoundReady(Sound sound); // Checks if a sound is ready
|
||||||
|
RLAPI void UpdateSound(Sound sound, const void *data, int sampleCount); // Update sound buffer with new data
|
||||||
|
RLAPI void UnloadWave(Wave wave); // Unload wave data
|
||||||
|
RLAPI void UnloadSound(Sound sound); // Unload sound
|
||||||
|
RLAPI bool ExportWave(Wave wave, const char *fileName); // Export wave data to file, returns true on success
|
||||||
|
RLAPI bool ExportWaveAsCode(Wave wave, const char *fileName); // Export wave sample data to code (.h), returns true on success
|
||||||
|
|
||||||
|
// Wave/Sound management functions
|
||||||
|
RLAPI void PlaySound(Sound sound); // Play a sound
|
||||||
|
RLAPI void StopSound(Sound sound); // Stop playing a sound
|
||||||
|
RLAPI void PauseSound(Sound sound); // Pause a sound
|
||||||
|
RLAPI void ResumeSound(Sound sound); // Resume a paused sound
|
||||||
|
RLAPI bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing
|
||||||
|
RLAPI void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level)
|
||||||
|
RLAPI void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level)
|
||||||
|
RLAPI void SetSoundPan(Sound sound, float pan); // Set pan for a sound (0.5 is center)
|
||||||
|
RLAPI Wave WaveCopy(Wave wave); // Copy a wave to a new wave
|
||||||
|
RLAPI void WaveCrop(Wave *wave, int initSample, int finalSample); // Crop a wave to defined samples range
|
||||||
|
RLAPI void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format
|
||||||
|
RLAPI float *LoadWaveSamples(Wave wave); // Load samples data from wave as a 32bit float data array
|
||||||
|
RLAPI void UnloadWaveSamples(float *samples); // Unload samples data loaded with LoadWaveSamples()
|
||||||
|
|
||||||
|
// Music management functions
|
||||||
|
RLAPI Music LoadMusicStream(const char *fileName); // Load music stream from file
|
||||||
|
RLAPI Music LoadMusicStreamFromMemory(const char *fileType, const unsigned char *data, int dataSize); // Load music stream from data
|
||||||
|
RLAPI bool IsMusicReady(Music music); // Checks if a music stream is ready
|
||||||
|
RLAPI void UnloadMusicStream(Music music); // Unload music stream
|
||||||
|
RLAPI void PlayMusicStream(Music music); // Start music playing
|
||||||
|
RLAPI bool IsMusicStreamPlaying(Music music); // Check if music is playing
|
||||||
|
RLAPI void UpdateMusicStream(Music music); // Updates buffers for music streaming
|
||||||
|
RLAPI void StopMusicStream(Music music); // Stop music playing
|
||||||
|
RLAPI void PauseMusicStream(Music music); // Pause music playing
|
||||||
|
RLAPI void ResumeMusicStream(Music music); // Resume playing paused music
|
||||||
|
RLAPI void SeekMusicStream(Music music, float position); // Seek music to a position (in seconds)
|
||||||
|
RLAPI void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level)
|
||||||
|
RLAPI void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level)
|
||||||
|
RLAPI void SetMusicPan(Music music, float pan); // Set pan for a music (0.5 is center)
|
||||||
|
RLAPI float GetMusicTimeLength(Music music); // Get music time length (in seconds)
|
||||||
|
RLAPI float GetMusicTimePlayed(Music music); // Get current music time played (in seconds)
|
||||||
|
|
||||||
|
// AudioStream management functions
|
||||||
|
RLAPI AudioStream LoadAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); // Load audio stream (to stream raw audio pcm data)
|
||||||
|
RLAPI bool IsAudioStreamReady(AudioStream stream); // Checks if an audio stream is ready
|
||||||
|
RLAPI void UnloadAudioStream(AudioStream stream); // Unload audio stream and free memory
|
||||||
|
RLAPI void UpdateAudioStream(AudioStream stream, const void *data, int frameCount); // Update audio stream buffers with data
|
||||||
|
RLAPI bool IsAudioStreamProcessed(AudioStream stream); // Check if any audio stream buffers requires refill
|
||||||
|
RLAPI void PlayAudioStream(AudioStream stream); // Play audio stream
|
||||||
|
RLAPI void PauseAudioStream(AudioStream stream); // Pause audio stream
|
||||||
|
RLAPI void ResumeAudioStream(AudioStream stream); // Resume audio stream
|
||||||
|
RLAPI bool IsAudioStreamPlaying(AudioStream stream); // Check if audio stream is playing
|
||||||
|
RLAPI void StopAudioStream(AudioStream stream); // Stop audio stream
|
||||||
|
RLAPI void SetAudioStreamVolume(AudioStream stream, float volume); // Set volume for audio stream (1.0 is max level)
|
||||||
|
RLAPI void SetAudioStreamPitch(AudioStream stream, float pitch); // Set pitch for audio stream (1.0 is base level)
|
||||||
|
RLAPI void SetAudioStreamPan(AudioStream stream, float pan); // Set pan for audio stream (0.5 is centered)
|
||||||
|
RLAPI void SetAudioStreamBufferSizeDefault(int size); // Default size for new audio streams
|
||||||
|
RLAPI void SetAudioStreamCallback(AudioStream stream, AudioCallback callback); // Audio thread callback to request new data
|
||||||
|
|
||||||
|
RLAPI void AttachAudioStreamProcessor(AudioStream stream, AudioCallback processor); // Attach audio stream processor to stream
|
||||||
|
RLAPI void DetachAudioStreamProcessor(AudioStream stream, AudioCallback processor); // Detach audio stream processor from stream
|
||||||
|
|
||||||
|
RLAPI void AttachAudioMixedProcessor(AudioCallback processor); // Attach audio stream processor to the entire audio pipeline
|
||||||
|
RLAPI void DetachAudioMixedProcessor(AudioCallback processor); // Detach audio stream processor from the entire audio pipeline
|
||||||
|
|
18
3party/raylib/projects/README.md
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
## raylib PROJECT TEMPLATES
|
||||||
|
|
||||||
|
This folder contains raylib templates for some common IDEs.
|
||||||
|
|
||||||
|
IDE | Platform(s) | Source | Example(s)
|
||||||
|
----| ------------| :-------: | :-----:
|
||||||
|
[4coder](http://4coder.net/) | Windows | ❌ | ✔️
|
||||||
|
[Builder](https://wiki.gnome.org/Apps/Builder) | Linux | ❌ | ✔️
|
||||||
|
[CMake](https://cmake.org/) | Windows, Linux, macOS, Web | ✔️ | ✔️
|
||||||
|
[CodeBlocks](http://www.codeblocks.org/) | Windows, Linux, macOS | ❌ | ✔️
|
||||||
|
[Geany](https://www.geany.org/) | Windows, Linux | ✔️ | ✔️
|
||||||
|
[Notepad++](https://notepad-plus-plus.org/) | Windows | ✔️ | ✔️
|
||||||
|
[SublimeText](https://www.sublimetext.com/) | Windows, Linux, macOS | ✔️ | ✔️
|
||||||
|
[VS2019](https://www.visualstudio.com) | Windows | ✔️ | ✔️
|
||||||
|
[VSCode](https://code.visualstudio.com/) | Windows, macOS | ❌ | ✔️
|
||||||
|
scripts | Windows, Linux, macOS | ✔️ | ✔️
|
||||||
|
|
||||||
|
*New IDEs config files are welcome!*
|
13
3party/raylib/projects/SublimeText/README.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# Sublime Text 3 project template
|
||||||
|
|
||||||
|
This is a project template to be used with [Sublime Text 3](https://www.sublimetext.com/).
|
||||||
|
|
||||||
|
Simply click on the `raylib.sublime-project` file to open it with Sublime Text.
|
||||||
|
Alternatively you can open Sublime Text first and click on the `Project -> Open Project`.
|
||||||
|
|
||||||
|
It comes with raylib.sublime-build. This file needs to be copied into the sublime packages folder for the user. On windows it can be found in `%AppData%\Sublime Text 3\Packages\User`.
|
||||||
|
|
||||||
|
Once done open the project and select `Tools -> Build System -> raylib`.
|
||||||
|
To run press Ctrl + Shift + B and select which build you want to run.
|
||||||
|
|
||||||
|
For a full overview of build systems please check the [build systems guide](https://www.sublimetext.com/docs/3/build_systems.html).
|
13
3party/raylib/projects/SublimeText/raylib.sublime-build
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"variants": [
|
||||||
|
{
|
||||||
|
"name": "desktop",
|
||||||
|
"shell_cmd": "cd ${folder}\\src && mingw32-make PLATFORM=PLATFORM_DESKTOP"
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"name": "examples",
|
||||||
|
"shell_cmd": "cd ${folder}\\examples && mingw32-make PLATFORM=PLATFORM_DESKTOP"
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"folders":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"path": "../../"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
75
3party/raylib/projects/VS2019-Android/raylib_android.sln
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 16
|
||||||
|
VisualStudioVersion = 16.0.31702.278
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "raylib_android", "raylib_android", "{5C24BC76-8848-40EA-9BBB-A544648D8D5B}"
|
||||||
|
EndProject
|
||||||
|
Project("{39E2626F-3545-4960-A6E8-258AD8476CE5}") = "raylib_android.Packaging", "raylib_android\raylib_android.Packaging\raylib_android.Packaging.androidproj", "{B2231F0D-52DA-4C55-8998-5886F766553C}"
|
||||||
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "raylib_android.NativeActivity", "raylib_android\raylib_android.NativeActivity\raylib_android.NativeActivity.vcxproj", "{BFB31759-4FCA-4503-BC7C-A97F705EFDB2}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|ARM = Debug|ARM
|
||||||
|
Debug|ARM64 = Debug|ARM64
|
||||||
|
Debug|x64 = Debug|x64
|
||||||
|
Debug|x86 = Debug|x86
|
||||||
|
Release|ARM = Release|ARM
|
||||||
|
Release|ARM64 = Release|ARM64
|
||||||
|
Release|x64 = Release|x64
|
||||||
|
Release|x86 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{B2231F0D-52DA-4C55-8998-5886F766553C}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||||
|
{B2231F0D-52DA-4C55-8998-5886F766553C}.Debug|ARM.Build.0 = Debug|ARM
|
||||||
|
{B2231F0D-52DA-4C55-8998-5886F766553C}.Debug|ARM.Deploy.0 = Debug|ARM
|
||||||
|
{B2231F0D-52DA-4C55-8998-5886F766553C}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||||
|
{B2231F0D-52DA-4C55-8998-5886F766553C}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||||
|
{B2231F0D-52DA-4C55-8998-5886F766553C}.Debug|ARM64.Deploy.0 = Debug|ARM64
|
||||||
|
{B2231F0D-52DA-4C55-8998-5886F766553C}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{B2231F0D-52DA-4C55-8998-5886F766553C}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{B2231F0D-52DA-4C55-8998-5886F766553C}.Debug|x64.Deploy.0 = Debug|x64
|
||||||
|
{B2231F0D-52DA-4C55-8998-5886F766553C}.Debug|x86.ActiveCfg = Debug|x86
|
||||||
|
{B2231F0D-52DA-4C55-8998-5886F766553C}.Debug|x86.Build.0 = Debug|x86
|
||||||
|
{B2231F0D-52DA-4C55-8998-5886F766553C}.Debug|x86.Deploy.0 = Debug|x86
|
||||||
|
{B2231F0D-52DA-4C55-8998-5886F766553C}.Release|ARM.ActiveCfg = Release|ARM
|
||||||
|
{B2231F0D-52DA-4C55-8998-5886F766553C}.Release|ARM.Build.0 = Release|ARM
|
||||||
|
{B2231F0D-52DA-4C55-8998-5886F766553C}.Release|ARM.Deploy.0 = Release|ARM
|
||||||
|
{B2231F0D-52DA-4C55-8998-5886F766553C}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||||
|
{B2231F0D-52DA-4C55-8998-5886F766553C}.Release|ARM64.Build.0 = Release|ARM64
|
||||||
|
{B2231F0D-52DA-4C55-8998-5886F766553C}.Release|ARM64.Deploy.0 = Release|ARM64
|
||||||
|
{B2231F0D-52DA-4C55-8998-5886F766553C}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{B2231F0D-52DA-4C55-8998-5886F766553C}.Release|x64.Build.0 = Release|x64
|
||||||
|
{B2231F0D-52DA-4C55-8998-5886F766553C}.Release|x64.Deploy.0 = Release|x64
|
||||||
|
{B2231F0D-52DA-4C55-8998-5886F766553C}.Release|x86.ActiveCfg = Release|x86
|
||||||
|
{B2231F0D-52DA-4C55-8998-5886F766553C}.Release|x86.Build.0 = Release|x86
|
||||||
|
{B2231F0D-52DA-4C55-8998-5886F766553C}.Release|x86.Deploy.0 = Release|x86
|
||||||
|
{BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||||
|
{BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Debug|ARM.Build.0 = Debug|ARM
|
||||||
|
{BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||||
|
{BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||||
|
{BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Debug|x86.ActiveCfg = Debug|x86
|
||||||
|
{BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Debug|x86.Build.0 = Debug|x86
|
||||||
|
{BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Release|ARM.ActiveCfg = Release|ARM
|
||||||
|
{BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Release|ARM.Build.0 = Release|ARM
|
||||||
|
{BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||||
|
{BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Release|ARM64.Build.0 = Release|ARM64
|
||||||
|
{BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Release|x64.Build.0 = Release|x64
|
||||||
|
{BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Release|x86.ActiveCfg = Release|x86
|
||||||
|
{BFB31759-4FCA-4503-BC7C-A97F705EFDB2}.Release|x86.Build.0 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(NestedProjects) = preSolution
|
||||||
|
{B2231F0D-52DA-4C55-8998-5886F766553C} = {5C24BC76-8848-40EA-9BBB-A544648D8D5B}
|
||||||
|
{BFB31759-4FCA-4503-BC7C-A97F705EFDB2} = {5C24BC76-8848-40EA-9BBB-A544648D8D5B}
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {B7ED0AA6-6B00-40AC-BF71-526D5BEEFC78}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
@ -0,0 +1,437 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2010 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* лицензировано по лицензии Apache License, версия 2.0 ( "Лицензия");
|
||||||
|
*этот файл можно использовать только в соответствии с лицензией.
|
||||||
|
*Копию лицензии можно получить на веб-сайте
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
*Если только не требуется в соответствии с применимым законодательством или согласовано в письменном виде, программное обеспечение
|
||||||
|
* распространяется в рамках лицензии на УСЛОВИЯХ "КАК ЕСТЬ",
|
||||||
|
* БЕЗ ГАРАНТИЙ И УСЛОВИЙ ЛЮБОГО РОДА, явно выраженных и подразумеваемых.
|
||||||
|
* См. лицензию для получения информации об определенных разрешениях по использованию языка и
|
||||||
|
* ограничениях в рамках лицензии.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <jni.h>
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <sys/resource.h>
|
||||||
|
|
||||||
|
#include "android_native_app_glue.h"
|
||||||
|
#include <android/log.h>
|
||||||
|
|
||||||
|
#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "threaded_app", __VA_ARGS__))
|
||||||
|
#define LOGE(...) ((void)__android_log_print(ANDROID_LOG_ERROR, "threaded_app", __VA_ARGS__))
|
||||||
|
|
||||||
|
/* Для отладочных построений необходимо всегда включать трассировку отладки в этой библиотеке*/
|
||||||
|
#ifndef NDEBUG
|
||||||
|
# define LOGV(...) ((void)__android_log_print(ANDROID_LOG_VERBOSE, "threaded_app", __VA_ARGS__))
|
||||||
|
#else
|
||||||
|
# define LOGV(...) ((void)0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static void free_saved_state(struct android_app* android_app) {
|
||||||
|
pthread_mutex_lock(&android_app->mutex);
|
||||||
|
if (android_app->savedState != NULL) {
|
||||||
|
free(android_app->savedState);
|
||||||
|
android_app->savedState = NULL;
|
||||||
|
android_app->savedStateSize = 0;
|
||||||
|
}
|
||||||
|
pthread_mutex_unlock(&android_app->mutex);
|
||||||
|
}
|
||||||
|
|
||||||
|
int8_t android_app_read_cmd(struct android_app* android_app) {
|
||||||
|
int8_t cmd;
|
||||||
|
if (read(android_app->msgread, &cmd, sizeof(cmd)) == sizeof(cmd)) {
|
||||||
|
switch (cmd) {
|
||||||
|
case APP_CMD_SAVE_STATE:
|
||||||
|
free_saved_state(android_app);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return cmd;
|
||||||
|
} else {
|
||||||
|
LOGE("No data on command pipe!");
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void print_cur_config(struct android_app* android_app) {
|
||||||
|
char lang[2], country[2];
|
||||||
|
AConfiguration_getLanguage(android_app->config, lang);
|
||||||
|
AConfiguration_getCountry(android_app->config, country);
|
||||||
|
|
||||||
|
LOGV("Config: mcc=%d mnc=%d lang=%c%c cnt=%c%c orien=%d touch=%d dens=%d "
|
||||||
|
"keys=%d nav=%d keysHid=%d navHid=%d sdk=%d size=%d long=%d "
|
||||||
|
"modetype=%d modenight=%d",
|
||||||
|
AConfiguration_getMcc(android_app->config),
|
||||||
|
AConfiguration_getMnc(android_app->config),
|
||||||
|
lang[0], lang[1], country[0], country[1],
|
||||||
|
AConfiguration_getOrientation(android_app->config),
|
||||||
|
AConfiguration_getTouchscreen(android_app->config),
|
||||||
|
AConfiguration_getDensity(android_app->config),
|
||||||
|
AConfiguration_getKeyboard(android_app->config),
|
||||||
|
AConfiguration_getNavigation(android_app->config),
|
||||||
|
AConfiguration_getKeysHidden(android_app->config),
|
||||||
|
AConfiguration_getNavHidden(android_app->config),
|
||||||
|
AConfiguration_getSdkVersion(android_app->config),
|
||||||
|
AConfiguration_getScreenSize(android_app->config),
|
||||||
|
AConfiguration_getScreenLong(android_app->config),
|
||||||
|
AConfiguration_getUiModeType(android_app->config),
|
||||||
|
AConfiguration_getUiModeNight(android_app->config));
|
||||||
|
}
|
||||||
|
|
||||||
|
void android_app_pre_exec_cmd(struct android_app* android_app, int8_t cmd) {
|
||||||
|
switch (cmd) {
|
||||||
|
case APP_CMD_INPUT_CHANGED:
|
||||||
|
LOGV("APP_CMD_INPUT_CHANGED\n");
|
||||||
|
pthread_mutex_lock(&android_app->mutex);
|
||||||
|
if (android_app->inputQueue != NULL) {
|
||||||
|
AInputQueue_detachLooper(android_app->inputQueue);
|
||||||
|
}
|
||||||
|
android_app->inputQueue = android_app->pendingInputQueue;
|
||||||
|
if (android_app->inputQueue != NULL) {
|
||||||
|
LOGV("Attaching input queue to looper");
|
||||||
|
AInputQueue_attachLooper(android_app->inputQueue,
|
||||||
|
android_app->looper, LOOPER_ID_INPUT, NULL,
|
||||||
|
&android_app->inputPollSource);
|
||||||
|
}
|
||||||
|
pthread_cond_broadcast(&android_app->cond);
|
||||||
|
pthread_mutex_unlock(&android_app->mutex);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case APP_CMD_INIT_WINDOW:
|
||||||
|
LOGV("APP_CMD_INIT_WINDOW\n");
|
||||||
|
pthread_mutex_lock(&android_app->mutex);
|
||||||
|
android_app->window = android_app->pendingWindow;
|
||||||
|
pthread_cond_broadcast(&android_app->cond);
|
||||||
|
pthread_mutex_unlock(&android_app->mutex);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case APP_CMD_TERM_WINDOW:
|
||||||
|
LOGV("APP_CMD_TERM_WINDOW\n");
|
||||||
|
pthread_cond_broadcast(&android_app->cond);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case APP_CMD_RESUME:
|
||||||
|
case APP_CMD_START:
|
||||||
|
case APP_CMD_PAUSE:
|
||||||
|
case APP_CMD_STOP:
|
||||||
|
LOGV("activityState=%d\n", cmd);
|
||||||
|
pthread_mutex_lock(&android_app->mutex);
|
||||||
|
android_app->activityState = cmd;
|
||||||
|
pthread_cond_broadcast(&android_app->cond);
|
||||||
|
pthread_mutex_unlock(&android_app->mutex);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case APP_CMD_CONFIG_CHANGED:
|
||||||
|
LOGV("APP_CMD_CONFIG_CHANGED\n");
|
||||||
|
AConfiguration_fromAssetManager(android_app->config,
|
||||||
|
android_app->activity->assetManager);
|
||||||
|
print_cur_config(android_app);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case APP_CMD_DESTROY:
|
||||||
|
LOGV("APP_CMD_DESTROY\n");
|
||||||
|
android_app->destroyRequested = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void android_app_post_exec_cmd(struct android_app* android_app, int8_t cmd) {
|
||||||
|
switch (cmd) {
|
||||||
|
case APP_CMD_TERM_WINDOW:
|
||||||
|
LOGV("APP_CMD_TERM_WINDOW\n");
|
||||||
|
pthread_mutex_lock(&android_app->mutex);
|
||||||
|
android_app->window = NULL;
|
||||||
|
pthread_cond_broadcast(&android_app->cond);
|
||||||
|
pthread_mutex_unlock(&android_app->mutex);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case APP_CMD_SAVE_STATE:
|
||||||
|
LOGV("APP_CMD_SAVE_STATE\n");
|
||||||
|
pthread_mutex_lock(&android_app->mutex);
|
||||||
|
android_app->stateSaved = 1;
|
||||||
|
pthread_cond_broadcast(&android_app->cond);
|
||||||
|
pthread_mutex_unlock(&android_app->mutex);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case APP_CMD_RESUME:
|
||||||
|
free_saved_state(android_app);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void android_app_destroy(struct android_app* android_app) {
|
||||||
|
LOGV("android_app_destroy!");
|
||||||
|
free_saved_state(android_app);
|
||||||
|
pthread_mutex_lock(&android_app->mutex);
|
||||||
|
if (android_app->inputQueue != NULL) {
|
||||||
|
AInputQueue_detachLooper(android_app->inputQueue);
|
||||||
|
}
|
||||||
|
AConfiguration_delete(android_app->config);
|
||||||
|
android_app->destroyed = 1;
|
||||||
|
pthread_cond_broadcast(&android_app->cond);
|
||||||
|
pthread_mutex_unlock(&android_app->mutex);
|
||||||
|
// После этого нельзя изменять объект android_app.
|
||||||
|
}
|
||||||
|
|
||||||
|
static void process_input(struct android_app* app, struct android_poll_source* source) {
|
||||||
|
AInputEvent* event = NULL;
|
||||||
|
while (AInputQueue_getEvent(app->inputQueue, &event) >= 0) {
|
||||||
|
LOGV("New input event: type=%d\n", AInputEvent_getType(event));
|
||||||
|
if (AInputQueue_preDispatchEvent(app->inputQueue, event)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
int32_t handled = 0;
|
||||||
|
if (app->onInputEvent != NULL) handled = app->onInputEvent(app, event);
|
||||||
|
AInputQueue_finishEvent(app->inputQueue, event, handled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void process_cmd(struct android_app* app, struct android_poll_source* source) {
|
||||||
|
int8_t cmd = android_app_read_cmd(app);
|
||||||
|
android_app_pre_exec_cmd(app, cmd);
|
||||||
|
if (app->onAppCmd != NULL) app->onAppCmd(app, cmd);
|
||||||
|
android_app_post_exec_cmd(app, cmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void* android_app_entry(void* param) {
|
||||||
|
struct android_app* android_app = (struct android_app*)param;
|
||||||
|
|
||||||
|
android_app->config = AConfiguration_new();
|
||||||
|
AConfiguration_fromAssetManager(android_app->config, android_app->activity->assetManager);
|
||||||
|
|
||||||
|
print_cur_config(android_app);
|
||||||
|
|
||||||
|
android_app->cmdPollSource.id = LOOPER_ID_MAIN;
|
||||||
|
android_app->cmdPollSource.app = android_app;
|
||||||
|
android_app->cmdPollSource.process = process_cmd;
|
||||||
|
android_app->inputPollSource.id = LOOPER_ID_INPUT;
|
||||||
|
android_app->inputPollSource.app = android_app;
|
||||||
|
android_app->inputPollSource.process = process_input;
|
||||||
|
|
||||||
|
ALooper* looper = ALooper_prepare(ALOOPER_PREPARE_ALLOW_NON_CALLBACKS);
|
||||||
|
ALooper_addFd(looper, android_app->msgread, LOOPER_ID_MAIN, ALOOPER_EVENT_INPUT, NULL,
|
||||||
|
&android_app->cmdPollSource);
|
||||||
|
android_app->looper = looper;
|
||||||
|
|
||||||
|
pthread_mutex_lock(&android_app->mutex);
|
||||||
|
android_app->running = 1;
|
||||||
|
pthread_cond_broadcast(&android_app->cond);
|
||||||
|
pthread_mutex_unlock(&android_app->mutex);
|
||||||
|
|
||||||
|
android_main(android_app);
|
||||||
|
|
||||||
|
android_app_destroy(android_app);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------
|
||||||
|
// Взаимодействие NativeАctivity (вызванное из основного потока)
|
||||||
|
// --------------------------------------------------------------------
|
||||||
|
|
||||||
|
static struct android_app* android_app_create(ANativeActivity* activity,
|
||||||
|
void* savedState, size_t savedStateSize) {
|
||||||
|
struct android_app* android_app = (struct android_app*)malloc(sizeof(struct android_app));
|
||||||
|
memset(android_app, 0, sizeof(struct android_app));
|
||||||
|
android_app->activity = activity;
|
||||||
|
|
||||||
|
pthread_mutex_init(&android_app->mutex, NULL);
|
||||||
|
pthread_cond_init(&android_app->cond, NULL);
|
||||||
|
|
||||||
|
if (savedState != NULL) {
|
||||||
|
android_app->savedState = malloc(savedStateSize);
|
||||||
|
android_app->savedStateSize = savedStateSize;
|
||||||
|
memcpy(android_app->savedState, savedState, savedStateSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
int msgpipe[2];
|
||||||
|
if (pipe(msgpipe)) {
|
||||||
|
LOGE("could not create pipe: %s", strerror(errno));
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
android_app->msgread = msgpipe[0];
|
||||||
|
android_app->msgwrite = msgpipe[1];
|
||||||
|
|
||||||
|
pthread_attr_t attr;
|
||||||
|
pthread_attr_init(&attr);
|
||||||
|
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
|
||||||
|
pthread_create(&android_app->thread, &attr, android_app_entry, android_app);
|
||||||
|
|
||||||
|
// Дождитесь запуска потока.
|
||||||
|
pthread_mutex_lock(&android_app->mutex);
|
||||||
|
while (!android_app->running) {
|
||||||
|
pthread_cond_wait(&android_app->cond, &android_app->mutex);
|
||||||
|
}
|
||||||
|
pthread_mutex_unlock(&android_app->mutex);
|
||||||
|
|
||||||
|
return android_app;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void android_app_write_cmd(struct android_app* android_app, int8_t cmd) {
|
||||||
|
if (write(android_app->msgwrite, &cmd, sizeof(cmd)) != sizeof(cmd)) {
|
||||||
|
LOGE("Failure writing android_app cmd: %s\n", strerror(errno));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void android_app_set_input(struct android_app* android_app, AInputQueue* inputQueue) {
|
||||||
|
pthread_mutex_lock(&android_app->mutex);
|
||||||
|
android_app->pendingInputQueue = inputQueue;
|
||||||
|
android_app_write_cmd(android_app, APP_CMD_INPUT_CHANGED);
|
||||||
|
while (android_app->inputQueue != android_app->pendingInputQueue) {
|
||||||
|
pthread_cond_wait(&android_app->cond, &android_app->mutex);
|
||||||
|
}
|
||||||
|
pthread_mutex_unlock(&android_app->mutex);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void android_app_set_window(struct android_app* android_app, ANativeWindow* window) {
|
||||||
|
pthread_mutex_lock(&android_app->mutex);
|
||||||
|
if (android_app->pendingWindow != NULL) {
|
||||||
|
android_app_write_cmd(android_app, APP_CMD_TERM_WINDOW);
|
||||||
|
}
|
||||||
|
android_app->pendingWindow = window;
|
||||||
|
if (window != NULL) {
|
||||||
|
android_app_write_cmd(android_app, APP_CMD_INIT_WINDOW);
|
||||||
|
}
|
||||||
|
while (android_app->window != android_app->pendingWindow) {
|
||||||
|
pthread_cond_wait(&android_app->cond, &android_app->mutex);
|
||||||
|
}
|
||||||
|
pthread_mutex_unlock(&android_app->mutex);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void android_app_set_activity_state(struct android_app* android_app, int8_t cmd) {
|
||||||
|
pthread_mutex_lock(&android_app->mutex);
|
||||||
|
android_app_write_cmd(android_app, cmd);
|
||||||
|
while (android_app->activityState != cmd) {
|
||||||
|
pthread_cond_wait(&android_app->cond, &android_app->mutex);
|
||||||
|
}
|
||||||
|
pthread_mutex_unlock(&android_app->mutex);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void android_app_free(struct android_app* android_app) {
|
||||||
|
pthread_mutex_lock(&android_app->mutex);
|
||||||
|
android_app_write_cmd(android_app, APP_CMD_DESTROY);
|
||||||
|
while (!android_app->destroyed) {
|
||||||
|
pthread_cond_wait(&android_app->cond, &android_app->mutex);
|
||||||
|
}
|
||||||
|
pthread_mutex_unlock(&android_app->mutex);
|
||||||
|
|
||||||
|
close(android_app->msgread);
|
||||||
|
close(android_app->msgwrite);
|
||||||
|
pthread_cond_destroy(&android_app->cond);
|
||||||
|
pthread_mutex_destroy(&android_app->mutex);
|
||||||
|
free(android_app);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void onDestroy(ANativeActivity* activity) {
|
||||||
|
LOGV("Destroy: %p\n", activity);
|
||||||
|
android_app_free((struct android_app*)activity->instance);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void onStart(ANativeActivity* activity) {
|
||||||
|
LOGV("Start: %p\n", activity);
|
||||||
|
android_app_set_activity_state((struct android_app*)activity->instance, APP_CMD_START);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void onResume(ANativeActivity* activity) {
|
||||||
|
LOGV("Resume: %p\n", activity);
|
||||||
|
android_app_set_activity_state((struct android_app*)activity->instance, APP_CMD_RESUME);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void* onSaveInstanceState(ANativeActivity* activity, size_t* outLen) {
|
||||||
|
struct android_app* android_app = (struct android_app*)activity->instance;
|
||||||
|
void* savedState = NULL;
|
||||||
|
|
||||||
|
LOGV("SaveInstanceState: %p\n", activity);
|
||||||
|
pthread_mutex_lock(&android_app->mutex);
|
||||||
|
android_app->stateSaved = 0;
|
||||||
|
android_app_write_cmd(android_app, APP_CMD_SAVE_STATE);
|
||||||
|
while (!android_app->stateSaved) {
|
||||||
|
pthread_cond_wait(&android_app->cond, &android_app->mutex);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (android_app->savedState != NULL) {
|
||||||
|
savedState = android_app->savedState;
|
||||||
|
*outLen = android_app->savedStateSize;
|
||||||
|
android_app->savedState = NULL;
|
||||||
|
android_app->savedStateSize = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
pthread_mutex_unlock(&android_app->mutex);
|
||||||
|
|
||||||
|
return savedState;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void onPause(ANativeActivity* activity) {
|
||||||
|
LOGV("Pause: %p\n", activity);
|
||||||
|
android_app_set_activity_state((struct android_app*)activity->instance, APP_CMD_PAUSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void onStop(ANativeActivity* activity) {
|
||||||
|
LOGV("Stop: %p\n", activity);
|
||||||
|
android_app_set_activity_state((struct android_app*)activity->instance, APP_CMD_STOP);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void onConfigurationChanged(ANativeActivity* activity) {
|
||||||
|
struct android_app* android_app = (struct android_app*)activity->instance;
|
||||||
|
LOGV("ConfigurationChanged: %p\n", activity);
|
||||||
|
android_app_write_cmd(android_app, APP_CMD_CONFIG_CHANGED);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void onLowMemory(ANativeActivity* activity) {
|
||||||
|
struct android_app* android_app = (struct android_app*)activity->instance;
|
||||||
|
LOGV("LowMemory: %p\n", activity);
|
||||||
|
android_app_write_cmd(android_app, APP_CMD_LOW_MEMORY);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void onWindowFocusChanged(ANativeActivity* activity, int focused) {
|
||||||
|
LOGV("WindowFocusChanged: %p -- %d\n", activity, focused);
|
||||||
|
android_app_write_cmd((struct android_app*)activity->instance,
|
||||||
|
focused ? APP_CMD_GAINED_FOCUS : APP_CMD_LOST_FOCUS);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void onNativeWindowCreated(ANativeActivity* activity, ANativeWindow* window) {
|
||||||
|
LOGV("NativeWindowCreated: %p -- %p\n", activity, window);
|
||||||
|
android_app_set_window((struct android_app*)activity->instance, window);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void onNativeWindowDestroyed(ANativeActivity* activity, ANativeWindow* window) {
|
||||||
|
LOGV("NativeWindowDestroyed: %p -- %p\n", activity, window);
|
||||||
|
android_app_set_window((struct android_app*)activity->instance, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void onInputQueueCreated(ANativeActivity* activity, AInputQueue* queue) {
|
||||||
|
LOGV("InputQueueCreated: %p -- %p\n", activity, queue);
|
||||||
|
android_app_set_input((struct android_app*)activity->instance, queue);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void onInputQueueDestroyed(ANativeActivity* activity, AInputQueue* queue) {
|
||||||
|
LOGV("InputQueueDestroyed: %p -- %p\n", activity, queue);
|
||||||
|
android_app_set_input((struct android_app*)activity->instance, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ANativeActivity_onCreate(ANativeActivity* activity,
|
||||||
|
void* savedState, size_t savedStateSize) {
|
||||||
|
LOGV("Creating: %p\n", activity);
|
||||||
|
activity->callbacks->onDestroy = onDestroy;
|
||||||
|
activity->callbacks->onStart = onStart;
|
||||||
|
activity->callbacks->onResume = onResume;
|
||||||
|
activity->callbacks->onSaveInstanceState = onSaveInstanceState;
|
||||||
|
activity->callbacks->onPause = onPause;
|
||||||
|
activity->callbacks->onStop = onStop;
|
||||||
|
activity->callbacks->onConfigurationChanged = onConfigurationChanged;
|
||||||
|
activity->callbacks->onLowMemory = onLowMemory;
|
||||||
|
activity->callbacks->onWindowFocusChanged = onWindowFocusChanged;
|
||||||
|
activity->callbacks->onNativeWindowCreated = onNativeWindowCreated;
|
||||||
|
activity->callbacks->onNativeWindowDestroyed = onNativeWindowDestroyed;
|
||||||
|
activity->callbacks->onInputQueueCreated = onInputQueueCreated;
|
||||||
|
activity->callbacks->onInputQueueDestroyed = onInputQueueDestroyed;
|
||||||
|
|
||||||
|
activity->instance = android_app_create(activity, savedState, savedStateSize);
|
||||||
|
}
|
@ -0,0 +1,344 @@
|
|||||||
|
/*
|
||||||
|
* © 2010 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Лицензировано по лицензии Apache License, версия 2.0 ( "Лицензия");
|
||||||
|
*этот файл можно использовать только в соответствии с лицензией.
|
||||||
|
*Копию лицензии можно получить на веб-сайте
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
*Если только не требуется в соответствии с применимым законодательством или согласовано в письменном виде, программное обеспечение
|
||||||
|
* распространяется в рамках лицензии на УСЛОВИЯХ "КАК ЕСТЬ",
|
||||||
|
* БЕЗ ГАРАНТИЙ И УСЛОВИЙ ЛЮБОГО РОДА, явно выраженных и подразумеваемых.
|
||||||
|
* См. лицензию для получения информации об определенных разрешениях по использованию языка и
|
||||||
|
* ограничениях в рамках лицензии.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _ANDROID_NATIVE_APP_GLUE_H
|
||||||
|
#define _ANDROID_NATIVE_APP_GLUE_H
|
||||||
|
|
||||||
|
#include <poll.h>
|
||||||
|
#include <pthread.h>
|
||||||
|
#include <sched.h>
|
||||||
|
|
||||||
|
#include <android/configuration.h>
|
||||||
|
#include <android/looper.h>
|
||||||
|
#include <android/native_activity.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Интерфейс NativeActivity, предоставленный <android/native_activity.h>,
|
||||||
|
* основан на наборе предоставленных приложением обратных вызовов, которые вызываются
|
||||||
|
*основным потоком действия при возникновении определенных событий.
|
||||||
|
*
|
||||||
|
* Это означает, что ни один из данных обратных вызовов _не_ _должен_ блокироваться, иначе
|
||||||
|
* существует риск принудительного закрытия приложения системой. Эта модель программирования
|
||||||
|
* прямая, простая, но имеет ограничения.
|
||||||
|
*
|
||||||
|
* Статическая библиотека threaded_native_app используется для обеспечения другой
|
||||||
|
* модели выполнения, в которой приложение может реализовать свой собственный цикл главного события
|
||||||
|
* в другом потоке вместо этого. Это работает так:
|
||||||
|
*
|
||||||
|
* 1/ Приложение должно предоставить функцию с именем android_main(), которая
|
||||||
|
* будет вызываться при создании действия в новом потоке,
|
||||||
|
* отличающемся от основного потока действия.
|
||||||
|
*
|
||||||
|
* 2/ android_main() получает указатель на допустимую структуру android_app,
|
||||||
|
* которая содержит ссылки на другие важные объекты, например экземпляр объекта
|
||||||
|
* ANativeActivity, где выполняется приложение.
|
||||||
|
*
|
||||||
|
* 3/ Объект android_app содержит экземпляр ALooper, который уже
|
||||||
|
* ожидает две важных вещи:
|
||||||
|
*
|
||||||
|
* - событий жизненного цикла действия (например, "pause", "resume"). См. объявления APP_CMD_XXX
|
||||||
|
* ниже.
|
||||||
|
*
|
||||||
|
* - входных событий, поступающих из очереди AInputQueue, присоединенной к действию.
|
||||||
|
*
|
||||||
|
* Каждое из этих событий соответствует идентификатору ALooper, возвращенному
|
||||||
|
* ALooper_pollOnce со значениями LOOPER_ID_MAIN и LOOPER_ID_INPUT,
|
||||||
|
*, соответственно.
|
||||||
|
*
|
||||||
|
* Ваше приложение может использовать тот же ALooper для прослушивания дополнительных
|
||||||
|
* дескрипторов файла. Они могут быть основаны либо на обратных вызовах, либо поступают с идентификаторами возврата,
|
||||||
|
* начинающимися с LOOPER_ID_USER.
|
||||||
|
*
|
||||||
|
* 4/ При получении события LOOPER_ID_MAIN или LOOPER_ID_INPUT
|
||||||
|
* возвращенные данные будут указывать на структуру android_poll_source. Для нее
|
||||||
|
* можно вызвать функцию process() и заполнить android_app->onAppCmd
|
||||||
|
* и android_app->onInputEvent, для того чтобы они вызывались для вашей собственной обработки
|
||||||
|
* события.
|
||||||
|
*
|
||||||
|
* Вместо этого можно вызвать функции нижнего уровня для чтения и обработки
|
||||||
|
* данных непосредственно... посмотрите на реализации process_cmd() и process_input()
|
||||||
|
* в приклеивании, чтобы выяснить, как это делается.
|
||||||
|
*
|
||||||
|
* См. пример "native-activity" в NDK с
|
||||||
|
* полной демонстрацией использования. Также посмотрите JavaDoc в NativeActivity.
|
||||||
|
*/
|
||||||
|
|
||||||
|
struct android_app;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Данные, связанные с ALooper fd, которые будут возвращаться как outData
|
||||||
|
* при готовности данных в этом источнике.
|
||||||
|
*/
|
||||||
|
struct android_poll_source {
|
||||||
|
// Идентификатор данного источника. Может быть LOOPER_ID_MAIN или
|
||||||
|
// LOOPER_ID_INPUT.
|
||||||
|
int32_t id;
|
||||||
|
|
||||||
|
// android_app, с которым связан данный идентификатор.
|
||||||
|
struct android_app* app;
|
||||||
|
|
||||||
|
// Функция, вызываемая для стандартной обработки данных из
|
||||||
|
// этого источника.
|
||||||
|
void (*process)(struct android_app* app, struct android_poll_source* source);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Это интерфейс стандартного кода приклеивания поточного
|
||||||
|
* приложения. В этой модели код приложения выполняется
|
||||||
|
* в своем собственном потоке, отдельном от основного потока процесса.
|
||||||
|
* Не требуется связь данного потока с ВМ Java
|
||||||
|
*, хотя это необходимо для выполнения вызовов JNI любых
|
||||||
|
* объектов Java.
|
||||||
|
*/
|
||||||
|
struct android_app {
|
||||||
|
// Приложение может поместить указатель на свой собственный объект состояния
|
||||||
|
// здесь, если нужно.
|
||||||
|
void* userData;
|
||||||
|
|
||||||
|
// Введите здесь код функции для обработки основных команд приложения (APP_CMD_*)
|
||||||
|
void (*onAppCmd)(struct android_app* app, int32_t cmd);
|
||||||
|
|
||||||
|
// Введите здесь код функции для обработки входных событий. Сейчас
|
||||||
|
// событие уже было предварительно отправлено и будет завершено при
|
||||||
|
// возврате. Верните 1, если событие обработано, 0 — для любой диспетчеризации
|
||||||
|
// по умолчанию.
|
||||||
|
int32_t (*onInputEvent)(struct android_app* app, AInputEvent* event);
|
||||||
|
|
||||||
|
// Экземпляр объекта ANativeActivity, в котором выполняется это приложение.
|
||||||
|
ANativeActivity* activity;
|
||||||
|
|
||||||
|
// Текущая конфигурация, в которой выполняется это приложение.
|
||||||
|
AConfiguration* config;
|
||||||
|
|
||||||
|
// Это последнее сохраненное состояние экземпляра, предоставленное во время создания.
|
||||||
|
// Значение равно NULL, если состояния не было. Можно использовать это по мере необходимости;
|
||||||
|
// память останется доступной до вызова android_app_exec_cmd() для
|
||||||
|
// APP_CMD_RESUME, после чего она будет освобождена, а savedState получит значение NULL.
|
||||||
|
// Эти переменные необходимо изменять только при обработке APP_CMD_SAVE_STATE,
|
||||||
|
// когда их значения будут инициализироваться в NULL и можно будет выполнить malloc для
|
||||||
|
// состояния и поместить здесь информацию. В этом случае память будет
|
||||||
|
// освобождена позднее.
|
||||||
|
void* savedState;
|
||||||
|
size_t savedStateSize;
|
||||||
|
|
||||||
|
// ALooper, связанный с потоком приложения.
|
||||||
|
ALooper* looper;
|
||||||
|
|
||||||
|
// Если значение не равно NULL, то это входная очередь, из которой приложение будет
|
||||||
|
// получать входные события пользователя.
|
||||||
|
AInputQueue* inputQueue;
|
||||||
|
|
||||||
|
// Если значение не равно NULL, то это поверхность окна, в котором приложение может рисовать.
|
||||||
|
ANativeWindow* window;
|
||||||
|
|
||||||
|
// Текущий прямоугольник содержимого окна. Это область, в которой
|
||||||
|
// должно помещаться содержимое окна, чтобы его видел пользователь.
|
||||||
|
ARect contentRect;
|
||||||
|
|
||||||
|
// Текущее состояние действия приложения. Может быть APP_CMD_START,
|
||||||
|
// APP_CMD_RESUME, APP_CMD_PAUSE или APP_CMD_STOP; см. ниже.
|
||||||
|
int activityState;
|
||||||
|
|
||||||
|
// Значение не равно нулю, когда NativeActivity приложения
|
||||||
|
// разрушается и ожидает завершения потока приложения.
|
||||||
|
int destroyRequested;
|
||||||
|
|
||||||
|
// -------------------------------------------------
|
||||||
|
// Ниже показан "частная" реализация кода прилипания.
|
||||||
|
|
||||||
|
pthread_mutex_t mutex;
|
||||||
|
pthread_cond_t cond;
|
||||||
|
|
||||||
|
int msgread;
|
||||||
|
int msgwrite;
|
||||||
|
|
||||||
|
pthread_t thread;
|
||||||
|
|
||||||
|
struct android_poll_source cmdPollSource;
|
||||||
|
struct android_poll_source inputPollSource;
|
||||||
|
|
||||||
|
int running;
|
||||||
|
int stateSaved;
|
||||||
|
int destroyed;
|
||||||
|
int redrawNeeded;
|
||||||
|
AInputQueue* pendingInputQueue;
|
||||||
|
ANativeWindow* pendingWindow;
|
||||||
|
ARect pendingContentRect;
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
/**
|
||||||
|
* Идентификатор данных Looper команд, поступающих из основного потока приложения, который
|
||||||
|
* возвращается как идентификатор от ALooper_pollOnce(). Данные для этого идентификатора
|
||||||
|
* являются указателем на структуру android_poll_source.
|
||||||
|
* Их можно извлечь и обработать с помощью android_app_read_cmd()
|
||||||
|
* и android_app_exec_cmd().
|
||||||
|
*/
|
||||||
|
LOOPER_ID_MAIN = 1,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Идентификатор данных Looper событий, поступающий из AInputQueue окна
|
||||||
|
* приложения, который возвращается как идентификатор из
|
||||||
|
* ALooper_pollOnce(). Данные этого идентификатора являются указателем на структуру
|
||||||
|
* android_poll_source. Их можно прочитать через объект inputQueue
|
||||||
|
* приложения android_app.
|
||||||
|
*/
|
||||||
|
LOOPER_ID_INPUT = 2,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Запуск определяемых пользователем идентификаторов ALooper.
|
||||||
|
*/
|
||||||
|
LOOPER_ID_USER = 3,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
/**
|
||||||
|
* Команда из основного потока: AInputQueue изменена. После обработки
|
||||||
|
* этой команды android_app->inputQueue будет обновлена в новую очередь
|
||||||
|
* (или NULL).
|
||||||
|
*/
|
||||||
|
APP_CMD_INPUT_CHANGED,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Команда из основного потока: новое окно ANativeWindow готово к использованию. После
|
||||||
|
* получения этой команды окно android_app-> будет содержать новую поверхность
|
||||||
|
*окна.
|
||||||
|
*/
|
||||||
|
APP_CMD_INIT_WINDOW,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Команда из основного потока: существующее окно ANativeWindow необходимо
|
||||||
|
* прекратить. После получения этой команды окно android_app->по-прежнему
|
||||||
|
* содержит существующее окно; после вызова android_app_exec_cmd
|
||||||
|
* оно получит значение NULL.
|
||||||
|
*/
|
||||||
|
APP_CMD_TERM_WINDOW,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Команда из основного потока: текущее окно ANativeWindow изменило размер.
|
||||||
|
* Перерисуйте согласно новом размеру.
|
||||||
|
*/
|
||||||
|
APP_CMD_WINDOW_RESIZED,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Команда из основного потока: системе необходимо, чтобы текущее окно ANativeWindow
|
||||||
|
* было перерисовано. Необходимо перерисовать окно перед ее передачей в
|
||||||
|
* android_app_exec_cmd(), чтобы избежать переходных сбоев рисования.
|
||||||
|
*/
|
||||||
|
APP_CMD_WINDOW_REDRAW_NEEDED,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Команда из основного потока: область содержимого окна изменена
|
||||||
|
* таким образом, что из функционального ввода окно показывается или скрывается. Можно
|
||||||
|
* найти новый прямоугольник содержимого в android_app::contentRect.
|
||||||
|
*/
|
||||||
|
APP_CMD_CONTENT_RECT_CHANGED,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Команда из основного потока: окно действия приложения получило
|
||||||
|
* фокус ввода.
|
||||||
|
*/
|
||||||
|
APP_CMD_GAINED_FOCUS,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Команда из основного потока: окно действия приложения потеряло
|
||||||
|
* фокус ввода.
|
||||||
|
*/
|
||||||
|
APP_CMD_LOST_FOCUS,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Команда из основного потока: изменена текущая конфигурация устройства.
|
||||||
|
*/
|
||||||
|
APP_CMD_CONFIG_CHANGED,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Команда из основного потока: системе не хватает памяти.
|
||||||
|
* Попробуйте уменьшить использование памяти.
|
||||||
|
*/
|
||||||
|
APP_CMD_LOW_MEMORY,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Команда из основного потока: действие приложения было запущено.
|
||||||
|
*/
|
||||||
|
APP_CMD_START,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Команда из основного потока: действие приложения было возобновлено.
|
||||||
|
*/
|
||||||
|
APP_CMD_RESUME,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Команда из основного потока: приложение должно создать новое сохраненное состояние
|
||||||
|
* для себя, чтобы восстанавливаться из него позднее в случае необходимости. Если вы сохранили состояние,
|
||||||
|
* выделите его с использованием malloc и поместите в android_app.savedState с
|
||||||
|
* размером android_app.savedStateSize. Память будет освобождена
|
||||||
|
* позднее.
|
||||||
|
*/
|
||||||
|
APP_CMD_SAVE_STATE,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Команда из основного потока: пауза в действии приложения.
|
||||||
|
*/
|
||||||
|
APP_CMD_PAUSE,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Команда из основного потока: действие приложения было остановлено.
|
||||||
|
*/
|
||||||
|
APP_CMD_STOP,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Команда из основного потока: действие приложения уничтожается,
|
||||||
|
* и ожидает очистки потока приложения и выхода перед обработкой.
|
||||||
|
*/
|
||||||
|
APP_CMD_DESTROY,
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Вызовите, когда ALooper_pollAll() возвращает LOOPER_ID_MAIN, при чтении следующего сообщения команды
|
||||||
|
*приложения.
|
||||||
|
*/
|
||||||
|
int8_t android_app_read_cmd(struct android_app* android_app);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Вызовите с помощью команды, возвращенной android_app_read_cmd() для выполнения
|
||||||
|
* начальной предварительной обработки данной команды. Можно выполнить собственные
|
||||||
|
* действия для команды после вызова этой функции.
|
||||||
|
*/
|
||||||
|
void android_app_pre_exec_cmd(struct android_app* android_app, int8_t cmd);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Вызовите с помощью команды, возвращенной android_app_read_cmd(), для
|
||||||
|
* окончательной предварительной обработки данной команды. Необходимо завершить собственные
|
||||||
|
* действия с командой до вызова этой функции.
|
||||||
|
*/
|
||||||
|
void android_app_post_exec_cmd(struct android_app* android_app, int8_t cmd);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Это функция, которую должен реализовать код приложения, представляет собой
|
||||||
|
* главный вход в приложение.
|
||||||
|
*/
|
||||||
|
extern void android_main(struct android_app* app);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _ANDROID_NATIVE_APP_GLUE_H */
|
@ -0,0 +1,64 @@
|
|||||||
|
/*******************************************************************************************
|
||||||
|
*
|
||||||
|
* raylib [core] example - Basic window
|
||||||
|
*
|
||||||
|
* This example has been created using raylib 3.8 (www.raylib.com)
|
||||||
|
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
||||||
|
*
|
||||||
|
* Example contributed by <user_name> (@<user_github>) and reviewed by Ramon Santamaria (@raysan5)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2021 <user_name> (@<user_github>)
|
||||||
|
|
||||||
|
* Adapt for Visual Studio: Vadim Boev (Kronka Dev)
|
||||||
|
*
|
||||||
|
********************************************************************************************/
|
||||||
|
#include "android_native_app_glue.h"
|
||||||
|
|
||||||
|
#include "../../../../src/raylib.h"
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
// Initialization
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
const int screenWidth = 800;
|
||||||
|
const int screenHeight = 450;
|
||||||
|
|
||||||
|
InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");
|
||||||
|
|
||||||
|
// TODO: Load resources / Initialize variables at this point
|
||||||
|
|
||||||
|
SetTargetFPS(60);
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Main game loop
|
||||||
|
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||||
|
{
|
||||||
|
// Update
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
// TODO: Update variables / Implement example logic at this point
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Draw
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
BeginDrawing();
|
||||||
|
|
||||||
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
|
// TODO: Draw everything that requires to be drawn at this point:
|
||||||
|
|
||||||
|
DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY); // Example
|
||||||
|
|
||||||
|
EndDrawing();
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
}
|
||||||
|
|
||||||
|
// De-Initialization
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// TODO: Unload all loaded resources at this point
|
||||||
|
|
||||||
|
CloseWindow(); // Close window and OpenGL context
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
@ -0,0 +1,226 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug|ARM">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>ARM</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|ARM">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>ARM</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug|ARM64">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>ARM64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|ARM64">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>ARM64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug|x64">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|x64">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug|x86">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>x86</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|x86">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>x86</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectGuid>{bfb31759-4fca-4503-bc7c-a97f705efdb2}</ProjectGuid>
|
||||||
|
<Keyword>Android</Keyword>
|
||||||
|
<RootNamespace>raylib_android</RootNamespace>
|
||||||
|
<DefaultLanguage>en-US</DefaultLanguage>
|
||||||
|
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
|
||||||
|
<ApplicationType>Android</ApplicationType>
|
||||||
|
<ApplicationTypeRevision>3.0</ApplicationTypeRevision>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>Clang_5_0</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>Clang_5_0</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>Clang_5_0</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>Clang_5_0</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>Clang_5_0</PlatformToolset>
|
||||||
|
<AndroidAPILevel>android-29</AndroidAPILevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>Clang_5_0</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>Clang_5_0</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>Clang_5_0</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Label="ExtensionSettings">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="Shared">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||||
|
<TargetName>libmain</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'" />
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
<CompileAs>CompileAsC</CompileAs>
|
||||||
|
<CLanguageStandard>c99</CLanguageStandard>
|
||||||
|
<CppLanguageStandard>Default</CppLanguageStandard>
|
||||||
|
<PrecompiledHeaderCompileAs>CompileAsC</PrecompiledHeaderCompileAs>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<LibraryDependencies>%(LibraryDependencies);EGL;GLESv2;log;android;c;m;raylib</LibraryDependencies>
|
||||||
|
<AdditionalLibraryDirectories>../../../../src/;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
<CompileAs>CompileAsC</CompileAs>
|
||||||
|
<CLanguageStandard>c99</CLanguageStandard>
|
||||||
|
<CppLanguageStandard>Default</CppLanguageStandard>
|
||||||
|
<PrecompiledHeaderCompileAs>CompileAsC</PrecompiledHeaderCompileAs>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<LibraryDependencies>%(LibraryDependencies);GLESv1_CM;EGL;</LibraryDependencies>
|
||||||
|
<AdditionalLibraryDirectories>.;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
<CompileAs>CompileAsCpp</CompileAs>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<LibraryDependencies>%(LibraryDependencies);GLESv1_CM;EGL;</LibraryDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
<CompileAs>CompileAsCpp</CompileAs>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<LibraryDependencies>%(LibraryDependencies);GLESv1_CM;EGL;</LibraryDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
<CompileAs>CompileAsCpp</CompileAs>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<LibraryDependencies>%(LibraryDependencies);GLESv1_CM;EGL;</LibraryDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
<CompileAs>CompileAsCpp</CompileAs>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<LibraryDependencies>%(LibraryDependencies);GLESv1_CM;EGL;</LibraryDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
<CompileAs>CompileAsCpp</CompileAs>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<LibraryDependencies>%(LibraryDependencies);GLESv1_CM;EGL;</LibraryDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
<CompileAs>CompileAsCpp</CompileAs>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<LibraryDependencies>%(LibraryDependencies);GLESv1_CM;EGL;</LibraryDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="android_native_app_glue.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="android_native_app_glue.c" />
|
||||||
|
<ClCompile Include="main.c" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|