Merge branch 'master' of github.com:raysan5/raylib into fork/master
This commit is contained in:
commit
8f1d6f3850
422 changed files with 81996 additions and 27250 deletions
53
.gitignore
vendored
53
.gitignore
vendored
|
|
@ -6,13 +6,6 @@
|
||||||
*.swo
|
*.swo
|
||||||
*~
|
*~
|
||||||
|
|
||||||
# Ignore Android generated files and folders
|
|
||||||
src_android/obj/
|
|
||||||
templates/android_project/bin/
|
|
||||||
templates/android_project/obj/
|
|
||||||
templates/android_project/libs/
|
|
||||||
local.properties
|
|
||||||
|
|
||||||
# Ignore thumbnails created by windows
|
# Ignore thumbnails created by windows
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
|
||||||
|
|
@ -42,7 +35,7 @@ Thumbs.db
|
||||||
*.sbr
|
*.sbr
|
||||||
*.sdf
|
*.sdf
|
||||||
obj/
|
obj/
|
||||||
[Rr]elease/
|
[R]elease/
|
||||||
[Rr]elease.win32/
|
[Rr]elease.win32/
|
||||||
_ReSharper*/
|
_ReSharper*/
|
||||||
[Tt]est[Rr]esult*
|
[Tt]est[Rr]esult*
|
||||||
|
|
@ -89,22 +82,21 @@ xcschememanagement.plist
|
||||||
._.*
|
._.*
|
||||||
xcuserdata/
|
xcuserdata/
|
||||||
DerivedData/
|
DerivedData/
|
||||||
*.dll
|
|
||||||
|
|
||||||
# external libraries DLLs
|
|
||||||
!src/external/glfw3/lib/win32/glfw3.dll
|
|
||||||
!src/external/openal_soft/lib/win32/OpenAL32.dll
|
|
||||||
|
|
||||||
# Visual Studio project
|
# Visual Studio project
|
||||||
project/vs2015/*.db
|
project/vs2015/*.db
|
||||||
project/vs2015/*.opendb
|
project/vs2015/*.opendb
|
||||||
|
project/vs2015.UWP/packages
|
||||||
|
project/vs2015.UWP/*.db
|
||||||
!project/vs2015/raylib.sln
|
!project/vs2015/raylib.sln
|
||||||
!project/vs2015/raylib/*.vcxproj
|
!project/vs2015/raylib/*.vcxproj
|
||||||
!project/vs2015/examples/*.vcxproj
|
!project/vs2015/examples/*.vcxproj
|
||||||
!project/vs2015/external/glfw3/lib/win32/glfw3.dll
|
!project/vs2017/raylib.sln
|
||||||
!project/vs2015/external/openal_soft/lib/win32/OpenAL32.dll
|
!project/vs2017/raylib/*.vcxproj
|
||||||
!project/vs2015/external/openal_soft/lib/win64/OpenAL32.dll
|
!project/vs2017/examples/*.vcxproj
|
||||||
!project/vs2015/external/lua/lib/win32/lua53.dll
|
!project/vs2015.UWP/raylib/*.vcxproj
|
||||||
|
!project/vs2015.UWP/*.sln
|
||||||
|
!project/vs2015.UWP/raylib.App.UWP/*.vcxproj
|
||||||
|
|
||||||
# Web examples
|
# Web examples
|
||||||
docs/examples/web/*.html
|
docs/examples/web/*.html
|
||||||
|
|
@ -119,37 +111,26 @@ docs/examples/web/*/*.html
|
||||||
!docs/examples/web/shaders/loader.html
|
!docs/examples/web/shaders/loader.html
|
||||||
!docs/examples/web/models/loader.html
|
!docs/examples/web/models/loader.html
|
||||||
|
|
||||||
# raylib release libs
|
|
||||||
src/libraylib.a
|
|
||||||
src/libraylib.bc
|
|
||||||
!release/android/armeabi-v7a/libraylib.a
|
|
||||||
!release/android/armeabi-v7a/libraylib.so
|
|
||||||
!release/linux/libraylib.a
|
|
||||||
!release/linux/libraylib.so
|
|
||||||
!release/rpi/libraylib.a
|
|
||||||
!release/win32/mingw32/raylib.dll
|
|
||||||
|
|
||||||
# Meson build system
|
|
||||||
builddir/
|
|
||||||
|
|
||||||
# CMake stuff
|
# CMake stuff
|
||||||
CMakeCache.txt
|
CMakeCache.txt
|
||||||
CMakeFiles
|
CMakeFiles
|
||||||
CMakeScripts
|
CMakeScripts
|
||||||
Testing
|
Testing
|
||||||
Makefile
|
|
||||||
cmake_install.cmake
|
cmake_install.cmake
|
||||||
install_manifest.txt
|
install_manifest.txt
|
||||||
compile_commands.json
|
compile_commands.json
|
||||||
CTestTestfile.cmake
|
CTestTestfile.cmake
|
||||||
build
|
build
|
||||||
|
!templates/android_project/Makefile
|
||||||
|
|
||||||
# Unignore These makefiles...
|
# Unignore These makefiles...
|
||||||
!examples/CMakeLists.txt
|
!examples/CMakeLists.txt
|
||||||
!games/CMakeLists.txt
|
!games/CMakeLists.txt
|
||||||
|
|
||||||
# binaries made from raylib
|
# Ignore Android generated files and folders
|
||||||
libraylib.a
|
templates/android_project/output
|
||||||
libraylib.so
|
|
||||||
libraylib.dylib
|
# Ignore GNU global tags
|
||||||
libraylib.dll
|
GPATH
|
||||||
|
GRTAGS
|
||||||
|
GTAGS
|
||||||
|
|
|
||||||
62
.travis.yml
Normal file
62
.travis.yml
Normal file
|
|
@ -0,0 +1,62 @@
|
||||||
|
language: c
|
||||||
|
dist: trusty
|
||||||
|
|
||||||
|
git:
|
||||||
|
depth: 3
|
||||||
|
|
||||||
|
# TODO we could use a 32 bit Docker container for running true 32-bit tests
|
||||||
|
# services: - docker
|
||||||
|
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: linux
|
||||||
|
env: ARCH=i386
|
||||||
|
sudo: required
|
||||||
|
- os: linux
|
||||||
|
env: ARCH=amd64
|
||||||
|
sudo: required
|
||||||
|
- os: osx
|
||||||
|
env: ARCH=universal
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
|
||||||
|
sudo apt-get install -y gcc-multilib
|
||||||
|
libasound2-dev:$ARCH
|
||||||
|
libxcursor-dev:$ARCH libxinerama-dev:$ARCH mesa-common-dev:$ARCH
|
||||||
|
libx11-dev:$ARCH libxrandr-dev:$ARCH libxi-dev:$ARCH
|
||||||
|
libgl1-mesa-dev:$ARCH libglu1-mesa-dev:$ARCH;
|
||||||
|
export RAYLIB_PACKAGE_SUFFIX="-Linux-$ARCH";
|
||||||
|
if [ "$ARCH" == "i386" ]; then export CFLAGS="-m32"; fi;
|
||||||
|
if [ "$ARCH" == "amd64" ]; then export CFLAGS="-m64"; fi;
|
||||||
|
if [ "$GLFW" == "SYSTEM" ]; then
|
||||||
|
wget 'http://ftp.de.debian.org/debian/pool/main/g/glfw3/libglfw3_3.2.1-1_amd64.deb';
|
||||||
|
wget 'http://ftp.de.debian.org/debian/pool/main/g/glfw3/libglfw3-dev_3.2.1-1_amd64.deb';
|
||||||
|
sudo dpkg -i libglfw3_3.2.1-1_amd64.deb libglfw3-dev_3.2.1-1_amd64.deb;
|
||||||
|
fi;
|
||||||
|
fi
|
||||||
|
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
|
||||||
|
export RAYLIB_PACKAGE_SUFFIX="-macOS";
|
||||||
|
if [ "$GLFW" == "SYSTEM" ]; then brew update; brew install glfw; fi;
|
||||||
|
fi
|
||||||
|
- "$CC --version"
|
||||||
|
|
||||||
|
script:
|
||||||
|
- mkdir build
|
||||||
|
- cd build
|
||||||
|
- cmake -DMACOS_FATLIB=ON -DSTATIC=ON -DSHARED=ON -DBUILD_EXAMPLES=ON -DBUILD_GAMES=ON -DUSE_EXTERNAL_GLFW=IF_POSSIBLE ..
|
||||||
|
- make VERBOSE=1
|
||||||
|
- make package
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
provider: releases
|
||||||
|
api_key:
|
||||||
|
secure: LvqUIAN/3dJul+Ra2iK3tSaNG5IwsNMmGIwVMy0DK5IBCxiQPBc9pWGiE30RTBPt6Z+N4BhMEE8DtUl+vnISlMoHWNIIhF2zwC66hs/F7zY7qEITMRSmfiLcqxQysknFOnJB06CATgXcFqlEo9j+t4abrG/f3qcb92J4O2uNz336Au2myTx93Q5MxbyA7KiUuEutFnb2dWiPCY4d+sGeXEfsiD2R7aj/8MaWOkoGdZVrTkI9juMgvpImkjQBArvqdjUMeT3MsRrwgOIq5v2GFV9dOl8k1WzPeT8B2JHh00ed/o1/wuFq/cLLOxtYo2+Pv3+xatOrlexoX0WkDm7C9/L1W5U4rLexU3CQ9mMBmHPnp6k/WXZ5QXEE4uUF0+LpN3XlIXzFpdZmZiVV8VLxg2WvyncMmivYiu7/MTkyfZxyKkzwl7sZZslzHA9kOGedGaN7b7/2B77OFHoQK8lKfdFml7jJnarh+89nenNZYMab0E8qkOJOyb2bYlDTa0/2nyxGiyymYgq6YHLNrDbhqB/1LzdgzjMliQ8ri5q9Ux2vjfcqOzhfAmcwFwnY/D6yXJWYi0DWpHZdpKl3du6dYDrypW91/yDWbwiJ/YhrE7ZunzrcB6GH/QkbuzWxdCth39rQAHih8DG01co/K3Gvi4yGjvIH5tFUpyEolMnpMiA=
|
||||||
|
file_glob: true
|
||||||
|
file: raylib-*.tar.gz
|
||||||
|
skip_cleanup: true
|
||||||
|
on:
|
||||||
|
repo: raysan5/raylib
|
||||||
|
branch: master
|
||||||
|
tags: true
|
||||||
96
CHANGELOG
96
CHANGELOG
|
|
@ -1,7 +1,97 @@
|
||||||
changelog
|
changelog
|
||||||
---------
|
---------
|
||||||
|
|
||||||
Current Release: raylib 1.7.0 (20 May 2017)
|
Current Release: raylib 1.8.0 (Oct 2017)
|
||||||
|
|
||||||
|
-----------------------------------------------
|
||||||
|
Release: raylib 1.8.0 (Oct 2017)
|
||||||
|
-----------------------------------------------
|
||||||
|
NOTE:
|
||||||
|
In this release, multiple parts of the library have been reviewed (again) for consistency and simplification.
|
||||||
|
It exposes more than 30 new functions in comparison with previous version and it improves overall programming experience.
|
||||||
|
|
||||||
|
BIG CHANGES:
|
||||||
|
- New Image generation functions: Gradient, Checked, Noise, Cellular...
|
||||||
|
- New Mesh generation functions: Cube, Sphere, Cylinder, Torus, Knot...
|
||||||
|
- New Shaders and Materials systems to support PBR materials
|
||||||
|
- Custom Android APK build pipeline with simple Makefile
|
||||||
|
- Complete review of rlgl layer functionality
|
||||||
|
- Complete review of raymath functionality
|
||||||
|
|
||||||
|
detailed changes:
|
||||||
|
[rlgl] RENAMED: rlglLoadTexture() to rlLoadTexture()
|
||||||
|
[rlgl] RENAMED: rlglLoadRenderTexture() to rlLoadRenderTexture()
|
||||||
|
[rlgl] RENAMED: rlglUpdateTexture() to rlUpdateTexture()
|
||||||
|
[rlgl] RENAMED: rlglGenerateMipmaps() to rlGenerateMipmaps()
|
||||||
|
[rlgl] RENAMED: rlglReadScreenPixels() to rlReadScreenPixels()
|
||||||
|
[rlgl] RENAMED: rlglReadTexturePixels() to rlReadTexturePixels()
|
||||||
|
[rlgl] RENAMED: rlglLoadMesh() to rlLoadMesh()
|
||||||
|
[rlgl] RENAMED: rlglUpdateMesh() to rlUpdateMesh()
|
||||||
|
[rlgl] RENAMED: rlglDrawMesh() to rlDrawMesh()
|
||||||
|
[rlgl] RENAMED: rlglUnloadMesh() to rlUnloadMesh()
|
||||||
|
[rlgl] RENAMED: rlglUnproject() to rlUnproject()
|
||||||
|
[rlgl] RENAMED: LoadCompressedTexture() to LoadTextureCompressed()
|
||||||
|
[rlgl] RENAMED: GetDefaultTexture() to GetTextureDefault()
|
||||||
|
[rlgl] RENAMED: LoadDefaultShader() to LoadShaderDefault()
|
||||||
|
[rlgl] RENAMED: LoadDefaultShaderLocations() to SetShaderDefaultLocations()
|
||||||
|
[rlgl] RENAMED: UnloadDefaultShader() to UnLoadShaderDefault()
|
||||||
|
[rlgl] ADDED: rlGenMapCubemap(), Generate cubemap texture map from HDR texture
|
||||||
|
[rlgl] ADDED: rlGenMapIrradiance(), Generate irradiance texture map
|
||||||
|
[rlgl] ADDED: rlGenMapPrefilter(), Generate prefilter texture map
|
||||||
|
[rlgl] ADDED: rlGenMapBRDF(), Generate BRDF texture map
|
||||||
|
[rlgl] ADDED: GetVrDeviceInfo(), Get VR device information for some standard devices
|
||||||
|
[rlgl] REVIEWED: InitVrSimulator(), to accept device parameters as input
|
||||||
|
[core] ADDED: SetWindowTitle(), Set title for window (only PLATFORM_DESKTOP)
|
||||||
|
[core] ADDED: GetExtension(), Get file extension
|
||||||
|
[shapes] REMOVED: DrawRectangleGradient(), replaced by DrawRectangleGradientV() and DrawRectangleGradientH()
|
||||||
|
[shapes] ADDED: DrawRectangleGradientV(), Draw a vertical-gradient-filled rectangle
|
||||||
|
[shapes] ADDED: DrawRectangleGradientH(), Draw a horizontal-gradient-filled rectangle
|
||||||
|
[shapes] ADDED: DrawRectangleGradientEx(), Draw a gradient-filled rectangle with custom vertex colors
|
||||||
|
[shapes] ADDED: DrawRectangleT(), Draw rectangle using text character
|
||||||
|
[textures] ADDED: SaveImageAs(), Save image as PNG file
|
||||||
|
[textures] ADDED: GenImageGradientV(), Generate image: vertical gradient
|
||||||
|
[textures] ADDED: GenImageGradientH(), Generate image: horizontal gradient
|
||||||
|
[textures] ADDED: GenImageGradientRadial(), Generate image: radial gradient
|
||||||
|
[textures] ADDED: GenImageChecked(), Generate image: checked
|
||||||
|
[textures] ADDED: GenImageWhiteNoise(), Generate image: white noise
|
||||||
|
[textures] ADDED: GenImagePerlinNoise(), Generate image: perlin noise
|
||||||
|
[textures] ADDED: GenImageCellular(), Generate image: cellular algorithm. Bigger tileSize means bigger cells
|
||||||
|
[textures] ADDED: GenTextureCubemap(), Generate cubemap texture from HDR texture
|
||||||
|
[textures] ADDED: GenTextureIrradiance(), Generate irradiance texture using cubemap data
|
||||||
|
[textures] ADDED: GenTexturePrefilter(), Generate prefilter texture using cubemap data
|
||||||
|
[textures] ADDED: GenTextureBRDF(), Generate BRDF texture using cubemap data
|
||||||
|
[models] REMOVED: LoadMeshEx(), Mesh struct variables can be directly accessed
|
||||||
|
[models] REMOVED: UpdateMesh(), very ineficient
|
||||||
|
[models] REMOVED: LoadHeightmap(), use GenMeshHeightmap() and LoadModelFromMesh()
|
||||||
|
[models] REMOVED: LoadCubicmap(), use GenMeshCubicmap() and LoadModelFromMesh()
|
||||||
|
[models] RENAMED: LoadDefaultMaterial() to LoadMaterialDefault()
|
||||||
|
[models] ADDED: GenMeshPlane(), Generate plane mesh (with subdivisions)
|
||||||
|
[models] ADDED: GenMeshCube(), Generate cuboid mesh
|
||||||
|
[models] ADDED: GenMeshSphere(), Generate sphere mesh (standard sphere)
|
||||||
|
[models] ADDED: GenMeshHemiSphere(), Generate half-sphere mesh (no bottom cap)
|
||||||
|
[models] ADDED: GenMeshCylinder(), Generate cylinder mesh
|
||||||
|
[models] ADDED: GenMeshTorus(), Generate torus mesh
|
||||||
|
[models] ADDED: GenMeshKnot(), Generate trefoil knot mesh
|
||||||
|
[models] ADDED: GenMeshHeightmap(), Generate heightmap mesh from image data
|
||||||
|
[models] ADDED: GenMeshCubicmap(), Generate cubes-based map mesh from image data
|
||||||
|
[raymath] REVIEWED: full Matrix functionality to align with GLM in usage
|
||||||
|
[raymath] RENAMED: Vector3 functions for consistency: Vector*() renamed to Vector3*()
|
||||||
|
[build] Integrate Android APK building into examples Makefile
|
||||||
|
[build] Integrate Android APK building into templates Makefiles
|
||||||
|
[build] Improved Visual Studio 2015 project, folders, references...
|
||||||
|
[templates] Reviewed the full pack to support Android building
|
||||||
|
[examples] Reviewed full collection to adapt to raylib changes
|
||||||
|
[examples] [textures] ADDED: textures_image_generation
|
||||||
|
[examples] [models] ADDED: models_mesh_generation
|
||||||
|
[examples] [models] ADDED: models_material_pbr
|
||||||
|
[examples] [models] ADDED: models_skybox
|
||||||
|
[examples] [models] ADDED: models_yaw_pitch_roll
|
||||||
|
[examples] [others] REVIEWED: rlgl_standalone
|
||||||
|
[examples] [others] REVIEWED: audio_standalone
|
||||||
|
[github] Moved raylib webpage to own repo: github.com/raysan5/raylib.com
|
||||||
|
[games] Reviewed game: Koala Seasons
|
||||||
|
[*] Updated STB libraries to latest version
|
||||||
|
[*] Multiple bugs corrected (check github issues)
|
||||||
|
|
||||||
-----------------------------------------------
|
-----------------------------------------------
|
||||||
Release: raylib 1.7.0 (20 May 2017)
|
Release: raylib 1.7.0 (20 May 2017)
|
||||||
|
|
@ -36,14 +126,14 @@ other changes:
|
||||||
[rlgl] Removed function: CreateLight(), removed internal lighting system
|
[rlgl] Removed function: CreateLight(), removed internal lighting system
|
||||||
[rlgl] Removed function: DestroyLight(), removed internal lighting system
|
[rlgl] Removed function: DestroyLight(), removed internal lighting system
|
||||||
[rlgl] Removed function: InitVrDevice(), removed VR device render, using simulator
|
[rlgl] Removed function: InitVrDevice(), removed VR device render, using simulator
|
||||||
[rlgl] Removed function: CloseVrDevice(), removed VR device render, using simulator
|
[rlgl] Removed function: CloseVrDevice(), removed VR device render, using simulator
|
||||||
[rlgl] Removed function: IsVrDeviceReady(), removed VR device render, using simulator
|
[rlgl] Removed function: IsVrDeviceReady(), removed VR device render, using simulator
|
||||||
[rlgl] Removed function: IsVrSimulator(), removed VR device render, using simulator
|
[rlgl] Removed function: IsVrSimulator(), removed VR device render, using simulator
|
||||||
[rlgl] Added function: InitVrSimulator(), init VR simulator for selected device
|
[rlgl] Added function: InitVrSimulator(), init VR simulator for selected device
|
||||||
[rlgl] Added function: CloseVrSimulator(), close VR simulator for current device
|
[rlgl] Added function: CloseVrSimulator(), close VR simulator for current device
|
||||||
[rlgl] Added function: IsVrSimulatorReady(), detect if VR device is ready
|
[rlgl] Added function: IsVrSimulatorReady(), detect if VR device is ready
|
||||||
[rlgl] Added function: BeginVrDrawing(), begin VR simulator stereo rendering
|
[rlgl] Added function: BeginVrDrawing(), begin VR simulator stereo rendering
|
||||||
[rlgl] Added function: EndVrDrawing(), end VR simulator stereo rendering
|
[rlgl] Added function: EndVrDrawing(), end VR simulator stereo rendering
|
||||||
[rlgl] Renamed function: ReadTextFile() to LoadText() and exposed to API
|
[rlgl] Renamed function: ReadTextFile() to LoadText() and exposed to API
|
||||||
[rlgl] Removed internal lighting system and standard shader, moved to example
|
[rlgl] Removed internal lighting system and standard shader, moved to example
|
||||||
[rlgl] Removed Oculus Rift support, moved to oculus_rift example
|
[rlgl] Removed Oculus Rift support, moved to oculus_rift example
|
||||||
|
|
|
||||||
42
CMakeLists.txt
Normal file → Executable file
42
CMakeLists.txt
Normal file → Executable file
|
|
@ -1,8 +1,45 @@
|
||||||
cmake_minimum_required(VERSION 3.0)
|
cmake_minimum_required(VERSION 3.0)
|
||||||
|
|
||||||
# Config options
|
# Config options
|
||||||
set(BUILD_EXAMPLES ON CACHE BOOL "Build the examples.")
|
option(BUILD_EXAMPLES "Build the examples." ON)
|
||||||
set(BUILD_GAMES ON CACHE BOOL "Build the example games.")
|
option(BUILD_GAMES "Build the example games." ON)
|
||||||
|
option(ENABLE_ASAN "Enable AddressSanitizer (ASAN) for debugging (degrades performance)" OFF)
|
||||||
|
option(ENABLE_UBSAN "Enable UndefinedBehaviorSanitizer (UBSan) for debugging" OFF)
|
||||||
|
|
||||||
|
if(CMAKE_VERSION VERSION_LESS "3.1")
|
||||||
|
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||||
|
set(CMAKE_C_FLAGS "-std=gnu99 ${CMAKE_C_FLAGS}")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set (CMAKE_C_STANDARD 99)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(CheckCCompilerFlag)
|
||||||
|
function(add_if_flag_works 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 "works")
|
||||||
|
endif()
|
||||||
|
message(STATUS "Testing if ${flag} can be used -- ${outcome}")
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
add_if_flag_works(-Werror=pointer-arith CMAKE_C_FLAGS)
|
||||||
|
add_if_flag_works(-Werror=implicit-function-declaration CMAKE_C_FLAGS)
|
||||||
|
# src/external/jar_xm.h does shady stuff
|
||||||
|
add_if_flag_works(-fno-strict-aliasing CMAKE_C_FLAGS)
|
||||||
|
|
||||||
|
if (ENABLE_ASAN)
|
||||||
|
add_if_flag_works(-fno-omit-frame-pointer CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
|
||||||
|
add_if_flag_works(-fsanitize=address CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
|
||||||
|
endif()
|
||||||
|
if (ENABLE_UBSAN)
|
||||||
|
add_if_flag_works(-fno-omit-frame-pointer CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
|
||||||
|
add_if_flag_works(-fsanitize=undefined CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_subdirectory(src release)
|
add_subdirectory(src release)
|
||||||
|
|
||||||
|
|
@ -13,4 +50,3 @@ endif()
|
||||||
if (${BUILD_GAMES})
|
if (${BUILD_GAMES})
|
||||||
add_subdirectory(games)
|
add_subdirectory(games)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
||||||
128
CONTRIBUTING.md
Normal file
128
CONTRIBUTING.md
Normal file
|
|
@ -0,0 +1,128 @@
|
||||||
|
## Contributing to raylib
|
||||||
|
|
||||||
|
Hello contributors! Welcome to 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 LEARN videogames programming, every single function in raylib should be a 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 or is not clearly useful, better not to include it.
|
||||||
|
- raylib is open source and free; educators and institutions can use this tool to TEACH videogames programming completely by free.
|
||||||
|
- raylib is collaborative; contribution of tutorials / code-examples / bugs-solving / code-comments are highly appreciated.
|
||||||
|
- raylib's license (and its external libs respective licenses) allow using it for commercial products.
|
||||||
|
|
||||||
|
### Some interesting reads to start with
|
||||||
|
|
||||||
|
- [raylib history](HISTORY.md)
|
||||||
|
- [raylib architecture](https://github.com/raysan5/raylib/wiki/raylib-architecture)
|
||||||
|
- [raylib license](LICENSE.md)
|
||||||
|
- [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 anything.
|
||||||
|
|
||||||
|
### 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 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 the 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-request, 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.
|
||||||
|
|
||||||
|
### raylib bindings
|
||||||
|
|
||||||
|
Some people ported raylib to other languages in form of bindings or wrappers to the library, here is a list with the ones I'm aware of:
|
||||||
|
|
||||||
|
- [raylib C/C++ version (default)](https://github.com/raysan5/raylib)
|
||||||
|
- [raylib Lua binding](https://github.com/raysan5/raylib-lua)
|
||||||
|
- [raylib Go binding](https://github.com/gen2brain/raylib-go)
|
||||||
|
- [raylib Nim binding](https://gitlab.com/define-private-public/raylib-Nim)
|
||||||
|
- [raylib Crystal binding](https://gitlab.com/Zatherz/cray)
|
||||||
|
- [raylib Perl wrapper](https://metacpan.org/pod/Graphics::Raylib)
|
||||||
|
- raylib Pascal binding with custom IDE (closed-source)
|
||||||
|
|
||||||
|
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 and I usually
|
||||||
|
provide the icon/logo for that new language binding.
|
||||||
|
|
||||||
|
### 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 forum](http://forum.raylib.com/) - A good place for discussions or to ask for help.
|
||||||
|
- [raylib gitter](https://gitter.im/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 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! :)
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
Here is a list of raylib contributors, these people have invested part of their time
|
||||||
|
contributing (in some way or another) to make the raylib project better. Huge thanks to all of them!
|
||||||
|
|
||||||
|
- [Zopokx](https://github.com/Zopokx) for testing the web.
|
||||||
|
- [Elendow](http://www.elendow.com) for testing and helping on web development.
|
||||||
|
- Victor Dual for implementing and testing 3D shapes functions.
|
||||||
|
- Marc Palau for implementing and testing 3D shapes functions and contribute on camera and gestures modules.
|
||||||
|
- Kevin Gato for improving texture internal formats support and helping on raygui development.
|
||||||
|
- Daniel Nicolas for improving texture internal formats support and helping on raygui development.
|
||||||
|
- Marc Agüera for testing and using raylib on a real product ([Koala Seasons](http://www.koalaseasons.com))
|
||||||
|
- Daniel Moreno for testing and using raylib on a real product ([Koala Seasons](http://www.koalaseasons.com))
|
||||||
|
- Daniel Gomez for testing and using raylib on a real product ([Koala Seasons](http://www.koalaseasons.com))
|
||||||
|
- [Sergio Martinez](https://github.com/anidealgift) for helping on raygui development and tools development (raygui_styler).
|
||||||
|
- [Victor Fisac](https://github.com/victorfisac) for developing physics raylib module (physac) and implementing PBR materials and lighting systems... among multiple other improvements and multiple tools and games.
|
||||||
|
- Albert Martos for helping on raygui and porting examples and game-templates to Android and HTML5.
|
||||||
|
- Ian Eito for helping on raygui and porting examples and game-templates to Android and HTML5.
|
||||||
|
- [procedural](https://github.com/procedural) for testing raylib on Linux, correcting some bugs and adding several mouse functions.
|
||||||
|
- [Chris Hemingway](https://github.com/cHemingway) for improving raylib on OSX build system.
|
||||||
|
- [Emanuele Petriglia](https://github.com/LelixSuper) for working on multiple GNU/Linux improvements and developing [TicTacToe](https://github.com/LelixSuper/TicTacToe) raylib game.
|
||||||
|
- [Joshua Reisenauer](https://github.com/kd7tck) for adding audio modules support (XM, MOD) and reviewing audio system.
|
||||||
|
- [Marcelo Paez](https://github.com/paezao) for his help on OSX to solve High DPI display issue. Thanks Marcelo!
|
||||||
|
- [Ghassan Al-Mashareqa](https://github.com/ghassanpl) for his amazing contribution with raylib Lua module, I just work over his code to implement [rlua](https://github.com/raysan5/raylib/blob/master/src/rlua.h)
|
||||||
|
- [Teodor Stoenescu](https://github.com/teodor-stoenescu) for his improvements on OBJ object loading.
|
||||||
|
- [RDR8](https://github.com/RDR8) for helping with Linux build improvements
|
||||||
|
- [Saggi Mizrahi](https://github.com/ficoos) for multiple fixes on Linux and audio system
|
||||||
|
- [Daniel Lemos](https://github.com/xspager) for fixing issues on Linux games building
|
||||||
|
- [Joel Davis](https://github.com/joeld42) for adding raycast picking utilities and a [great example](https://github.com/raysan5/raylib/blob/master/examples/models/models_mesh_picking.c)
|
||||||
|
- [Richard Goodwin](https://github.com/AudioMorphology) for adding RPI touchscreen support
|
||||||
|
- [Milan Nikolic](https://github.com/gen2brain) for adding Android build support with custom standalone toolchain
|
||||||
|
- [Michael Vetter](https://github.com/jubalh) for improvements on build system and adding meson support for Linux
|
||||||
|
- [Wilhem Barbier](https://github.com/nounoursheureux) for adding Image generation functions and some fixes
|
||||||
|
- [Benjamin Summerton](https://github.com/define-private-public) for improving OSX building and his amazing work on CMake build sytem
|
||||||
|
- [MartinFX](https://github.com/Martinfx) for adding compilation support for FreeBSD OS
|
||||||
|
- [Wilhem Barbier](https://github.com/nounoursheureux) for supporting default shaders on shader loading, if shader not provided
|
||||||
|
- [Ahmad Fatoum](https://github.com/a3f) for implementing continuus integration support for raylib (Travis and AppVeyor) and greatly improving build system.
|
||||||
|
- [SamNChiet](https://github.com/SamNChiet) for his work on UWP inputs implementation.
|
||||||
|
- [David Reid](https://github.com/mackron) for a complete review of audio module to support his amazing mini_al audio library.
|
||||||
|
- [Kai](https://github.com/questor) for multiple code reviews and improvements.
|
||||||
|
|
||||||
|
Please, if I forget someone in this list, excuse me and write me an email to remind me to add you!
|
||||||
|
|
@ -8,12 +8,12 @@ The following help is highly appreciated:
|
||||||
|
|
||||||
- C programming - Can you write / review / test / improve the code?
|
- C programming - Can you write / review / test / improve the code?
|
||||||
- Documentation / Tutorials / Example writters - Can you write some tutorial / example?
|
- Documentation / Tutorials / Example writters - Can you write some tutorial / example?
|
||||||
- Web Development - Can you help with the web? Can you setup a forum?
|
- Web Development - Can you help with the web? SEO, style, code writting: https://github.com/raysan5/raylib.com
|
||||||
- Porting to Linux, OSX, RaspberryPi, consoles... - Can you compile and test raylib on another systems?
|
- Porting to Linux, OSX, RaspberryPi, consoles... - Can you compile and test raylib on another systems?
|
||||||
- Testers of current features and multiple systems - Can you find some bug on raylib?
|
- Testers of current features and multiple systems - Can you find some bug on raylib?
|
||||||
|
|
||||||
If you can not help on any of the above points but you still want to contribute in some way... please, consider helping
|
If you can not help on any of the above points but you still want to contribute in some way... please, consider helping
|
||||||
with a small [donation](http://www.raylib.com/helpme.html) or contributing with [raylib patreon](https://www.patreon.com/raysan5). It will really motivate to continue improving this project (and pay some bills… or some coffee).
|
with a small [donation](http://www.raylib.com/helpme.html) or contributing with [raylib patreon](https://www.patreon.com/raysan5). It will really motivate to continue improving this project...
|
||||||
|
|
||||||
raylib philosophy
|
raylib philosophy
|
||||||
------------------
|
------------------
|
||||||
|
|
|
||||||
20
HISTORY.md
20
HISTORY.md
|
|
@ -182,3 +182,23 @@ Some other features: Gamepad support on HTML5, RPI touch screen support, 32bit a
|
||||||
|
|
||||||
And here it is another version of **raylib, a simple and easy-to-use library to learn videogames programming**. Enjoy it.
|
And here it is another version of **raylib, a simple and easy-to-use library to learn 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/develop/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/develop/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/develop/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/develop/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/develop/src/rlgl.c) 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/develop/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/develop/src/rlgl.c) 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.
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ applications, and to alter it and redistribute it freely, subject to the followi
|
||||||
fonts
|
fonts
|
||||||
------
|
------
|
||||||
|
|
||||||
The following fonts [provided with raylib](https://github.com/raysan5/raylib/tree/develop/examples/text/resources/fonts) are free to use (freeware) and have been designed by the following people:
|
The following fonts [provided with raylib](https://github.com/raysan5/raylib/tree/master/examples/text/resources/fonts) are free to use (freeware) and have been designed by the following people:
|
||||||
|
|
||||||
* Alpha Beta - Brian Kent (AEnigma)
|
* Alpha Beta - Brian Kent (AEnigma)
|
||||||
* Setback - Brian Kent (AEnigma)
|
* Setback - Brian Kent (AEnigma)
|
||||||
|
|
@ -41,9 +41,9 @@ The following fonts [provided with raylib](https://github.com/raysan5/raylib/tre
|
||||||
2d art
|
2d art
|
||||||
------
|
------
|
||||||
|
|
||||||
[scarfy spritesheet](https://github.com/raysan5/raylib/blob/develop/examples/textures/resources/scarfy.png) and [fudesumi image](https://github.com/raysan5/raylib/blob/develop/examples/textures/resources/fudesumi.png) have been created by [Eiden Marsal](https://www.artstation.com/artist/marshall_z) and licensed as [Creative Commons Attribution-NonCommercial 3.0](https://creativecommons.org/licenses/by-nc/3.0/legalcode)
|
[scarfy spritesheet](https://github.com/raysan5/raylib/blob/master/examples/textures/resources/scarfy.png) and [fudesumi image](https://github.com/raysan5/raylib/blob/master/examples/textures/resources/fudesumi.png) have been created by [Eiden Marsal](https://www.artstation.com/artist/marshall_z) and licensed as [Creative Commons Attribution-NonCommercial 3.0](https://creativecommons.org/licenses/by-nc/3.0/legalcode)
|
||||||
|
|
||||||
3d models
|
3d models
|
||||||
---------
|
---------
|
||||||
|
|
||||||
[dwarf 3d model and textures](https://github.com/raysan5/raylib/tree/develop/examples/models/resources/model) have been created by David Moreno and licensed as [Creative Commons Attribution-NonCommercial 3.0](https://creativecommons.org/licenses/by-nc/3.0/legalcode)
|
[dwarf 3d model and textures](https://github.com/raysan5/raylib/tree/master/examples/models/resources/model) have been created by David Moreno and licensed as [Creative Commons Attribution-NonCommercial 3.0](https://creativecommons.org/licenses/by-nc/3.0/legalcode)
|
||||||
|
|
|
||||||
76
README.md
76
README.md
|
|
@ -1,4 +1,4 @@
|
||||||
<img align="left" src="https://github.com/raysan5/raylib/blob/master/logo/logo256x256.png" width=256>
|
<img align="left" src="https://github.com/raysan5/raylib/blob/master/logo/raylib_256x256.png" width=256>
|
||||||
|
|
||||||
**raylib is a simple and easy-to-use library to learn videogames programming.**
|
**raylib is a simple and easy-to-use library to learn videogames programming.**
|
||||||
|
|
||||||
|
|
@ -10,38 +10,46 @@ NOTE for ADVENTURERS: raylib is a programming library to learn videogames progra
|
||||||
no fancy interface, no visual helpers, no auto-debugging... just coding in the most
|
no fancy interface, no visual helpers, no auto-debugging... just coding in the most
|
||||||
pure spartan-programmers way. Are you ready to learn? Jump to [code examples!](http://www.raylib.com/examples.html)
|
pure spartan-programmers way. Are you ready to learn? Jump to [code examples!](http://www.raylib.com/examples.html)
|
||||||
|
|
||||||
|
[](https://travis-ci.org/raysan5/raylib)
|
||||||
|
[](https://ci.appveyor.com/project/raysan5/raylib)
|
||||||
|
[](https://gitter.im/raylib/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
||||||
|
[](LICENSE.md)
|
||||||
|
[](https://twitter.com/raysan5)
|
||||||
|
|
||||||
features
|
features
|
||||||
--------
|
--------
|
||||||
|
|
||||||
* Written in plain C code (C99) in PascalCase/camelCase notation
|
* Written in plain C code (C99) in PascalCase/camelCase notation
|
||||||
* Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES2)
|
* Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES2 - choose at compile)
|
||||||
* Unique OpenGL abstraction layer (usable as standalone module): [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.c)
|
* Unique OpenGL abstraction layer (usable as standalone module): [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.c)
|
||||||
* Powerful fonts module with SpriteFonts support (XNA bitmap fonts, AngelCode fonts, TTF)
|
* Powerful fonts module with SpriteFonts support (XNA fonts, AngelCode fonts, TTF)
|
||||||
* Outstanding texture formats support, including compressed formats (DXT, ETC, PVRT, ASTC)
|
* Outstanding texture formats support, including compressed formats (DXT, ETC, ASTC)
|
||||||
* Basic 3d support for Geometrics, Models, Billboards, Heightmaps and Cubicmaps
|
* Full 3d support for 3d Shapes, Models, Billboards, Heightmaps and more!
|
||||||
* Flexible Materials system, supporting classic maps and PBR maps
|
* Flexible Materials system, supporting classic maps and PBR maps
|
||||||
* Shaders support, including Model shaders and Postprocessing shaders
|
* Shaders support, including Model shaders and Postprocessing shaders
|
||||||
* Powerful math module for Vector, Matrix and Quaternion operations: [raymath](https://github.com/raysan5/raylib/blob/master/src/raymath.h)
|
* 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, FLAC, XM, MOD)
|
* Audio loading and playing with streaming support (WAV, OGG, FLAC, XM, MOD)
|
||||||
* Multiple platforms support: Windows, Linux, Mac, **Android**, **Raspberry Pi** and **HTML5**
|
* Multiple platforms support: Windows, Linux, FreeBSD, MacOS, UWP, Android, Raspberry Pi, HTML5.
|
||||||
* VR stereo rendering support with configurable HMD device parameters
|
* VR stereo rendering with configurable HMD device parameters
|
||||||
* Minimal external dependencies (GLFW3, OpenGL, OpenAL)
|
* NO external dependencies, all required libraries included with raylib
|
||||||
* Complete bindings to LUA ([raylib-lua](https://github.com/raysan5/raylib-lua)) and Go ([raylib-go](https://github.com/gen2brain/raylib-go))
|
* Complete bindings to LUA ([raylib-lua](https://github.com/raysan5/raylib-lua)) and Go ([raylib-go](https://github.com/gen2brain/raylib-go))
|
||||||
|
|
||||||
raylib uses on its core module the outstanding [GLFW3](http://www.glfw.org/) library. The best option I found for
|
raylib uses on its [core](https://github.com/raysan5/raylib/blob/master/src/core.c) module the outstanding [GLFW3](http://www.glfw.org/) library, embedded inside raylib in the form of [rglfw](https://github.com/raysan5/raylib/blob/master/src/rglfw.c) module, avoiding that way external dependencies.
|
||||||
multiplatform (Windows, Linux, Mac) window/context and input management (clean, focused, great license, well documented, modern, maintained, ...).
|
|
||||||
|
|
||||||
raylib uses on its [audio](https://github.com/raysan5/raylib/blob/master/src/audio.c) module, [OpenAL Soft](http://kcat.strangesoft.net/openal.html) audio library, in multiple flavours,
|
raylib uses on its [audio](https://github.com/raysan5/raylib/blob/master/src/audio.c) module, the amazing [mini_al](https://github.com/dr-soft/mini_al) audio library, single-file header-only and supporting multiple platforms and multiple audio backends.
|
||||||
to accomodate to Android, Raspberry Pi and HTML5.
|
|
||||||
|
raylib uses internally multiple single-file header-only libraries to support multiple fileformats loading and saving, all those libraries are embedded with raylib and available in [src/external](https://github.com/raysan5/raylib/tree/master/src/external) directory.
|
||||||
|
|
||||||
*On Android, `native_app_glue module` (provided by Android NDK) and native Android libraries are used to manage window/context, inputs and activity life cycle.*
|
*On Android, `native_app_glue module` (provided by Android NDK) and native Android libraries are used to manage window/context, inputs and activity life cycle.*
|
||||||
|
|
||||||
*On Raspberry Pi, Videocore API and EGL libraries are used for window/context management and raw inputs reading.*
|
*On Raspberry Pi, Videocore API and EGL libraries are used for window/context management and raw inputs reading.*
|
||||||
|
|
||||||
building
|
build and installation
|
||||||
--------
|
----------------------
|
||||||
|
|
||||||
For detailed building instructions, check [raylib Wiki](https://github.com/raysan5/raylib/wiki).
|
Binary releases for Windows, Linux and macOS are available at the [Github Releases](https://github.com/raysan5/raylib/releases) page. raylib is also available via multiple package managers on multiple OS distributions. For more info check [raylib Wiki](https://github.com/raysan5/raylib/wiki).
|
||||||
|
|
||||||
|
To build raylib yourself, check out also the [raylib Wiki](https://github.com/raysan5/raylib/wiki) for detailed instructions.
|
||||||
|
|
||||||
raylib has been developed using exclusively two tools:
|
raylib has been developed using exclusively two tools:
|
||||||
|
|
||||||
|
|
@ -59,46 +67,12 @@ contact
|
||||||
* Reddit: [https://www.reddit.com/r/raylib](https://www.reddit.com/r/raylib)
|
* Reddit: [https://www.reddit.com/r/raylib](https://www.reddit.com/r/raylib)
|
||||||
* Twitch: [http://www.twitch.tv/raysan5](http://www.twitch.tv/raysan5)
|
* Twitch: [http://www.twitch.tv/raysan5](http://www.twitch.tv/raysan5)
|
||||||
* Patreon: [https://www.patreon.com/raysan5](https://www.patreon.com/raysan5)
|
* Patreon: [https://www.patreon.com/raysan5](https://www.patreon.com/raysan5)
|
||||||
|
* YouTube: [https://www.youtube.com/channel/raylib](https://www.youtube.com/channel/UC8WIBkhYb5sBNqXO1mZ7WSQ)
|
||||||
|
|
||||||
If you are using raylib and you enjoy it, please, [let me know][raysan5].
|
If you are using raylib and you enjoy it, please, [let me know][raysan5].
|
||||||
|
|
||||||
If you feel you can help, then, [helpme!](http://www.raylib.com/helpme.html)
|
If you feel you can help, then, [helpme!](http://www.raylib.com/helpme.html)
|
||||||
|
|
||||||
acknowledgements
|
|
||||||
---------------
|
|
||||||
|
|
||||||
I believe that time is the most valuable resource and the following people have invested part of their time
|
|
||||||
contributing (in some way or another) to make raylib project better. Huge thanks!
|
|
||||||
|
|
||||||
- [Zopokx](https://github.com/Zopokx) for testing the web.
|
|
||||||
- [Elendow](http://www.elendow.com) for testing and helping on web development.
|
|
||||||
- Victor Dual for implementing and testing 3D shapes functions.
|
|
||||||
- Marc Palau for implementing and testing 3D shapes functions and contribute on camera and gestures modules.
|
|
||||||
- Kevin Gato for improving texture internal formats support and helping on raygui development.
|
|
||||||
- Daniel Nicolas for improving texture internal formats support and helping on raygui development.
|
|
||||||
- Marc Agüera for testing and using raylib on a real product ([Koala Seasons](http://www.koalaseasons.com))
|
|
||||||
- Daniel Moreno for testing and using raylib on a real product ([Koala Seasons](http://www.koalaseasons.com))
|
|
||||||
- Daniel Gomez for testing and using raylib on a real product ([Koala Seasons](http://www.koalaseasons.com))
|
|
||||||
- [Sergio Martinez](https://github.com/anidealgift) for helping on raygui development and tools development (raygui_styler).
|
|
||||||
- [Victor Fisac](https://github.com/victorfisac) for developing physics raylib module (physac) and implementing materials and lighting systems... among multiple other improvements and multiple tools and games.
|
|
||||||
- Albert Martos for helping on raygui and porting examples and game-templates to Android and HTML5.
|
|
||||||
- Ian Eito for helping on raygui and porting examples and game-templates to Android and HTML5.
|
|
||||||
- [procedural](https://github.com/procedural) for testing raylib on Linux, correcting some bugs and adding several mouse functions.
|
|
||||||
- [Chris Hemingway](https://github.com/cHemingway) for improving raylib on OSX build system.
|
|
||||||
- [Emanuele Petriglia](https://github.com/LelixSuper) for working on multiple GNU/Linux improvements and developing [TicTacToe](https://github.com/LelixSuper/TicTacToe) raylib game.
|
|
||||||
- [Joshua Reisenauer](https://github.com/kd7tck) for adding audio modules support (XM, MOD) and reviewing audio system.
|
|
||||||
- [Marcelo Paez](https://github.com/paezao) for his help on OSX to solve High DPI display issue. Thanks Marcelo!
|
|
||||||
- [Ghassan Al-Mashareqa](https://github.com/ghassanpl) for his amazing contribution with raylib Lua module, I just work over his code to implement [rlua](https://github.com/raysan5/raylib/blob/master/src/rlua.h)
|
|
||||||
- [Teodor Stoenescu](https://github.com/teodor-stoenescu) for his improvements on OBJ object loading.
|
|
||||||
- [RDR8](https://github.com/RDR8) for helping with Linux build improvements
|
|
||||||
- [Saggi Mizrahi](https://github.com/ficoos) for multiple fixes on Linux and audio system
|
|
||||||
- [Daniel Lemos](https://github.com/xspager) for fixing issues on Linux games building
|
|
||||||
- [Joel Davis](https://github.com/joeld42) for adding raycast picking utilities and a [great example](https://github.com/raysan5/raylib/blob/master/examples/models/models_mesh_picking.c)
|
|
||||||
- [Richard Goodwin](https://github.com/AudioMorphology) for adding RPI touchscreen support
|
|
||||||
- [Milan Nikolic](https://github.com/gen2brain) for adding Android build support with custom standalone toolchain
|
|
||||||
|
|
||||||
Please, if I forget someone in this list, excuse me and write me an email to remind me to add you!
|
|
||||||
|
|
||||||
license
|
license
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
|
|
||||||
12
ROADMAP.md
12
ROADMAP.md
|
|
@ -4,15 +4,19 @@ roadmap
|
||||||
Current version of raylib is complete and functional but there is still a lot of room for improvement.
|
Current version of raylib is complete and functional but there is still a lot of room for improvement.
|
||||||
Here it is a wish-list with features and ideas to improve the library.
|
Here it is a wish-list with features and ideas to improve the library.
|
||||||
|
|
||||||
Note that [raylib source code](https://github.com/raysan5/raylib/tree/develop/src) has some *TODO* marks around code with pending things to review and improve. Check [GitHub Issues](https://github.com/raysan5/raylib/issues) for further details!
|
Note that [raylib source code](https://github.com/raysan5/raylib/tree/master/src) has some *TODO* marks around code with pending things to review and improve. Check [GitHub Issues](https://github.com/raysan5/raylib/issues) for further details!
|
||||||
|
|
||||||
**raylib 1.x**
|
**raylib 1.x**
|
||||||
- [ ] Improved Materials system with PBR support
|
|
||||||
- [ ] Basic GPU stats sytem (memory, draws, time...)
|
- [ ] Basic GPU stats sytem (memory, draws, time...)
|
||||||
- [ ] Improved custom file-format (.rres) and packaging tool
|
- [ ] Improved custom file-format (.rres) and packaging tool
|
||||||
- [ ] Procedural image generation functions (spot, gradient, noise...)
|
|
||||||
- [ ] Procedural mesh generation functions (cube, cone, sphere...)
|
|
||||||
- [ ] Touch-based camera controls for Android
|
- [ ] Touch-based camera controls for Android
|
||||||
|
- [ ] Quaternions-based camera system
|
||||||
|
|
||||||
|
**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**
|
**raylib 1.7**
|
||||||
- [x] Support configuration flags
|
- [x] Support configuration flags
|
||||||
|
|
|
||||||
65
appveyor.yml
Normal file
65
appveyor.yml
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
#os: Visual Studio 2015
|
||||||
|
|
||||||
|
clone_depth: 5
|
||||||
|
|
||||||
|
cache:
|
||||||
|
- C:\ProgramData\chocolatey\bin -> appveyor.yml
|
||||||
|
- C:\ProgramData\chocolatey\lib -> appveyor.yml
|
||||||
|
|
||||||
|
init:
|
||||||
|
- cmake -E remove c:\programdata\chocolatey\bin\cpack.exe
|
||||||
|
- set PATH=%PATH:C:\Program Files (x86)\Git\usr\bin;=%
|
||||||
|
- set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
|
||||||
|
- if [%BITS%]==[32] set MINGW=C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32
|
||||||
|
- if [%BITS%]==[64] set MINGW=C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64
|
||||||
|
- if [%COMPILER%]==[mingw] set PATH=%MINGW%\bin;%PATH%
|
||||||
|
- set RAYLIB_PACKAGE_SUFFIX=-Win%BITS%-%COMPILER%
|
||||||
|
- set VERBOSE=1
|
||||||
|
|
||||||
|
environment:
|
||||||
|
matrix:
|
||||||
|
- compiler: mingw
|
||||||
|
bits: 32
|
||||||
|
examples: ON
|
||||||
|
- compiler: mingw
|
||||||
|
bits: 64
|
||||||
|
examples: ON
|
||||||
|
- compiler: msvc15
|
||||||
|
bits: 32
|
||||||
|
examples: OFF
|
||||||
|
- compiler: msvc15
|
||||||
|
bits: 64
|
||||||
|
examples: OFF
|
||||||
|
|
||||||
|
before_build:
|
||||||
|
- if [%compiler%]==[mingw] set CFLAGS=-m%BITS% & set LDFLAGS=-m%BITS% & set GENERATOR="MinGW Makefiles"
|
||||||
|
- if [%COMPILER%]==[msvc15] if [%BITS%]==[32] set GENERATOR="Visual Studio 14 2015"
|
||||||
|
- if [%COMPILER%]==[msvc15] if [%BITS%]==[64] set GENERATOR="Visual Studio 14 2015 Win64"
|
||||||
|
- mkdir build
|
||||||
|
- cd build
|
||||||
|
|
||||||
|
build_script:
|
||||||
|
- cmake -G %GENERATOR% -DSTATIC=ON -DSHARED=ON -DBUILD_EXAMPLES=%examples% -DBUILD_GAMES=%examples% ..
|
||||||
|
- cmake --build . --target install
|
||||||
|
|
||||||
|
after_build:
|
||||||
|
- cmake --build . --target package
|
||||||
|
|
||||||
|
before_test:
|
||||||
|
|
||||||
|
test_script:
|
||||||
|
|
||||||
|
artifacts:
|
||||||
|
- path: 'build\*.zip'
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
- provider: GitHub
|
||||||
|
auth_token:
|
||||||
|
secure: OxKnnT3tlkPl9365cOO84rDWU4UkHIYJc0D3r3Tv7rB3HaR2BBhlhCnl7g3nuOJy
|
||||||
|
artifact: /.*\.zip/
|
||||||
|
draft: false
|
||||||
|
prerelease: false
|
||||||
|
force_update: true
|
||||||
|
on:
|
||||||
|
branch: master
|
||||||
|
appveyor_repo_tag: true # deploy on tag push only
|
||||||
|
|
@ -7,9 +7,20 @@ include("../utils.cmake")
|
||||||
# TODO `build` directory should maybe be something else...
|
# TODO `build` directory should maybe be something else...
|
||||||
# TODO place somewhere else?
|
# TODO place somewhere else?
|
||||||
include_directories("../build/release")
|
include_directories("../build/release")
|
||||||
|
include_directories("../src/external")
|
||||||
|
include_directories("../src/external/glfw/include")
|
||||||
|
|
||||||
# Get the sources together
|
# Get the sources together
|
||||||
set(example_dirs audio core models others physac shaders text texutures)
|
set(example_dirs audio core models others shaders shapes text textures)
|
||||||
|
set(CMAKE_REQUIRED_DEFINITIONS -D_POSIX_C_SOURCE=199309L)
|
||||||
|
include(CheckSymbolExists)
|
||||||
|
check_symbol_exists(CLOCK_MONOTONIC time.h HAVE_CLOCK_MONOTONIC)
|
||||||
|
check_symbol_exists(QueryPerformanceCounter windows.h HAVE_QPC)
|
||||||
|
set(CMAKE_REQUIRED_DEFINITIONS)
|
||||||
|
if(HAVE_QPC OR HAVE_CLOCK_MONOTONIC)
|
||||||
|
set(example_dirs ${example_dirs} physac)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(example_sources)
|
set(example_sources)
|
||||||
set(example_resources)
|
set(example_resources)
|
||||||
foreach(example_dir ${example_dirs})
|
foreach(example_dir ${example_dirs})
|
||||||
|
|
@ -22,6 +33,14 @@ foreach(example_dir ${example_dirs})
|
||||||
list(APPEND example_resources ${resources})
|
list(APPEND example_resources ${resources})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
include(CheckIncludeFiles)
|
||||||
|
check_include_files(OVR_CAPI_GL.h HAVE_OCULUS_CAPI)
|
||||||
|
if(NOT HAVE_OCULUS_CAPI)
|
||||||
|
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/oculus_rift.c)
|
||||||
|
endif()
|
||||||
|
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/others/standard_lighting.c)
|
||||||
|
|
||||||
|
|
||||||
# Do each example
|
# Do each example
|
||||||
foreach(example_source ${example_sources})
|
foreach(example_source ${example_sources})
|
||||||
# Create the basename for the example
|
# Create the basename for the example
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
#**************************************************************************************************
|
#**************************************************************************************************
|
||||||
#
|
#
|
||||||
# raylib makefile for desktop platforms, Raspberry Pi and HTML5 (emscripten)
|
# raylib makefile for Desktop platforms, Raspberry Pi, Android and HTML5
|
||||||
#
|
#
|
||||||
# NOTE: By default examples are compiled using raylib static library and OpenAL Soft shared library
|
# Copyright (c) 2013-2018 Ramon Santamaria (@raysan5)
|
||||||
#
|
|
||||||
# Copyright (c) 2013-2017 Ramon Santamaria (@raysan5)
|
|
||||||
#
|
#
|
||||||
# This software is provided "as-is", without any express or implied warranty. In no event
|
# 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.
|
# will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|
@ -25,217 +23,322 @@
|
||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: all clean
|
||||||
|
|
||||||
# define raylib platform to compile for
|
# Define required raylib variables
|
||||||
# possible platforms: PLATFORM_DESKTOP PLATFORM_RPI PLATFORM_WEB
|
PROJECT_NAME ?= raylib_examples
|
||||||
# WARNING: To compile to HTML5, code must be redesigned to use emscripten.h and emscripten_set_main_loop()
|
RAYLIB_VERSION ?= 1.9.4
|
||||||
PLATFORM ?= PLATFORM_DESKTOP
|
RAYLIB_API_VERSION ?= 1
|
||||||
|
RAYLIB_PATH ?= ..
|
||||||
|
|
||||||
# determine PLATFORM_OS in case PLATFORM_DESKTOP selected
|
# 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
|
||||||
|
RAYLIB_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
|
||||||
|
|
||||||
|
# NOTE: On PLATFORM_WEB OpenAL Soft backend is used by default (check raylib/src/Makefile)
|
||||||
|
|
||||||
|
# Determine PLATFORM_OS in case PLATFORM_DESKTOP selected
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
# No uname.exe on MinGW!, but OS=Windows_NT on Windows! ifeq ($(UNAME),Msys) -> Windows
|
# No uname.exe on MinGW!, but OS=Windows_NT on Windows!
|
||||||
|
# ifeq ($(UNAME),Msys) -> Windows
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(OS),Windows_NT)
|
||||||
PLATFORM_OS=WINDOWS
|
PLATFORM_OS=WINDOWS
|
||||||
LIBPATH=win32
|
|
||||||
else
|
else
|
||||||
UNAMEOS:=$(shell uname)
|
UNAMEOS=$(shell uname)
|
||||||
ifeq ($(UNAMEOS),Linux)
|
ifeq ($(UNAMEOS),Linux)
|
||||||
PLATFORM_OS=LINUX
|
PLATFORM_OS=LINUX
|
||||||
LIBPATH=linux
|
endif
|
||||||
else
|
ifeq ($(UNAMEOS),FreeBSD)
|
||||||
|
PLATFORM_OS=FREEBSD
|
||||||
|
endif
|
||||||
ifeq ($(UNAMEOS),Darwin)
|
ifeq ($(UNAMEOS),Darwin)
|
||||||
PLATFORM_OS=OSX
|
PLATFORM_OS=OSX
|
||||||
LIBPATH=osx
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
|
UNAMEOS=$(shell uname)
|
||||||
|
ifeq ($(UNAMEOS),Linux)
|
||||||
|
PLATFORM_OS=LINUX
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
# define default raylib path for include and library search
|
# 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_VERSION = 1.37.28
|
||||||
|
CLANG_VERSION=e1.37.28_64bit
|
||||||
|
PYTHON_VERSION=2.7.5.3_64bit
|
||||||
|
NODE_VERSION=4.1.1_64bit
|
||||||
|
export PATH=$(EMSDK_PATH);$(EMSDK_PATH)\clang\$(CLANG_VERSION);$(EMSDK_PATH)\node\$(NODE_VERSION)\bin;$(EMSDK_PATH)\python\$(PYTHON_VERSION);$(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION);C:\raylib\MinGW\bin:$$(PATH)
|
||||||
|
EMSCRIPTEN=$(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION)
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Define raylib release directory for compiled library.
|
||||||
|
# RAYLIB_RELEASE_PATH points to provided binaries or your freshly built version.
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||||
RAYLIB_PATH ?= C:\raylib\raylib
|
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/win32/mingw32
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
RAYLIB_PATH ?= ..
|
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/linux
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),OSX)
|
ifeq ($(PLATFORM_OS),OSX)
|
||||||
RAYLIB_PATH ?= ..
|
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx
|
||||||
|
endif
|
||||||
|
ifeq ($(PLATFORM_OS),FREEBSD)
|
||||||
|
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/freebsd
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
|
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/rpi
|
||||||
|
endif
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
|
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/html5
|
||||||
|
endif
|
||||||
|
|
||||||
|
# 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),FREEBSD)
|
||||||
|
# FreeBSD 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)
|
||||||
|
# WARNING: To compile to HTML5, code must be redesigned to use emscripten.h and emscripten_set_main_loop()
|
||||||
|
# HTML5 emscripten compiler
|
||||||
|
CC = emcc
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Define default make program: Mingw32-make
|
||||||
|
MAKE = mingw32-make
|
||||||
|
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
|
MAKE = make
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
# Define compiler flags:
|
||||||
RAYLIB_PATH ?= /home/pi/raylib
|
# -O1 defines optimization level
|
||||||
endif
|
# -g enable debugging
|
||||||
|
|
||||||
# define NO to use OpenAL Soft as static library (shared by default)
|
|
||||||
SHARED_OPENAL ?= NO
|
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
|
||||||
SHARED_OPENAL = NO
|
|
||||||
endif
|
|
||||||
|
|
||||||
# define compiler: gcc for C program, define as g++ for C++
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
|
||||||
# define emscripten compiler
|
|
||||||
CC = emcc
|
|
||||||
else
|
|
||||||
ifeq ($(PLATFORM_OS),OSX)
|
|
||||||
# define llvm compiler for mac
|
|
||||||
CC = clang
|
|
||||||
else
|
|
||||||
# define default gcc compiler
|
|
||||||
CC = gcc
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
# define compiler flags:
|
|
||||||
# -O2 defines optimization level
|
|
||||||
# -Og enable debugging
|
|
||||||
# -s strip unnecessary data from build
|
# -s strip unnecessary data from build
|
||||||
# -Wall turns on most, but not all, compiler warnings
|
# -Wall turns on most, but not all, compiler warnings
|
||||||
# -std=c99 defines C language mode (standard C from 1999 revision)
|
# -std=c99 defines C language mode (standard C from 1999 revision)
|
||||||
# -std=gnu99 defines C language mode (GNU C from 1999 revision)
|
# -std=gnu99 defines C language mode (GNU C from 1999 revision)
|
||||||
# -fgnu89-inline declaring inline functions support (GCC optimized)
|
|
||||||
# -Wno-missing-braces ignore invalid warning (GCC bug 53119)
|
# -Wno-missing-braces ignore invalid warning (GCC bug 53119)
|
||||||
# -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec
|
# -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
|
||||||
|
|
||||||
|
# Additional flags for compiler (if desired)
|
||||||
|
#CFLAGS += -Wextra -Wmissing-prototypes -Wstrict-prototypes
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||||
CFLAGS = -O2 -s -Wall -std=c99
|
# resources file contains windows exe icon
|
||||||
|
# -Wl,--subsystem,windows hides the console window
|
||||||
|
CFLAGS += $(RAYLIB_PATH)/src/resources -Wl,--subsystem,windows
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
CFLAGS = -O2 -s -Wall -std=c99 -no-pie -D_DEFAULT_SOURCE
|
ifeq ($(RAYLIB_BUILD_MODE),DEBUG)
|
||||||
endif
|
CFLAGS += -g
|
||||||
ifeq ($(PLATFORM_OS),OSX)
|
#CC = clang
|
||||||
CFLAGS = -O2 -s -Wall -std=c99
|
endif
|
||||||
|
ifeq ($(RAYLIB_LIBTYPE),STATIC)
|
||||||
|
CFLAGS += -no-pie -D_DEFAULT_SOURCE
|
||||||
|
endif
|
||||||
|
ifeq ($(RAYLIB_LIBTYPE),SHARED)
|
||||||
|
# Explicitly enable runtime link to libraylib.so
|
||||||
|
CFLAGS += -Wl,-rpath,$(EXAMPLE_RUNTIME_PATH)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
|
CFLAGS += -std=gnu99
|
||||||
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
CFLAGS = -O1 -Wall -std=c99 -D_DEFAULT_SOURCE -s USE_GLFW=3 -s ASSERTIONS=1 --profiling
|
# -O2 # if used, also set --memory-init-file 0
|
||||||
# -O2 # if used, also set --memory-init-file 0
|
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
|
||||||
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
|
# -s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing
|
||||||
# -s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing
|
# -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB)
|
||||||
# -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB)
|
# -s USE_PTHREADS=1 # multithreading support
|
||||||
# --preload-file file.res # embbed file.res resource into .data file
|
# -s WASM=1 # support Web Assembly (https://github.com/kripken/emscripten/wiki/WebAssembly)
|
||||||
endif
|
# --preload-file resources # specify a resources folder for data compilation
|
||||||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
CFLAGS += -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 --profiling --preload-file resources
|
||||||
CFLAGS = -O2 -s -Wall -std=gnu99 -fgnu89-inline
|
|
||||||
endif
|
|
||||||
#CFLAGSEXTRA = -Wextra -Wmissing-prototypes -Wstrict-prototypes
|
|
||||||
|
|
||||||
# define raylib release directory for compiled library
|
# Define a custom shell .html and output extension
|
||||||
|
CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html
|
||||||
|
EXT = .html
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Define include paths for required headers.
|
||||||
|
# Precedence: immediately local, raysan5 provided sources
|
||||||
|
# NOTE: Several external required libraries (stb and others)
|
||||||
|
INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/release/include -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),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
ifeq ($(PLATFORM_OS),FREEBSD)
|
||||||
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/win32/mingw32
|
# Consider -L$(RAYLIB_H_INSTALL_PATH)
|
||||||
|
INCLUDE_PATHS += -I/usr/local/include
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/linux
|
# Reset everything.
|
||||||
endif
|
# Precedence: immediately local, installed version, raysan5 provided libs -I$(RAYLIB_H_INSTALL_PATH) -I$(RAYLIB_PATH)/release/include
|
||||||
ifeq ($(PLATFORM_OS),OSX)
|
INCLUDE_PATHS = -I$(RAYLIB_H_INSTALL_PATH) -isystem. -isystem$(RAYLIB_PATH)/src -isystem$(RAYLIB_PATH)/release/include -isystem$(RAYLIB_PATH)/src/external
|
||||||
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/osx
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
|
||||||
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/html5
|
|
||||||
endif
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
|
||||||
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/rpi
|
|
||||||
endif
|
|
||||||
|
|
||||||
# define any directories containing required header files
|
# Define library paths containing required libs.
|
||||||
INCLUDES = -I. -I$(RAYLIB_RELEASE) -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external
|
# Precedence: immediately local, then raysan5 provided libs
|
||||||
|
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
|
||||||
INCLUDES += -I../src -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads
|
|
||||||
endif
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
ifeq ($(PLATFORM_OS),FREEBSD)
|
||||||
# external libraries headers
|
# Consider -L$(RAYLIB_INSTALL_PATH)
|
||||||
# GLFW3
|
LDFLAGS += -L. -Lsrc -L/usr/local/lib
|
||||||
INCLUDES += -I$(RAYLIB_PATH)/src/external/glfw3/include
|
|
||||||
# OpenAL Soft
|
|
||||||
INCLUDES += -I$(RAYLIB_PATH)/src/external/openal_soft/include
|
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
# you may optionally create this directory and install raylib
|
# Reset everything.
|
||||||
# and related headers there. Edit ../src/Makefile appropriately.
|
# Precedence: immediately local, installed version, raysan5 provided libs
|
||||||
INCLUDES += -I/usr/local/include/raylib
|
LDFLAGS = -L. -L$(RAYLIB_INSTALL_PATH) -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
|
||||||
endif
|
|
||||||
ifeq ($(PLATFORM_OS),OSX)
|
|
||||||
# additional directories for MacOS
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# define library paths containing required libs
|
|
||||||
LFLAGS = -L. -L$(RAYLIB_RELEASE) -L$(RAYLIB_PATH)/src
|
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
LFLAGS += -L/opt/vc/lib
|
LDFLAGS += -L/opt/vc/lib
|
||||||
endif
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
|
||||||
# add standard directories for GNU/Linux
|
|
||||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
|
||||||
# external libraries to link with
|
|
||||||
# GLFW3
|
|
||||||
LFLAGS += -L$(RAYLIB_PATH)/src/external/glfw3/lib/$(LIBPATH)
|
|
||||||
# OpenAL Soft
|
|
||||||
LFLAGS += -L$(RAYLIB_PATH)/src/external/openal_soft/lib/$(LIBPATH)
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# define any libraries to link into executable
|
# Define any libraries required on linking
|
||||||
# if you want to link libraries (libname.so or libname.a), use the -lname
|
# if you want to link libraries (libname.so or libname.a), use the -lname
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||||
# libraries for Debian GNU/Linux desktop compiling
|
# Libraries for Windows desktop compilation
|
||||||
# requires the following packages:
|
LDLIBS = -lraylib -lopengl32 -lgdi32
|
||||||
# libglfw3-dev libopenal-dev libegl1-mesa-dev
|
# Required for physac examples
|
||||||
LIBS = -lraylib -lglfw -lGL -lopenal -lm -lpthread -ldl
|
LDLIBS += -static -lpthread
|
||||||
# on XWindow requires also below libraries
|
|
||||||
LIBS += -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
|
|
||||||
else
|
|
||||||
ifeq ($(PLATFORM_OS),OSX)
|
|
||||||
# libraries for OS X 10.9 desktop compiling
|
|
||||||
# requires the following packages:
|
|
||||||
# libglfw3-dev libopenal-dev libegl1-mesa-dev
|
|
||||||
LIBS = -lraylib -lglfw -framework OpenGL -framework OpenAL -framework Cocoa
|
|
||||||
else
|
|
||||||
# libraries for Windows desktop compiling
|
|
||||||
# NOTE: GLFW3 and OpenAL Soft libraries should be installed
|
|
||||||
LIBS = -lraylib -lglfw3 -lopengl32 -lgdi32
|
|
||||||
# if static OpenAL Soft required, define the corresponding libs
|
|
||||||
ifeq ($(SHARED_OPENAL),NO)
|
|
||||||
LIBS += -lopenal32 -lwinmm
|
|
||||||
CFLAGS += -Wl,-allow-multiple-definition
|
|
||||||
else
|
|
||||||
LIBS += -lopenal32dll
|
|
||||||
endif
|
|
||||||
PHYSAC_LIBS = -static -lpthread
|
|
||||||
endif
|
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),FREEBSD)
|
||||||
|
# Libraries for FreeBSD 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
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
# libraries for Raspberry Pi compiling
|
# Libraries for Raspberry Pi compiling
|
||||||
# NOTE: OpenAL Soft library should be installed (libopenal1 package)
|
# NOTE: Required packages: libasound2-dev (ALSA)
|
||||||
LIBS = -lraylib -lGLESv2 -lEGL -lpthread -lrt -lm -lbcm_host -lopenal
|
LDLIBS = -lraylib -lbrcmGLESv2 -lbrcmEGL -lpthread -lrt -lm -lbcm_host -ldl
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
# NOTE: Set the correct path to libraylib.bc
|
# Libraries for web (HTML5) compiling
|
||||||
LIBS = $(RAYLIB_RELEASE)/libraylib.bc
|
LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.bc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# define additional parameters and flags for windows
|
# Define all object files required
|
||||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
|
||||||
# resources file contains windows exe icon
|
|
||||||
# -Wl,--subsystem,windows hides the console window
|
|
||||||
WINFLAGS = $(RAYLIB_PATH)/src/resources -Wl,--subsystem,windows
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
|
||||||
EXT = .html
|
|
||||||
WEB_SHELL = --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html
|
|
||||||
endif
|
|
||||||
|
|
||||||
# define all object files required
|
|
||||||
EXAMPLES = \
|
EXAMPLES = \
|
||||||
core/core_basic_window \
|
core/core_basic_window \
|
||||||
core/core_input_keys \
|
core/core_input_keys \
|
||||||
|
|
@ -268,6 +371,8 @@ EXAMPLES = \
|
||||||
textures/textures_particles_blending \
|
textures/textures_particles_blending \
|
||||||
textures/textures_image_processing \
|
textures/textures_image_processing \
|
||||||
textures/textures_image_drawing \
|
textures/textures_image_drawing \
|
||||||
|
textures/textures_image_generation \
|
||||||
|
textures/textures_image_text \
|
||||||
text/text_sprite_fonts \
|
text/text_sprite_fonts \
|
||||||
text/text_bmfont_ttf \
|
text/text_bmfont_ttf \
|
||||||
text/text_raylib_fonts \
|
text/text_raylib_fonts \
|
||||||
|
|
@ -283,6 +388,10 @@ EXAMPLES = \
|
||||||
models/models_heightmap \
|
models/models_heightmap \
|
||||||
models/models_cubicmap \
|
models/models_cubicmap \
|
||||||
models/models_mesh_picking \
|
models/models_mesh_picking \
|
||||||
|
models/models_mesh_generation \
|
||||||
|
models/models_material_pbr \
|
||||||
|
models/models_skybox \
|
||||||
|
models/models_yaw_pitch_roll \
|
||||||
shaders/shaders_model_shader \
|
shaders/shaders_model_shader \
|
||||||
shaders/shaders_shapes_textures \
|
shaders/shaders_shapes_textures \
|
||||||
shaders/shaders_custom_uniform \
|
shaders/shaders_custom_uniform \
|
||||||
|
|
@ -296,270 +405,20 @@ EXAMPLES = \
|
||||||
physac/physics_movement \
|
physac/physics_movement \
|
||||||
physac/physics_restitution \
|
physac/physics_restitution \
|
||||||
physac/physics_shatter \
|
physac/physics_shatter \
|
||||||
fix_dylib \
|
|
||||||
|
|
||||||
|
|
||||||
# typing 'make' will invoke the default target entry
|
CURRENT_MAKEFILE = $(lastword $(MAKEFILE_LIST))
|
||||||
all: examples
|
|
||||||
|
|
||||||
# generic compilation pattern
|
# Default target entry
|
||||||
|
all: $(EXAMPLES)
|
||||||
|
|
||||||
|
# Generic compilation pattern
|
||||||
|
# NOTE: Examples must be ready for Android compilation!
|
||||||
%: %.c
|
%: %.c
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile all examples
|
|
||||||
examples: $(EXAMPLES)
|
|
||||||
|
|
||||||
# compile [core] example - basic window
|
|
||||||
core/core_basic_window: core/core_basic_window.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [core] example - keyboard input
|
|
||||||
core/core_input_keys: core/core_input_keys.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [core] example - mouse input
|
|
||||||
core/core_input_mouse: core/core_input_mouse.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [core] example - mouse wheel
|
|
||||||
core/core_mouse_wheel: core/core_mouse_wheel.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [core] example - gamepad input
|
|
||||||
core/core_input_gamepad: core/core_input_gamepad.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [core] example - generate random values
|
|
||||||
core/core_random_values: core/core_random_values.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [core] example - color selection (collision detection)
|
|
||||||
core/core_color_select: core/core_color_select.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [core] example - drop files
|
|
||||||
core/core_drop_files: core/core_drop_files.c
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
else
|
|
||||||
@echo core_drop_files: Example not supported on PLATFORM_ANDROID or PLATFORM_WEB or PLATFORM_RPI
|
|
||||||
endif
|
|
||||||
|
|
||||||
# compile [core] example - storage values
|
|
||||||
core/core_storage_values: core/core_storage_values.c
|
|
||||||
ifeq ($(PLATFORM), $(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_RPI))
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
else
|
|
||||||
@echo core_storage_values: Example not supported on PLATFORM_ANDROID or PLATFORM_WEB
|
|
||||||
endif
|
|
||||||
|
|
||||||
# compile [core] example - gestures detection
|
|
||||||
core/core_gestures_detection: core/core_gestures_detection.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [core] example - 3d mode
|
|
||||||
core/core_3d_mode: core/core_3d_mode.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [core] example - 3d picking
|
|
||||||
core/core_3d_picking: core/core_3d_picking.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [core] example - 3d camera free
|
|
||||||
core/core_3d_camera_free: core/core_3d_camera_free.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [core] example - 3d camera first person
|
|
||||||
core/core_3d_camera_first_person: core/core_3d_camera_first_person.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [core] example - 2d camera
|
|
||||||
core/core_2d_camera: core/core_2d_camera.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [core] example - world screen
|
|
||||||
core/core_world_screen: core/core_world_screen.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [core] example - vr simulator
|
|
||||||
core/core_vr_simulator: core/core_vr_simulator.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [shapes] example - raylib logo (with basic shapes)
|
|
||||||
shapes/shapes_logo_raylib: shapes/shapes_logo_raylib.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [shapes] example - basic shapes usage (rectangle, circle, ...)
|
|
||||||
shapes/shapes_basic_shapes: shapes/shapes_basic_shapes.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [shapes] example - raylib color palette
|
|
||||||
shapes/shapes_colors_palette: shapes/shapes_colors_palette.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [shapes] example - raylib logo animation
|
|
||||||
shapes/shapes_logo_raylib_anim: shapes/shapes_logo_raylib_anim.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [shapes] example - lines bezier
|
|
||||||
shapes/shapes_lines_bezier: shapes/shapes_lines_bezier.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [textures] example - raylib logo texture loading
|
|
||||||
textures/textures_logo_raylib: textures/textures_logo_raylib.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [textures] example - image loading and conversion to texture
|
|
||||||
textures/textures_image_loading: textures/textures_image_loading.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [textures] example - texture rectangle drawing
|
|
||||||
textures/textures_rectangle: textures/textures_rectangle.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [textures] example - texture source and destination rectangles
|
|
||||||
textures/textures_srcrec_dstrec: textures/textures_srcrec_dstrec.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [textures] example - texture to image
|
|
||||||
textures/textures_to_image: textures/textures_to_image.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [textures] example - texture raw data
|
|
||||||
textures/textures_raw_data: textures/textures_raw_data.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [textures] example - texture particles blending
|
|
||||||
textures/textures_particles_blending: textures/textures_particles_blending.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [textures] example - texture image processing
|
|
||||||
textures/textures_image_processing: textures/textures_image_processing.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [textures] example - texture image drawing
|
|
||||||
textures/textures_image_drawing: textures/textures_image_drawing.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [text] example - sprite fonts loading
|
|
||||||
text/text_sprite_fonts: text/text_sprite_fonts.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [text] example - bmfonts and ttf loading
|
|
||||||
text/text_bmfont_ttf: text/text_bmfont_ttf.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [text] example - raylib fonts
|
|
||||||
text/text_raylib_fonts: text/text_raylib_fonts.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [text] example - text formatting
|
|
||||||
text/text_format_text: text/text_format_text.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [text] example - text writing animation
|
|
||||||
text/text_writing_anim: text/text_writing_anim.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [text] example - text ttf loading
|
|
||||||
text/text_ttf_loading: text/text_ttf_loading.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [text] example - text bmfont unordered
|
|
||||||
text/text_bmfont_unordered: text/text_bmfont_unordered.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [text] example - text input box
|
|
||||||
text/text_input_box: text/text_input_box.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [models] example - basic geometric 3d shapes
|
|
||||||
models/models_geometric_shapes: models/models_geometric_shapes.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [models] example - box collisions
|
|
||||||
models/models_box_collisions: models/models_box_collisions.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [models] example - basic window
|
|
||||||
models/models_planes: models/models_planes.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [models] example - billboard usage
|
|
||||||
models/models_billboard: models/models_billboard.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [models] example - OBJ model loading
|
|
||||||
models/models_obj_loading: models/models_obj_loading.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [models] example - heightmap loading
|
|
||||||
models/models_heightmap: models/models_heightmap.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [models] example - cubesmap loading
|
|
||||||
models/models_cubicmap: models/models_cubicmap.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [models] example - model mesh picking
|
|
||||||
models/models_mesh_picking: models/models_mesh_picking.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [shaders] example - model shader
|
|
||||||
shaders/shaders_model_shader: shaders/shaders_model_shader.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [shaders] example - shapes texture shader
|
|
||||||
shaders/shaders_shapes_textures: shaders/shaders_shapes_textures.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [shaders] example - custom uniform in shader
|
|
||||||
shaders/shaders_custom_uniform: shaders/shaders_custom_uniform.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [shaders] example - postprocessing shader
|
|
||||||
shaders/shaders_postprocessing: shaders/shaders_postprocessing.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [audio] example - sound loading and playing (WAV and OGG)
|
|
||||||
audio/audio_sound_loading: audio/audio_sound_loading.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [audio] example - music stream playing (OGG)
|
|
||||||
audio/audio_music_stream: audio/audio_music_stream.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [audio] example - module playing (XM)
|
|
||||||
audio/audio_module_playing: audio/audio_module_playing.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [audio] example - raw audio streaming
|
|
||||||
audio/audio_raw_stream: audio/audio_raw_stream.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [physac] example - physics demo
|
|
||||||
physac/physics_demo: physac/physics_demo.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) $(PHYSAC_LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [physac] example - physics friction
|
|
||||||
physac/physics_friction: physac/physics_friction.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) $(PHYSAC_LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [physac] example - physics movement
|
|
||||||
physac/physics_movement: physac/physics_movement.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) $(PHYSAC_LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [physac] example - physics restitution
|
|
||||||
physac/physics_restitution: physac/physics_restitution.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) $(PHYSAC_LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
# compile [physac] example - physics shatter
|
|
||||||
physac/physics_shatter: physac/physics_shatter.c
|
|
||||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) $(PHYSAC_LIBS) -D$(PLATFORM) $(WINFLAGS)
|
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_ANDROID)
|
ifeq ($(PLATFORM),PLATFORM_ANDROID)
|
||||||
external/native_app_glue.o : native_app_glue.c native_app_glue.h
|
$(MAKE) -f Makefile.Android PROJECT_NAME=$@ PROJECT_SOURCE_FILES=$<
|
||||||
$(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(SHAREDFLAG)
|
else
|
||||||
|
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# fix dylib install path name for each executable (MAC)
|
# fix dylib install path name for each executable (MAC)
|
||||||
|
|
@ -568,23 +427,23 @@ ifeq ($(PLATFORM_OS),OSX)
|
||||||
find . -type f -perm +ugo+x -print0 | xargs -t -0 -R 1 -I file install_name_tool -change libglfw.3.0.dylib ../external/glfw3/lib/osx/libglfw.3.0.dylib file
|
find . -type f -perm +ugo+x -print0 | xargs -t -0 -R 1 -I file install_name_tool -change libglfw.3.0.dylib ../external/glfw3/lib/osx/libglfw.3.0.dylib file
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# clean everything
|
# Clean everything
|
||||||
clean:
|
clean:
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
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)
|
ifeq ($(PLATFORM_OS),OSX)
|
||||||
find . -type f -perm +ugo+x -delete
|
find . -type f -perm +ugo+x -delete
|
||||||
rm -f *.o
|
rm -f *.o
|
||||||
else
|
|
||||||
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 -f
|
|
||||||
else
|
|
||||||
del *.o *.exe /s
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
find . -type f -executable -delete
|
find . -type f -executable -delete
|
||||||
rm -f *.o
|
rm -fv *.o
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
del *.o *.html *.js
|
del *.o *.html *.js
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
* This example has been created using raylib 1.0 (www.raylib.com)
|
* 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)
|
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2013-2016 Ramon Santamaria (@raysan5)
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,8 @@ int main()
|
||||||
|
|
||||||
InitWindow(screenWidth, screenHeight, "raylib [core] example - vr simulator");
|
InitWindow(screenWidth, screenHeight, "raylib [core] example - vr simulator");
|
||||||
|
|
||||||
InitVrSimulator(HMD_OCULUS_RIFT_CV1); // Init VR simulator (Oculus Rift CV1 parameters)
|
// Init VR simulator (Oculus Rift CV1 parameters)
|
||||||
|
InitVrSimulator(GetVrDeviceInfo(HMD_OCULUS_RIFT_CV1));
|
||||||
|
|
||||||
// Define the camera to look into our 3d world
|
// Define the camera to look into our 3d world
|
||||||
Camera camera;
|
Camera camera;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* raylib [models] example - Cubicmap loading and drawing
|
* raylib [models] example - Cubicmap loading and drawing
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 1.3 (www.raylib.com)
|
* This example has been created using raylib 1.8 (www.raylib.com)
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* raylib [models] example - Heightmap loading and drawing
|
* raylib [models] example - Heightmap loading and drawing
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 1.3 (www.raylib.com)
|
* This example has been created using raylib 1.8 (www.raylib.com)
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
|
* Copyright (c) 2015 Ramon Santamaria (@raysan5)
|
||||||
|
|
|
||||||
|
|
@ -41,10 +41,13 @@ int main()
|
||||||
model.material = LoadMaterialPBR((Color){ 255, 255, 255, 255 }, 1.0f, 1.0f);
|
model.material = LoadMaterialPBR((Color){ 255, 255, 255, 255 }, 1.0f, 1.0f);
|
||||||
|
|
||||||
// Define lights attributes
|
// Define lights attributes
|
||||||
Light lights[MAX_LIGHTS] = { CreateLight(LIGHT_POINT, (Vector3){ LIGHT_DISTANCE, LIGHT_HEIGHT, 0.0f }, (Vector3){ 0.0f, 0.0f, 0.0f }, (Color){ 255, 0, 0, 255 }, model.material.shader),
|
// NOTE: Shader is passed to every light on creation to define shader bindings internally
|
||||||
CreateLight(LIGHT_POINT, (Vector3){ 0.0f, LIGHT_HEIGHT, LIGHT_DISTANCE }, (Vector3){ 0.0f, 0.0f, 0.0f }, (Color){ 0, 255, 0, 255 }, model.material.shader),
|
Light lights[MAX_LIGHTS] = {
|
||||||
CreateLight(LIGHT_POINT, (Vector3){ -LIGHT_DISTANCE, LIGHT_HEIGHT, 0.0f }, (Vector3){ 0.0f, 0.0f, 0.0f }, (Color){ 0, 0, 255, 255 }, model.material.shader),
|
CreateLight(LIGHT_POINT, (Vector3){ LIGHT_DISTANCE, LIGHT_HEIGHT, 0.0f }, (Vector3){ 0.0f, 0.0f, 0.0f }, (Color){ 255, 0, 0, 255 }, model.material.shader),
|
||||||
CreateLight(LIGHT_DIRECTIONAL, (Vector3){ 0.0f, LIGHT_HEIGHT*2.0f, -LIGHT_DISTANCE }, (Vector3){ 0.0f, 0.0f, 0.0f }, (Color){ 255, 0, 255, 255 }, model.material.shader) };
|
CreateLight(LIGHT_POINT, (Vector3){ 0.0f, LIGHT_HEIGHT, LIGHT_DISTANCE }, (Vector3){ 0.0f, 0.0f, 0.0f }, (Color){ 0, 255, 0, 255 }, model.material.shader),
|
||||||
|
CreateLight(LIGHT_POINT, (Vector3){ -LIGHT_DISTANCE, LIGHT_HEIGHT, 0.0f }, (Vector3){ 0.0f, 0.0f, 0.0f }, (Color){ 0, 0, 255, 255 }, model.material.shader),
|
||||||
|
CreateLight(LIGHT_DIRECTIONAL, (Vector3){ 0.0f, LIGHT_HEIGHT*2.0f, -LIGHT_DISTANCE }, (Vector3){ 0.0f, 0.0f, 0.0f }, (Color){ 255, 0, 255, 255 }, model.material.shader)
|
||||||
|
};
|
||||||
|
|
||||||
SetCameraMode(camera, CAMERA_ORBITAL); // Set an orbital camera mode
|
SetCameraMode(camera, CAMERA_ORBITAL); // Set an orbital camera mode
|
||||||
|
|
||||||
|
|
@ -156,6 +159,7 @@ static Material LoadMaterialPBR(Color albedo, float metalness, float roughness)
|
||||||
UnloadTexture(cubemap);
|
UnloadTexture(cubemap);
|
||||||
UnloadTexture(texHDR);
|
UnloadTexture(texHDR);
|
||||||
|
|
||||||
|
// Unload already used shaders (to create specific textures)
|
||||||
UnloadShader(shdrCubemap);
|
UnloadShader(shdrCubemap);
|
||||||
UnloadShader(shdrIrradiance);
|
UnloadShader(shdrIrradiance);
|
||||||
UnloadShader(shdrPrefilter);
|
UnloadShader(shdrPrefilter);
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 189 KiB After Width: | Height: | Size: 317 KiB |
113
examples/models/models_mesh_generation.c
Normal file
113
examples/models/models_mesh_generation.c
Normal file
|
|
@ -0,0 +1,113 @@
|
||||||
|
/*******************************************************************************************
|
||||||
|
*
|
||||||
|
* raylib example - procedural mesh generation
|
||||||
|
*
|
||||||
|
* This example has been created using raylib 1.8 (www.raylib.com)
|
||||||
|
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2017 Ramon Santamaria (Ray San)
|
||||||
|
*
|
||||||
|
********************************************************************************************/
|
||||||
|
|
||||||
|
#include "raylib.h"
|
||||||
|
|
||||||
|
#define NUM_MODELS 7 // We generate 7 parametric 3d shapes
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
// Initialization
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
int screenWidth = 800;
|
||||||
|
int screenHeight = 450;
|
||||||
|
|
||||||
|
InitWindow(screenWidth, screenHeight, "raylib [models] example - mesh generation");
|
||||||
|
|
||||||
|
// We generate a checked image for texturing
|
||||||
|
Image checked = GenImageChecked(2, 2, 1, 1, RED, GREEN);
|
||||||
|
Texture2D texture = LoadTextureFromImage(checked);
|
||||||
|
UnloadImage(checked);
|
||||||
|
|
||||||
|
Model models[NUM_MODELS];
|
||||||
|
|
||||||
|
models[0] = LoadModelFromMesh(GenMeshPlane(2, 2, 5, 5));
|
||||||
|
models[1] = LoadModelFromMesh(GenMeshCube(2.0f, 1.0f, 2.0f));
|
||||||
|
models[2] = LoadModelFromMesh(GenMeshSphere(2, 32, 32));
|
||||||
|
models[3] = LoadModelFromMesh(GenMeshHemiSphere(2, 16, 16));
|
||||||
|
models[4] = LoadModelFromMesh(GenMeshCylinder(1, 2, 16));
|
||||||
|
models[5] = LoadModelFromMesh(GenMeshTorus(0.25f, 4.0f, 16, 32));
|
||||||
|
models[6] = LoadModelFromMesh(GenMeshKnot(1.0f, 2.0f, 16, 128));
|
||||||
|
|
||||||
|
// Set checked texture as default diffuse component for all models material
|
||||||
|
for (int i = 0; i < NUM_MODELS; i++) models[i].material.maps[MAP_DIFFUSE].texture = texture;
|
||||||
|
|
||||||
|
// Define the camera to look into our 3d world
|
||||||
|
Camera camera = {{ 5.0f, 5.0f, 5.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 1.0f, 0.0f }, 45.0f };
|
||||||
|
|
||||||
|
// Model drawing position
|
||||||
|
Vector3 position = { 0.0f, 0.0f, 0.0f };
|
||||||
|
|
||||||
|
int currentModel = 0;
|
||||||
|
|
||||||
|
SetCameraMode(camera, CAMERA_ORBITAL); // Set a orbital camera mode
|
||||||
|
|
||||||
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Main game loop
|
||||||
|
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||||
|
{
|
||||||
|
// Update
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
UpdateCamera(&camera); // Update internal camera and our camera
|
||||||
|
|
||||||
|
if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON))
|
||||||
|
{
|
||||||
|
currentModel = (currentModel + 1)%NUM_MODELS; // Cycle between the textures
|
||||||
|
}
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Draw
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
BeginDrawing();
|
||||||
|
|
||||||
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
|
Begin3dMode(camera);
|
||||||
|
|
||||||
|
DrawModel(models[currentModel], position, 1.0f, WHITE);
|
||||||
|
|
||||||
|
DrawGrid(10, 1.0);
|
||||||
|
|
||||||
|
End3dMode();
|
||||||
|
|
||||||
|
DrawRectangle(30, 400, 310, 30, Fade(SKYBLUE, 0.5f));
|
||||||
|
DrawRectangleLines(30, 400, 310, 30, Fade(DARKBLUE, 0.5f));
|
||||||
|
DrawText("MOUSE LEFT BUTTON to CYCLE PROCEDURAL MODELS", 40, 410, 10, BLUE);
|
||||||
|
|
||||||
|
switch(currentModel)
|
||||||
|
{
|
||||||
|
case 0: DrawText("PLANE", 680, 10, 20, DARKBLUE); break;
|
||||||
|
case 1: DrawText("CUBE", 680, 10, 20, DARKBLUE); break;
|
||||||
|
case 2: DrawText("SPHERE", 680, 10, 20, DARKBLUE); break;
|
||||||
|
case 3: DrawText("HEMISPHERE", 640, 10, 20, DARKBLUE); break;
|
||||||
|
case 4: DrawText("CYLINDER", 680, 10, 20, DARKBLUE); break;
|
||||||
|
case 5: DrawText("TORUS", 680, 10, 20, DARKBLUE); break;
|
||||||
|
case 6: DrawText("KNOT", 680, 10, 20, DARKBLUE); break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
|
||||||
|
EndDrawing();
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
}
|
||||||
|
|
||||||
|
// De-Initialization
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Unload models data (GPU VRAM)
|
||||||
|
for (int i = 0; i < NUM_MODELS; i++) UnloadModel(models[i]);
|
||||||
|
|
||||||
|
CloseWindow(); // Close window and OpenGL context
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue