Merge branch 'master' of https://github.com/raysan5/raylib into dr/mini_al

This commit is contained in:
David Reid 2018-07-05 22:33:16 +10:00
commit 1d354bc704
114 changed files with 63503 additions and 111220 deletions

1
.gitignore vendored
View file

@ -48,6 +48,7 @@ ipch/
# Ignore compiled binaries # Ignore compiled binaries
*.o *.o
*.exe *.exe
!src/raylib.rc.o
# Ignore all examples files # Ignore all examples files
examples/* examples/*

View file

@ -96,6 +96,7 @@ script:
- if [[ "$ARCH" != *-android && "$ARCH" != html5 ]]; then - if [[ "$ARCH" != *-android && "$ARCH" != html5 ]]; then
pkg-config --static --libs raylib; pkg-config --static --libs raylib;
nm -g release/libraylib.a | grep glfwGetProcAddress || (echo "libraylib.a doesn't contain GLFW symbols! Aborting..." && false); nm -g release/libraylib.a | grep glfwGetProcAddress || (echo "libraylib.a doesn't contain GLFW symbols! Aborting..." && false);
ctest --output-on-failure;
fi fi
deploy: deploy:

View file

@ -9,26 +9,30 @@ Release: raylib 2.0 (June 2017 ?)
KEY CHANGES: KEY CHANGES:
- Removed external dependencies (GLFW3 and OpenAL) - Removed external dependencies (GLFW3 and OpenAL)
- Complete redesign of audio module to use mini_al audio library - Complete redesign of audio module to use mini_al audio library
- Support AppVeyor and Travis CI (continuous integration) build - Support AppVeyor and Travis CI (continuous integration) building
- Reviewed raymath.h for better consistency and performance (inlining) - Reviewed raymath.h for better consistency and performance (inlining)
- Refactor all #define SUPPORT_* into a single config.h - Refactor all #define SUPPORT_* into a single config.h
- Support TCC compiler - Support TCC compiler (32bit and 64bit)
Detailed changes: Detailed changes:
[build] REMOVED: GitHub develop branch [build] REMOVED: GitHub develop branch
[build] ADDED: FreeBSD OS support [build] REMOVED: External dependencies GLFW and OpenAL
[build] REMOVED: Android 32bit ARM support (only 64bit building supported)
[build] ADDED: FreeBSD, OpenBSD, NetBSD, Dragon Fly OS support
[build] ADDED: Universal Windows Platform (UWP) support [build] ADDED: Universal Windows Platform (UWP) support
[build] ADDED: Wayland Linux desktop support [build] ADDED: Wayland Linux desktop support
[build] REMOVED: External dependencies GLFW and OpenAL
[build] ADDED: AppVeyor CI for automatic Windows builds [build] ADDED: AppVeyor CI for automatic Windows builds
[build] ADDED: Travis CI for automatic Linux/macOS builds [build] ADDED: Travis CI for automatic Linux/macOS builds
[build] ADDED: rglfw (GLFW3 module) to avoid external dependency [build] ADDED: rglfw (GLFW3 module) to avoid external dependency
[build] ADDED: VS2017 UWP project [build] ADDED: VS2017 UWP project
[build] ADDED: Builder project template [build] ADDED: Builder project template
[build] REVIEWED: VS2015 and VS2017 projects
[build] ADDED: Compiler memory sanitizer for better debug [build] ADDED: Compiler memory sanitizer for better debug
[build] Setup CMake package target and CI auto-deploy tags [build] ADDED: CMake package target and CI auto-deploy tags
[build] Support DEBUG library building [build] ADDED: DEBUG library building support
[build] ADDED: Notepad++ NppExec scripts
[build] REVIEWED: VS2015 and VS2017 projects
[build] REVIEWED: Android APK build pipeline
[core] REVIEWED: Window creation hints to support transparent windows
[core] Unified InitWindow() between platforms [core] Unified InitWindow() between platforms
[core] Export Android main entry point [core] Export Android main entry point
[core] RENAMED: Begin3dMode() to BeginMode3D() [core] RENAMED: Begin3dMode() to BeginMode3D()
@ -67,12 +71,24 @@ Detailed changes:
[textures] ADDED: ImageMipmaps() [textures] ADDED: ImageMipmaps()
[textures] ADDED: GenImageColor() [textures] ADDED: GenImageColor()
[textures] ADDED: GetPixelDataSize() [textures] ADDED: GetPixelDataSize()
[textures] ADDED: ImageRotateCW()
[textures] ADDED: ImageRotateCCW()
[textures] ADDED: ImageResizeCanvas()
[textures] ADDED: GetImageDataNormalized()
[textures] REVIEWED: ImageFormat() to use normalized data
[textures] REVIEWED: Manual mipmap generation
[textures] REVIEWED: LoadASTC()
[textures] REVIEWED: GenImagePerlinNoise() [textures] REVIEWED: GenImagePerlinNoise()
[textures] REVIEWED: ImageTextEx() to support UTF8 basic characters [textures] REVIEWED: ImageTextEx() to support UTF8 basic characters
[textures] REVIEWED: GetTextureData() for RPI - requires some work [textures] REVIEWED: GetTextureData() for RPI - requires some work
[textures] Added new example: text drawing on image [textures] Added new example: text drawing on image
[text] Corrected issue with ttf font y-offset [text] Corrected issue with ttf font y-offset
[text] Support SDF font data generation
[text] ADDED: GenImageFontAtlas()
[text] ADDED: LoadFontData() to load data from TTF file
[text] REMOVED: LoadTTF() internal function
[text] REVIEWED: DrawTextEx() - avoid rendering SPACE character! [text] REVIEWED: DrawTextEx() - avoid rendering SPACE character!
[rlgl] ADDED: rlCheckBufferLimit()
[rlgl] ADDED: LoadShaderCode() [rlgl] ADDED: LoadShaderCode()
[rlgl] ADDED: GetMatrixModelview() [rlgl] ADDED: GetMatrixModelview()
[rlgl] ADDED: SetVrDistortionShader(Shader shader) [rlgl] ADDED: SetVrDistortionShader(Shader shader)
@ -87,6 +103,7 @@ Detailed changes:
[models] RENAMED: CalculateBoundingBox() to MeshBoundingBox() [models] RENAMED: CalculateBoundingBox() to MeshBoundingBox()
[models] REMOVED: GetCollisionRayMesh() - does not consider model transform [models] REMOVED: GetCollisionRayMesh() - does not consider model transform
[models] REVIEWED: LoadMesh() - fallback to default cube mesh if loading fails [models] REVIEWED: LoadMesh() - fallback to default cube mesh if loading fails
[audio] ADDED: Support for MP3 fileformat
[audio] ADDED: IsAudioStreamPlaying() [audio] ADDED: IsAudioStreamPlaying()
[audio] ADDED: SetAudioStreamVolume() [audio] ADDED: SetAudioStreamVolume()
[audio] ADDED: SetAudioStreamPitch() [audio] ADDED: SetAudioStreamPitch()
@ -94,10 +111,14 @@ Detailed changes:
[utils] RENAMED: SaveImageAs() to ExportImage() [utils] RENAMED: SaveImageAs() to ExportImage()
[utils] REMOVED: rres support - moved to external library (rres.h) [utils] REMOVED: rres support - moved to external library (rres.h)
[shaders] REVIEWED: GLSL 120 shaders [shaders] REVIEWED: GLSL 120 shaders
[raymath] ADDED: Vector3RotateByQuaternion()
[raymath] REVIEWED: math usage to reduce temp variables [raymath] REVIEWED: math usage to reduce temp variables
[raymath] REVIEWED: Avoid pointer-based parameters for API consistency [raymath] REVIEWED: Avoid pointer-based parameters for API consistency
[physac] REVIEWED: physac.h timming system [physac] REVIEWED: physac.h timming system
[examples] Replaced dwarf model by brand new 3d assets: 3d medieval buildings
[examples] Assets cleaning and some replacements
[games] ADDED: GGJ18 game - transmission mission [games] ADDED: GGJ18 game - transmission mission
[games] REVIEWED: Light my Ritual game - improved gameplay drawing
[*] Updated external libraries to latest version [*] Updated external libraries to latest version
[*] Multiple bugs corrected (check github issues) [*] Multiple bugs corrected (check github issues)

View file

@ -50,3 +50,5 @@ endif()
if (${BUILD_GAMES}) if (${BUILD_GAMES})
add_subdirectory(games) add_subdirectory(games)
endif() endif()
enable_testing()

View file

@ -46,4 +46,4 @@ The following fonts [provided with raylib](https://github.com/raysan5/raylib/tre
3d models 3d models
--------- ---------
[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) [medieval city 3d models and textures](https://github.com/raysan5/raylib/tree/master/examples/models/resources/medieval) have been created by Alberto Cano and licensed as [Creative Commons Attribution-NonCommercial 4.0](https://creativecommons.org/licenses/by-nc/4.0/legalcode)

View file

@ -30,7 +30,7 @@ features
* 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, FreeBSD, MacOS, UWP, Android, Raspberry Pi, HTML5. * Multiple platforms support: Windows, Linux, FreeBSD, OpenBSD, NetBSD, DragonFly, MacOS, UWP, Android, Raspberry Pi, HTML5.
* VR stereo rendering with configurable HMD device parameters * VR stereo rendering with configurable HMD device parameters
* NO external dependencies, all required libraries included with raylib * 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))

21
cmake/test-pkgconfig.sh Executable file
View file

@ -0,0 +1,21 @@
#!/bin/sh
# Test if including/linking/running an installed raylib works
set -x
export LD_RUN_PATH=/usr/local/lib
CFLAGS="-Wall -Wextra -Werror $CFLAGS"
if [ "$ARCH" = "i386" ]; then
CFLAGS="-m32 $CLFAGS"
fi
cat << EOF | ${CC:-cc} -otest -xc - $(pkg-config --libs --cflags $@ raylib.pc) $CFLAGS && exec ./test
#include <stdlib.h>
#include <raylib.h>
int main(void)
{
int num = GetRandomValue(42, 1337);
return 42 <= num && num <= 1337 ? EXIT_SUCCESS : EXIT_FAILURE;
}
EOF

14
cmake/utils.cmake Executable file → Normal file
View file

@ -11,13 +11,8 @@ if(${PLATFORM} MATCHES "Android")
elseif(${PLATFORM} MATCHES "Web") elseif(${PLATFORM} MATCHES "Web")
elseif(APPLE) elseif(APPLE)
find_library(OPENGL_LIBRARY OpenGL) find_library(OPENGL_LIBRARY OpenGL)
find_library(COCOA_LIBRARY Cocoa)
find_library(IOKIT_LIBRARY IOKit)
find_library(COREFOUNDATION_LIBRARY CoreFoundation)
find_library(COREVIDEO_LIBRARY CoreVideo)
set(LIBS_PRIVATE ${OPENGL_LIBRARY} ${COCOA_LIBRARY} set(LIBS_PRIVATE ${OPENGL_LIBRARY})
${IOKIT_LIBRARY} ${COREFOUNDATION_LIBRARY} ${COREVIDEO_LIBRARY})
elseif(WIN32) elseif(WIN32)
# no pkg-config --static on Windows yet... # no pkg-config --static on Windows yet...
else() else()
@ -34,12 +29,6 @@ else()
endif() endif()
set(LIBS_PRIVATE m pthread ${OPENGL_LIBRARIES} ${OSS_LIBRARY}) set(LIBS_PRIVATE m pthread ${OPENGL_LIBRARIES} ${OSS_LIBRARY})
# TODO: maybe read those out of glfw's cmake config?
if(USE_WAYLAND)
set(LIBS_PRIVATE ${LIBS_PRIVATE} wayland-client wayland-cursor wayland-egl)
else()
set(LIBS_PRIVATE ${LIBS_PRIVATE} X11 Xrandr Xinerama Xi Xxf86vm Xcursor)
endif()
endif() endif()
if(${PLATFORM} MATCHES "Desktop") if(${PLATFORM} MATCHES "Desktop")
@ -55,7 +44,6 @@ endif()
if(CMAKE_SYSTEM_NAME STREQUAL Linux) if(CMAKE_SYSTEM_NAME STREQUAL Linux)
set(LINUX TRUE) set(LINUX TRUE)
set(LIBS_PRIVATE dl ${LIBS_PRIVATE})
endif() endif()
foreach(L ${LIBS_PRIVATE}) foreach(L ${LIBS_PRIVATE})

View file

@ -76,7 +76,16 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
PLATFORM_OS=LINUX PLATFORM_OS=LINUX
endif endif
ifeq ($(UNAMEOS),FreeBSD) ifeq ($(UNAMEOS),FreeBSD)
PLATFORM_OS=FREEBSD PLATFORM_OS=BSD
endif
ifeq ($(UNAMEOS),OpenBSD)
PLATFORM_OS=BSD
endif
ifeq ($(UNAMEOS),NetBSD)
PLATFORM_OS=BSD
endif
ifeq ($(UNAMEOS),DragonFly)
PLATFORM_OS=BSD
endif endif
ifeq ($(UNAMEOS),Darwin) ifeq ($(UNAMEOS),Darwin)
PLATFORM_OS=OSX PLATFORM_OS=OSX
@ -129,8 +138,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),OSX) ifeq ($(PLATFORM_OS),OSX)
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx
endif endif
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/freebsd RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/bsd
endif endif
endif endif
ifeq ($(PLATFORM),PLATFORM_RPI) ifeq ($(PLATFORM),PLATFORM_RPI)
@ -163,8 +172,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# OSX default compiler # OSX default compiler
CC = clang CC = clang
endif endif
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
# FreeBSD default compiler # FreeBSD, OpenBSD, NetBSD, DragonFly default compiler
CC = clang CC = clang
endif endif
endif endif
@ -205,9 +214,9 @@ CFLAGS += -O1 -s -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces
#CFLAGS += -Wextra -Wmissing-prototypes -Wstrict-prototypes #CFLAGS += -Wextra -Wmissing-prototypes -Wstrict-prototypes
ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS) ifeq ($(PLATFORM_OS),WINDOWS)
# resources file contains windows exe icon # resource file contains windows executable icon and properties
# -Wl,--subsystem,windows hides the console window # -Wl,--subsystem,windows hides the console window
CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows CFLAGS += $(RAYLIB_PATH)/src/raylib.rc.o -Wl,--subsystem,windows
endif endif
ifeq ($(PLATFORM_OS),LINUX) ifeq ($(PLATFORM_OS),LINUX)
ifeq ($(RAYLIB_BUILD_MODE),DEBUG) ifeq ($(RAYLIB_BUILD_MODE),DEBUG)
@ -254,7 +263,7 @@ ifeq ($(PLATFORM),PLATFORM_RPI)
INCLUDE_PATHS += -I/opt/vc/include/interface/vcos/pthreads INCLUDE_PATHS += -I/opt/vc/include/interface/vcos/pthreads
endif endif
ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
# Consider -L$(RAYLIB_H_INSTALL_PATH) # Consider -L$(RAYLIB_H_INSTALL_PATH)
INCLUDE_PATHS += -I/usr/local/include INCLUDE_PATHS += -I/usr/local/include
endif endif
@ -270,7 +279,7 @@ endif
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
# Consider -L$(RAYLIB_INSTALL_PATH) # Consider -L$(RAYLIB_INSTALL_PATH)
LDFLAGS += -L. -Lsrc -L/usr/local/lib LDFLAGS += -L. -Lsrc -L/usr/local/lib
endif endif
@ -316,8 +325,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# NOTE: Required packages: libopenal-dev libegl1-mesa-dev # NOTE: Required packages: libopenal-dev libegl1-mesa-dev
LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa
endif endif
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
# Libraries for FreeBSD desktop compiling # Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling
# NOTE: Required packages: mesa-libs # NOTE: Required packages: mesa-libs
LDLIBS = -lraylib -lGL -lpthread -lm LDLIBS = -lraylib -lGL -lpthread -lm
# On XWindow requires also below libraries # On XWindow requires also below libraries

View file

@ -152,7 +152,7 @@ static Material LoadMaterialPBR(Color albedo, float metalness, float roughness)
SetShaderValuei(shdrIrradiance, GetShaderLocation(shdrIrradiance, "environmentMap"), (int[1]){ 0 }, 1); SetShaderValuei(shdrIrradiance, GetShaderLocation(shdrIrradiance, "environmentMap"), (int[1]){ 0 }, 1);
SetShaderValuei(shdrPrefilter, GetShaderLocation(shdrPrefilter, "environmentMap"), (int[1]){ 0 }, 1); SetShaderValuei(shdrPrefilter, GetShaderLocation(shdrPrefilter, "environmentMap"), (int[1]){ 0 }, 1);
Texture2D texHDR = LoadTexture("resources/pinetree.hdr"); Texture2D texHDR = LoadTexture("resources/dresden_square.hdr");
Texture2D cubemap = GenTextureCubemap(shdrCubemap, texHDR, CUBEMAP_SIZE); Texture2D cubemap = GenTextureCubemap(shdrCubemap, texHDR, CUBEMAP_SIZE);
mat.maps[MAP_IRRADIANCE].texture = GenTextureIrradiance(shdrIrradiance, cubemap, IRRADIANCE_SIZE); mat.maps[MAP_IRRADIANCE].texture = GenTextureIrradiance(shdrIrradiance, cubemap, IRRADIANCE_SIZE);
mat.maps[MAP_PREFILTER].texture = GenTexturePrefilter(shdrPrefilter, cubemap, PREFILTERED_SIZE); mat.maps[MAP_PREFILTER].texture = GenTexturePrefilter(shdrPrefilter, cubemap, PREFILTERED_SIZE);
@ -193,4 +193,4 @@ static Material LoadMaterialPBR(Color albedo, float metalness, float roughness)
mat.maps[MAP_HEIGHT].value = 0.5f; mat.maps[MAP_HEIGHT].value = 0.5f;
return mat; return mat;
} }

View file

@ -26,17 +26,17 @@ int main()
// Define the camera to look into our 3d world // Define the camera to look into our 3d world
Camera camera; Camera camera;
camera.position = (Vector3){ 10.0f, 8.0f, 10.0f }; // Camera position camera.position = (Vector3){ 20.0f, 20.0f, 20.0f }; // Camera position
camera.target = (Vector3){ 0.0f, 2.3f, 0.0f }; // Camera looking at point camera.target = (Vector3){ 0.0f, 8.0f, 0.0f }; // Camera looking at point
camera.up = (Vector3){ 0.0f, 1.6f, 0.0f }; // Camera up vector (rotation towards target) camera.up = (Vector3){ 0.0f, 1.6f, 0.0f }; // Camera up vector (rotation towards target)
camera.fovy = 45.0f; // Camera field-of-view Y camera.fovy = 45.0f; // Camera field-of-view Y
camera.type = CAMERA_PERSPECTIVE; // Camera mode type camera.type = CAMERA_PERSPECTIVE; // Camera mode type
Ray ray; // Picking ray Ray ray; // Picking ray
Model tower = LoadModel("resources/tower.obj"); // Load OBJ model Model tower = LoadModel("resources/models/turret.obj"); // Load OBJ model
Texture2D texture = LoadTexture("resources/tower.png"); // Load model texture Texture2D texture = LoadTexture("resources/models/turret_diffuse.png"); // Load model texture
tower.material.maps[MAP_DIFFUSE].texture = texture; // Set model diffuse texture tower.material.maps[MAP_DIFFUSE].texture = texture; // Set model diffuse texture
Vector3 towerPos = { 0.0f, 0.0f, 0.0f }; // Set model position Vector3 towerPos = { 0.0f, 0.0f, 0.0f }; // Set model position
BoundingBox towerBBox = MeshBoundingBox(tower.mesh); // Get mesh bounding box BoundingBox towerBBox = MeshBoundingBox(tower.mesh); // Get mesh bounding box
@ -103,6 +103,7 @@ int main()
hitMeshBBox = true; hitMeshBBox = true;
// Check ray collision against model // Check ray collision against model
// NOTE: It considers model.transform matrix!
meshHitInfo = GetCollisionRayModel(ray, &tower); meshHitInfo = GetCollisionRayModel(ray, &tower);
if ((meshHitInfo.hit) && (meshHitInfo.distance < nearestHit.distance)) if ((meshHitInfo.hit) && (meshHitInfo.distance < nearestHit.distance))
@ -124,7 +125,9 @@ int main()
BeginMode3D(camera); BeginMode3D(camera);
// Draw the tower // Draw the tower
DrawModel(tower, towerPos, 1.0, WHITE); // WARNING: If scale is different than 1.0f,
// not considered by GetCollisionRayModel()
DrawModel(tower, towerPos, 1.0f, WHITE);
// Draw the test triangle // Draw the test triangle
DrawLine3D(ta, tb, PURPLE); DrawLine3D(ta, tb, PURPLE);
@ -150,7 +153,7 @@ int main()
DrawRay(ray, MAROON); DrawRay(ray, MAROON);
DrawGrid(100, 1.0f); DrawGrid(10, 10.0f);
EndMode3D(); EndMode3D();
@ -177,6 +180,8 @@ int main()
} }
DrawText("Use Mouse to Move Camera", 10, 430, 10, GRAY); DrawText("Use Mouse to Move Camera", 10, 430, 10, GRAY);
DrawText("(c) Turret 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, GRAY);
DrawFPS(10, 10); DrawFPS(10, 10);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 136 KiB

Before After
Before After

View file

@ -22,15 +22,15 @@ int main()
// Define the camera to look into our 3d world // Define the camera to look into our 3d world
Camera camera = { 0 }; Camera camera = { 0 };
camera.position = (Vector3){ 3.0f, 3.0f, 3.0f }; // Camera position camera.position = (Vector3){ 8.0f, 8.0f, 8.0f }; // Camera position
camera.target = (Vector3){ 0.0f, 1.5f, 0.0f }; // Camera looking at point camera.target = (Vector3){ 0.0f, 2.5f, 0.0f }; // Camera looking at point
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target) camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
camera.fovy = 45.0f; // Camera field-of-view Y camera.fovy = 45.0f; // Camera field-of-view Y
camera.type = CAMERA_PERSPECTIVE; // Camera mode type camera.type = CAMERA_PERSPECTIVE; // Camera mode type
Model dwarf = LoadModel("resources/model/dwarf.obj"); // Load OBJ model Model model = LoadModel("resources/models/castle.obj"); // Load OBJ model
Texture2D texture = LoadTexture("resources/model/dwarf_diffuse.png"); // Load model texture Texture2D texture = LoadTexture("resources/models/castle_diffuse.png"); // Load model texture
dwarf.material.maps[MAP_DIFFUSE].texture = texture; // Set map diffuse texture model.material.maps[MAP_DIFFUSE].texture = texture; // Set map diffuse texture
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position
SetTargetFPS(60); // Set our game to run at 60 frames-per-second SetTargetFPS(60); // Set our game to run at 60 frames-per-second
@ -52,7 +52,7 @@ int main()
BeginMode3D(camera); BeginMode3D(camera);
DrawModel(dwarf, position, 2.0f, WHITE); // Draw 3d model with texture DrawModel(model, position, 0.2f, WHITE); // Draw 3d model with texture
DrawGrid(10, 1.0f); // Draw a grid DrawGrid(10, 1.0f); // Draw a grid
@ -60,7 +60,7 @@ int main()
EndMode3D(); EndMode3D();
DrawText("(c) Dwarf 3D model by David Moreno", screenWidth - 200, screenHeight - 20, 10, GRAY); DrawText("(c) Castle 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, GRAY);
DrawFPS(10, 10); DrawFPS(10, 10);
@ -71,7 +71,7 @@ int main()
// De-Initialization // De-Initialization
//-------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------
UnloadTexture(texture); // Unload texture UnloadTexture(texture); // Unload texture
UnloadModel(dwarf); // Unload model UnloadModel(model); // Unload model
CloseWindow(); // Close window and OpenGL context CloseWindow(); // Close window and OpenGL context
//-------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

After

Width:  |  Height:  |  Size: 260 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View file

@ -36,12 +36,17 @@ int main()
Shader shdrCubemap = LoadShader("resources/shaders/cubemap.vs", "resources/shaders/cubemap.fs"); Shader shdrCubemap = LoadShader("resources/shaders/cubemap.vs", "resources/shaders/cubemap.fs");
SetShaderValuei(shdrCubemap, GetShaderLocation(shdrCubemap, "equirectangularMap"), (int[1]){ 0 }, 1); SetShaderValuei(shdrCubemap, GetShaderLocation(shdrCubemap, "equirectangularMap"), (int[1]){ 0 }, 1);
Texture2D texHDR = LoadTexture("resources/pinetree.hdr"); // Load HDR panorama (sphere) texture
Texture2D texHDR = LoadTexture("resources/dresden_square.hdr");
// Generate cubemap (texture with 6 quads-cube-mapping) from panorama HDR texture
// NOTE: New texture is generated rendering to texture, shader computes the sphre->cube coordinates mapping
skybox.material.maps[MAP_CUBEMAP].texture = GenTextureCubemap(shdrCubemap, texHDR, 512); skybox.material.maps[MAP_CUBEMAP].texture = GenTextureCubemap(shdrCubemap, texHDR, 512);
UnloadShader(shdrCubemap); // Cubemap generation shader not required any more UnloadTexture(texHDR); // Texture not required anymore, cubemap already generated
UnloadShader(shdrCubemap); // Unload cubemap generation shader, not required anymore
SetCameraMode(camera, CAMERA_ORBITAL); // Set an orbital camera mode SetCameraMode(camera, CAMERA_FIRST_PERSON); // Set a first person camera mode
SetTargetFPS(60); // Set our game to run at 60 frames-per-second SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//-------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------
@ -76,7 +81,7 @@ int main()
// De-Initialization // De-Initialization
//-------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------
UnloadModel(skybox); // Unload skybox model UnloadModel(skybox); // Unload skybox model (and textures)
CloseWindow(); // Close window and OpenGL context CloseWindow(); // Close window and OpenGL context
//-------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------

Binary file not shown.

Before

Width:  |  Height:  |  Size: 707 KiB

After

Width:  |  Height:  |  Size: 417 KiB

Before After
Before After

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 MiB

File diff suppressed because it is too large Load diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 KiB

File diff suppressed because it is too large Load diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

File diff suppressed because it is too large Load diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 KiB

File diff suppressed because it is too large Load diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 KiB

File diff suppressed because it is too large Load diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 KiB

File diff suppressed because it is too large Load diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 KiB

View file

@ -1,456 +0,0 @@
# Blender v2.78 (sub 0) OBJ File: 'lowpoly-tower.blend'
# www.blender.org
o Grid
v -4.000000 0.000000 4.000000
v -2.327363 0.000000 4.654725
v 0.000000 0.000000 4.654725
v 2.327363 0.000000 4.654725
v 4.000000 0.000000 4.000000
v -4.654725 0.955085 2.327363
v -2.000000 0.815050 2.000000
v 0.000000 0.476341 2.423448
v 2.000000 0.476341 2.000000
v 4.654725 0.000000 2.327363
v -4.654725 1.649076 0.000000
v -2.423448 1.092402 0.000000
v 2.423448 0.198579 0.000000
v 4.654725 0.000000 0.000000
v -4.654725 1.649076 -2.327363
v -2.000000 1.092402 -2.000000
v 0.000000 0.476341 -2.423448
v 2.000000 -0.012791 -2.000000
v 4.654725 0.000000 -2.612731
v -4.000000 0.955085 -4.000000
v -2.327363 0.955085 -4.654725
v 0.000000 0.955085 -4.654725
v 2.327363 0.000000 -4.654725
v 4.000000 0.000000 -4.000000
v 2.423448 0.682825 0.000000
v 2.000000 0.565423 -2.000000
v -4.654725 -0.020560 2.327363
v -4.654725 0.000000 0.000000
v -4.654725 0.000000 -2.327363
v -4.000000 0.000000 -4.000000
v -2.327363 0.000000 -4.654725
v 0.000000 -0.020560 -4.654725
v 0.000000 0.709880 -1.230535
v -0.000000 7.395413 0.000000
v 0.962071 0.709880 -0.767226
v -0.533909 0.709880 1.108674
v -1.199683 0.709880 0.273820
v -0.962071 0.709880 -0.767226
v 1.506076 0.859071 1.325337
v 1.199683 0.709880 0.273820
v 0.533909 0.709880 1.108674
v 0.000000 1.875340 -1.177842
v -0.000000 2.293973 -0.649884
v -0.000000 4.365648 -0.627970
v 0.000000 6.167194 -0.942957
v 0.000000 6.232434 -1.708677
v 1.335898 6.232434 -1.065343
v 0.737233 6.167195 -0.587924
v 0.490966 4.365648 -0.391533
v 0.508100 2.293973 -0.405196
v 0.920874 1.875340 -0.734372
v -0.741367 6.232434 1.539465
v -0.409133 6.167195 0.849574
v -0.272466 4.365648 0.565781
v -0.281974 2.293973 0.585526
v -0.511047 1.875340 1.061199
v -1.665837 6.232434 0.380217
v -0.919314 6.167195 0.209828
v -0.612225 4.365648 0.139736
v -0.633590 2.293973 0.144613
v -1.148311 1.875340 0.262095
v -1.335898 6.232434 -1.065343
v -0.737233 6.167195 -0.587924
v -0.490967 4.365648 -0.391533
v -0.508100 2.293973 -0.405196
v -0.920874 1.875340 -0.734372
v 1.665837 6.232434 0.380216
v 0.919315 6.167195 0.209828
v 0.612225 4.365648 0.139736
v 0.633590 2.293973 0.144613
v 1.148311 1.875340 0.262095
v 0.741367 6.232434 1.539465
v 0.409133 6.167195 0.849575
v 0.272466 4.365648 0.565781
v 0.281974 2.293973 0.585526
v 0.511046 1.875340 1.061199
v 0.000000 5.012550 -0.969733
v 0.758168 5.012550 -0.604618
v -0.420751 5.012550 0.873699
v -0.945419 5.012550 0.215786
v -0.758168 5.012550 -0.604618
v 0.945419 5.012550 0.215786
v 0.420751 5.012550 0.873699
vt 0.0523 0.5444
vt 0.1817 0.4284
vt 0.1641 0.5859
vt 0.0177 0.4451
vt 0.1526 0.3090
vt 0.0189 0.1737
vt 0.0188 0.3088
vt 0.0561 0.0762
vt 0.1757 0.1924
vt 0.3024 0.4534
vt 0.3071 0.5902
vt 0.3413 0.2459
vt 0.2906 0.1614
vt 0.4116 0.1801
vt 0.2834 0.3774
vt 0.1526 0.0362
vt 0.2917 0.1622
vt 0.4446 0.5865
vt 0.4443 0.2989
vt 0.3711 0.3021
vt 0.4396 0.0275
vt 0.4094 0.1829
vt 0.4219 0.4255
vt 0.5474 0.5381
vt 0.5811 0.4376
vt 0.5715 0.1505
vt 0.5811 0.2997
vt 0.5272 0.0533
vt 0.2208 0.2194
vt 0.3456 0.3610
vt 0.2878 0.0321
vt 0.2321 0.3392
vt 0.4432 0.0177
vt 0.7347 0.7934
vt 0.7382 0.7595
vt 0.8982 0.7768
vt 0.6169 0.7595
vt 0.6139 0.7879
vt 0.4951 0.7634
vt 0.1551 0.6832
vt 0.2925 0.6268
vt 0.2925 0.6832
vt 0.7795 0.6832
vt 0.6421 0.6268
vt 0.7795 0.6255
vt 0.5046 0.7241
vt 0.6421 0.7241
vt 0.3986 0.6268
vt 0.3986 0.6832
vt 0.5046 0.6268
vt 0.0177 0.6268
vt 0.1551 0.6255
vt 0.8856 0.6268
vt 0.1899 0.9579
vt 0.1194 0.8696
vt 0.2324 0.8696
vt 0.1899 0.7813
vt 0.0943 0.7595
vt 0.0177 0.8206
vt 0.0177 0.9186
vt 0.0943 0.9797
vt 0.2793 0.2349
vt 0.2304 0.2758
vt 0.6597 0.0177
vt 0.6954 0.0993
vt 0.6367 0.0768
vt 0.7558 0.0777
vt 0.7238 0.0440
vt 0.8840 0.1330
vt 0.7385 0.1141
vt 0.9157 0.0886
vt 0.9781 0.1232
vt 0.9224 0.1276
vt 0.2677 0.8141
vt 0.3463 0.8037
vt 0.3086 0.8339
vt 0.6387 0.3550
vt 0.7130 0.3801
vt 0.6596 0.4053
vt 0.7245 0.3245
vt 0.6919 0.3383
vt 0.8655 0.3566
vt 0.7351 0.3577
vt 0.9770 0.3365
vt 0.9078 0.3751
vt 0.9174 0.3282
vt 0.2677 0.9018
vt 0.3086 0.8821
vt 0.6803 0.2948
vt 0.6251 0.3035
vt 0.7194 0.2854
vt 0.8764 0.2832
vt 0.9221 0.2861
vt 0.3363 0.9565
vt 0.3464 0.9122
vt 0.6751 0.2482
vt 0.6178 0.2499
vt 0.7179 0.2431
vt 0.9823 0.2484
vt 0.9247 0.2452
vt 0.3935 0.9014
vt 0.6755 0.1996
vt 0.6164 0.1941
vt 0.7201 0.1992
vt 0.8793 0.2446
vt 0.9823 0.2060
vt 0.9257 0.2051
vt 0.4598 0.8580
vt 0.4144 0.8579
vt 0.6819 0.1498
vt 0.6222 0.1361
vt 0.7266 0.1555
vt 0.8831 0.1684
vt 0.9252 0.1659
vt 0.4218 0.7790
vt 0.3934 0.8145
vt 0.3363 0.7595
vt 0.8815 0.2060
vt 0.8720 0.3208
vt 0.8825 0.1012
vt 0.9735 0.0816
vt 0.9718 0.3817
vt 0.9807 0.2918
vt 0.4218 0.9370
vt 0.9810 0.1644
vn 0.1035 0.8806 0.4623
vn 0.0964 0.9481 0.3030
vn 0.0000 0.9780 0.2088
vn 0.0659 0.9835 0.1683
vn 0.2325 0.9320 0.2779
vn 0.0553 0.9960 -0.0702
vn 0.2827 0.9564 0.0728
vn 0.1873 0.9776 -0.0961
vn 0.2421 0.9703 0.0000
vn 0.0921 0.9772 -0.1913
vn -0.0277 0.9947 -0.0993
vn 0.2308 0.9274 -0.2944
vn 0.2771 0.9572 -0.0837
vn 0.3724 0.9074 0.1947
vn 0.0777 0.9770 -0.1985
vn -0.1094 0.9539 0.2794
vn 0.0364 0.9844 0.1721
vn 0.1683 0.9835 0.0659
vn 0.0674 0.9901 0.1230
vn 0.4338 0.8823 0.1829
vn 0.2845 0.9565 0.0649
vn 0.0886 0.9961 0.0000
vn 0.2000 0.9789 0.0424
vn 0.1417 0.9830 0.1171
vn 0.3021 0.9524 0.0412
vn -0.0193 0.9986 -0.0493
vn 0.0000 0.9777 0.2098
vn 0.0005 0.9781 -0.2083
vn 0.1879 0.9782 -0.0887
vn 0.2249 0.0000 0.9744
vn 0.9783 0.0000 -0.2071
vn 0.9783 0.0000 0.2071
vn 0.0000 0.0000 -1.0000
vn -1.0000 0.0000 0.0000
vn -0.3645 0.0000 -0.9312
vn -0.9312 0.0000 -0.3645
vn -0.9312 0.0000 0.3645
vn 0.2615 0.7979 -0.5431
vn 0.5877 0.7979 -0.1341
vn 0.4713 0.7979 0.3758
vn -0.0000 0.7979 0.6028
vn -0.4713 0.7979 0.3758
vn -0.5877 0.7979 -0.1341
vn -0.2615 0.7979 -0.5431
vn -0.1285 0.9864 -0.1025
vn 0.0929 0.8937 0.4389
vn -0.4335 0.0407 -0.9002
vn -0.2867 0.7507 -0.5952
vn -0.4339 0.0095 -0.9009
vn -0.4338 0.0209 -0.9008
vn -0.0408 -0.9956 -0.0848
vn -0.9741 0.0407 -0.2223
vn -0.6441 0.7507 -0.1470
vn -0.9749 0.0095 -0.2225
vn -0.9747 0.0209 -0.2225
vn -0.0918 -0.9956 -0.0209
vn -0.7812 0.0407 0.6230
vn -0.5165 0.7507 0.4119
vn -0.7818 0.0095 0.6235
vn -0.7817 0.0209 0.6234
vn -0.0736 -0.9956 0.0587
vn -0.0000 0.0407 0.9992
vn 0.0000 0.7507 0.6607
vn 0.0000 0.0095 1.0000
vn -0.0000 0.0209 0.9998
vn -0.0000 -0.9956 0.0941
vn 0.7812 0.0407 0.6230
vn 0.5165 0.7507 0.4119
vn 0.7818 0.0095 0.6235
vn 0.7817 0.0209 0.6234
vn 0.0736 -0.9956 0.0587
vn 0.9741 0.0407 -0.2223
vn 0.6441 0.7507 -0.1470
vn 0.9749 0.0095 -0.2225
vn 0.9747 0.0209 -0.2225
vn 0.0918 -0.9956 -0.0209
vn 0.4335 0.0407 -0.9002
vn 0.2867 0.7507 -0.5952
vn 0.4339 0.0095 -0.9009
vn 0.4338 0.0209 -0.9008
vn 0.0408 -0.9956 -0.0848
vn 0.3918 -0.4298 -0.8135
vn 0.8803 -0.4298 -0.2009
vn 0.7059 -0.4298 0.5630
vn -0.0000 -0.4298 0.9029
vn -0.7059 -0.4298 0.5630
vn -0.8803 -0.4298 -0.2009
vn -0.3918 -0.4298 -0.8135
vn 0.0210 0.9998 -0.0048
vn 0.0482 0.9981 -0.0385
vn -0.0166 0.9914 -0.1301
vn -0.0090 0.9904 -0.1379
vn 0.2820 0.9576 0.0597
vn -0.0000 0.9846 0.1749
vn -0.0921 0.9772 -0.1913
vn -0.1734 0.9794 0.1036
s off
f 1/1/1 7/2/1 6/3/1
f 2/4/2 8/5/2 7/2/2
f 4/6/3 8/5/3 3/7/3
f 5/8/4 9/9/4 4/6/4
f 6/3/5 12/10/5 11/11/5
f 35/12/6 25/13/6 26/14/6
f 7/2/7 37/15/7 12/10/7
f 10/16/8 13/17/8 9/9/8
f 12/10/9 15/18/9 11/11/9
f 35/12/10 17/19/10 33/20/10
f 13/17/11 19/21/11 18/22/11
f 16/23/12 20/24/12 15/18/12
f 17/19/13 21/25/13 16/23/13
f 17/19/14 23/26/14 22/27/14
f 26/14/15 24/28/15 23/26/15
f 1/1/16 2/4/16 7/2/16
f 2/4/3 3/7/3 8/5/3
f 4/6/17 9/9/17 8/5/17
f 5/8/18 10/16/18 9/9/18
f 6/3/19 7/2/19 12/10/19
f 25/13/20 39/29/20 9/9/20
f 38/30/21 12/10/21 37/15/21
f 10/16/22 14/31/22 13/17/22
f 12/10/23 16/23/23 15/18/23
f 8/5/24 36/32/24 7/2/24
f 38/30/25 17/19/25 16/23/25
f 13/17/22 14/31/22 19/21/22
f 16/23/26 21/25/26 20/24/26
f 17/19/27 22/27/27 21/25/27
f 17/19/28 26/14/28 23/26/28
f 26/14/29 19/33/29 24/28/29
f 26/34/30 18/35/30 19/36/30
f 26/34/31 13/37/31 18/35/31
f 25/38/32 9/39/32 13/37/32
f 22/40/33 31/41/33 21/42/33
f 6/43/34 28/44/34 27/45/34
f 15/46/34 28/44/34 11/47/34
f 21/42/35 30/48/35 20/49/35
f 20/49/36 29/50/36 15/46/36
f 22/40/33 23/51/33 32/52/33
f 6/43/37 27/45/37 1/53/37
f 46/54/38 34/55/38 47/56/38
f 47/56/39 34/55/39 67/57/39
f 67/57/40 34/55/40 72/58/40
f 72/58/41 34/55/41 52/59/41
f 52/59/42 34/55/42 57/60/42
f 57/60/43 34/55/43 62/61/43
f 62/61/44 34/55/44 46/54/44
f 40/62/45 41/63/45 39/29/45
f 39/29/46 8/5/46 9/9/46
f 38/64/47 42/65/47 33/66/47
f 65/67/48 42/65/48 66/68/48
f 65/67/49 44/69/49 43/70/49
f 81/71/50 45/72/50 77/73/50
f 62/74/51 45/75/51 63/76/51
f 37/77/52 66/78/52 38/79/52
f 60/80/53 66/78/53 61/81/53
f 60/80/54 64/82/54 65/83/54
f 58/84/55 81/85/55 80/86/55
f 57/87/56 63/76/56 58/88/56
f 56/89/57 37/77/57 36/90/57
f 55/91/58 61/81/58 56/89/58
f 54/92/59 60/80/59 55/91/59
f 79/93/60 58/84/60 80/86/60
f 52/94/61 58/88/61 53/95/61
f 76/96/62 36/90/62 41/97/62
f 75/98/63 56/89/63 76/96/63
f 75/98/64 54/92/64 55/91/64
f 73/99/65 79/93/65 83/100/65
f 73/101/66 52/94/66 53/95/66
f 71/102/67 41/97/67 40/103/67
f 70/104/68 76/96/68 71/102/68
f 70/104/69 74/105/69 75/98/69
f 68/106/70 83/100/70 82/107/70
f 67/108/71 73/101/71 68/109/71
f 51/110/72 40/103/72 35/111/72
f 50/112/73 71/102/73 51/110/73
f 49/113/74 70/104/74 50/112/74
f 78/114/75 68/106/75 82/107/75
f 47/115/76 68/109/76 48/116/76
f 42/65/77 35/111/77 33/66/77
f 43/70/78 51/110/78 42/65/78
f 44/69/79 50/112/79 43/70/79
f 45/72/80 78/114/80 77/73/80
f 46/117/81 48/116/81 45/75/81
f 44/69/82 78/114/82 49/113/82
f 49/113/83 82/107/83 69/118/83
f 82/107/84 74/105/84 69/118/84
f 83/100/85 54/92/85 74/105/85
f 79/93/86 59/119/86 54/92/86
f 80/86/87 64/82/87 59/119/87
f 64/120/88 77/73/88 44/69/88
f 35/12/89 40/62/89 25/13/89
f 7/2/90 36/32/90 37/15/90
f 35/12/91 26/14/91 17/19/91
f 25/13/92 40/62/92 39/29/92
f 38/30/93 16/23/93 12/10/93
f 8/5/94 41/63/94 36/32/94
f 38/30/95 33/20/95 17/19/95
f 26/34/31 25/38/31 13/37/31
f 22/40/33 32/52/33 31/41/33
f 6/43/34 11/47/34 28/44/34
f 15/46/34 29/50/34 28/44/34
f 21/42/35 31/41/35 30/48/35
f 20/49/36 30/48/36 29/50/36
f 39/29/96 41/63/96 8/5/96
f 38/64/47 66/68/47 42/65/47
f 65/67/48 43/70/48 42/65/48
f 65/67/49 64/120/49 44/69/49
f 81/71/50 63/121/50 45/72/50
f 62/74/51 46/117/51 45/75/51
f 37/77/52 61/81/52 66/78/52
f 60/80/53 65/83/53 66/78/53
f 60/80/54 59/119/54 64/82/54
f 58/84/55 63/122/55 81/85/55
f 57/87/56 62/74/56 63/76/56
f 56/89/57 61/81/57 37/77/57
f 55/91/58 60/80/58 61/81/58
f 54/92/59 59/119/59 60/80/59
f 79/93/60 53/123/60 58/84/60
f 52/94/61 57/87/61 58/88/61
f 76/96/62 56/89/62 36/90/62
f 75/98/63 55/91/63 56/89/63
f 75/98/64 74/105/64 54/92/64
f 73/99/65 53/123/65 79/93/65
f 73/101/66 72/124/66 52/94/66
f 71/102/67 76/96/67 41/97/67
f 70/104/68 75/98/68 76/96/68
f 70/104/69 69/118/69 74/105/69
f 68/106/70 73/99/70 83/100/70
f 67/108/71 72/124/71 73/101/71
f 51/110/72 71/102/72 40/103/72
f 50/112/73 70/104/73 71/102/73
f 49/113/74 69/118/74 70/104/74
f 78/114/75 48/125/75 68/106/75
f 47/115/76 67/108/76 68/109/76
f 42/65/77 51/110/77 35/111/77
f 43/70/78 50/112/78 51/110/78
f 44/69/79 49/113/79 50/112/79
f 45/72/80 48/125/80 78/114/80
f 46/117/81 47/115/81 48/116/81
f 44/69/82 77/73/82 78/114/82
f 49/113/83 78/114/83 82/107/83
f 82/107/84 83/100/84 74/105/84
f 83/100/85 79/93/85 54/92/85
f 79/93/86 80/86/86 59/119/86
f 80/86/87 81/85/87 64/82/87
f 64/120/88 81/71/88 77/73/88

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

View file

@ -15,7 +15,7 @@
* raymath.h - Vector and matrix math functions * raymath.h - Vector and matrix math functions
* *
* Compile example using: * Compile example using:
* gcc -o rlgl_standalone.exe rlgl_standalone.c rlgl.o -s $(RAYLIB_DIR)\raylib\raylib_icon -I$(RAYLIB_DIR)\raylib\src / * gcc -o rlgl_standalone.exe rlgl_standalone.c rlgl.o -s $(RAYLIB_DIR)\raylib\raylib.rc.o -I$(RAYLIB_DIR)\raylib\src /
* -L. -L$(RAYLIB_DIR)\raylib\src -lglfw3 -lopengl32 -lgdi32 -Wall -std=c99 * -L. -L$(RAYLIB_DIR)\raylib\src -lglfw3 -lopengl32 -lgdi32 -Wall -std=c99
* *
* This example has been created using raylib 1.7 (www.raylib.com) * This example has been created using raylib 1.7 (www.raylib.com)

View file

@ -7,7 +7,7 @@
* *
* Use the following line to compile: * Use the following line to compile:
* *
* gcc -o $(NAME_PART).exe $(FILE_NAME) -s $(RAYLIB_DIR)\raylib\raylib_icon -static -lraylib -lpthread * gcc -o $(NAME_PART).exe $(FILE_NAME) -s $(RAYLIB_DIR)\raylib\raylib.rc.o -static -lraylib -lpthread
* -lglfw3 -lopengl32 -lgdi32 -lopenal32 -lwinmm -std=c99 -Wl,--subsystem,windows -Wl,-allow-multiple-definition * -lglfw3 -lopengl32 -lgdi32 -lopenal32 -lwinmm -std=c99 -Wl,--subsystem,windows -Wl,-allow-multiple-definition
* *
* Copyright (c) 2016-2018 Victor Fisac * Copyright (c) 2016-2018 Victor Fisac

View file

@ -7,7 +7,7 @@
* *
* Use the following line to compile: * Use the following line to compile:
* *
* gcc -o $(NAME_PART).exe $(FILE_NAME) -s $(RAYLIB_DIR)\raylib\raylib_icon -static -lraylib -lpthread * gcc -o $(NAME_PART).exe $(FILE_NAME) -s $(RAYLIB_DIR)\raylib\raylib.rc.o -static -lraylib -lpthread
* -lglfw3 -lopengl32 -lgdi32 -lopenal32 -lwinmm -std=c99 -Wl,--subsystem,windows -Wl,-allow-multiple-definition * -lglfw3 -lopengl32 -lgdi32 -lopenal32 -lwinmm -std=c99 -Wl,--subsystem,windows -Wl,-allow-multiple-definition
* *
* Copyright (c) 2016-2018 Victor Fisac * Copyright (c) 2016-2018 Victor Fisac

View file

@ -7,7 +7,7 @@
* *
* Use the following line to compile: * Use the following line to compile:
* *
* gcc -o $(NAME_PART).exe $(FILE_NAME) -s $(RAYLIB_DIR)\raylib\raylib_icon -static -lraylib -lpthread * gcc -o $(NAME_PART).exe $(FILE_NAME) -s $(RAYLIB_DIR)\raylib\raylib.rc.o -static -lraylib -lpthread
* -lglfw3 -lopengl32 -lgdi32 -lopenal32 -lwinmm -std=c99 -Wl,--subsystem,windows -Wl,-allow-multiple-definition * -lglfw3 -lopengl32 -lgdi32 -lopenal32 -lwinmm -std=c99 -Wl,--subsystem,windows -Wl,-allow-multiple-definition
* *
* Copyright (c) 2016-2018 Victor Fisac * Copyright (c) 2016-2018 Victor Fisac

View file

@ -7,7 +7,7 @@
* *
* Use the following line to compile: * Use the following line to compile:
* *
* gcc -o $(NAME_PART).exe $(FILE_NAME) -s $(RAYLIB_DIR)\raylib\raylib_icon -static -lraylib -lpthread * gcc -o $(NAME_PART).exe $(FILE_NAME) -s $(RAYLIB_DIR)\raylib\raylib.rc.o -static -lraylib -lpthread
* -lglfw3 -lopengl32 -lgdi32 -lopenal32 -lwinmm -std=c99 -Wl,--subsystem,windows -Wl,-allow-multiple-definition * -lglfw3 -lopengl32 -lgdi32 -lopenal32 -lwinmm -std=c99 -Wl,--subsystem,windows -Wl,-allow-multiple-definition
* *
* Copyright (c) 2016-2018 Victor Fisac * Copyright (c) 2016-2018 Victor Fisac

View file

@ -7,7 +7,7 @@
* *
* Use the following line to compile: * Use the following line to compile:
* *
* gcc -o $(NAME_PART).exe $(FILE_NAME) -s $(RAYLIB_DIR)\raylib\raylib_icon -static -lraylib -lpthread * gcc -o $(NAME_PART).exe $(FILE_NAME) -s $(RAYLIB_DIR)\raylib\raylib.rc.o -static -lraylib -lpthread
* -lglfw3 -lopengl32 -lgdi32 -lopenal32 -lwinmm -std=c99 -Wl,--subsystem,windows -Wl,-allow-multiple-definition * -lglfw3 -lopengl32 -lgdi32 -lopenal32 -lwinmm -std=c99 -Wl,--subsystem,windows -Wl,-allow-multiple-definition
* *
* Copyright (c) 2016-2018 Victor Fisac * Copyright (c) 2016-2018 Victor Fisac

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 MiB

File diff suppressed because it is too large Load diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 KiB

File diff suppressed because it is too large Load diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 KiB

File diff suppressed because it is too large Load diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 437 KiB

View file

@ -31,15 +31,15 @@ int main()
// Define the camera to look into our 3d world // Define the camera to look into our 3d world
Camera camera = { 0 }; Camera camera = { 0 };
camera.position = (Vector3){ 3.0f, 3.0f, 3.0f }; camera.position = (Vector3){ 8.0f, 8.0f, 8.0f };
camera.target = (Vector3){ 0.0f, 1.5f, 0.0f }; camera.target = (Vector3){ 0.0f, 1.5f, 0.0f };
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; camera.up = (Vector3){ 0.0f, 1.0f, 0.0f };
camera.fovy = 45.0f; camera.fovy = 45.0f;
camera.type = CAMERA_PERSPECTIVE; camera.type = CAMERA_PERSPECTIVE;
Model dwarf = LoadModel("resources/model/dwarf.obj"); // Load OBJ model Model model = LoadModel("resources/models/barracks.obj"); // Load OBJ model
Texture2D texture = LoadTexture("resources/model/dwarf_diffuse.png"); // Load model texture (diffuse map) Texture2D texture = LoadTexture("resources/models/barracks_diffuse.png"); // Load model texture (diffuse map)
dwarf.material.maps[MAP_DIFFUSE].texture = texture; // Set dwarf model diffuse texture model.material.maps[MAP_DIFFUSE].texture = texture; // Set model diffuse texture
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position
@ -87,7 +87,7 @@ int main()
BeginMode3D(camera); BeginMode3D(camera);
DrawModel(dwarf, position, 2.0f, WHITE); // Draw 3d model with texture DrawModel(model, position, 0.5f, WHITE); // Draw 3d model with texture
DrawGrid(10, 1.0f); // Draw a grid DrawGrid(10, 1.0f); // Draw a grid
@ -104,8 +104,8 @@ int main()
EndShaderMode(); EndShaderMode();
DrawText("(c) Dwarf 3D model by David Moreno", screenWidth - 200, screenHeight - 20, 10, GRAY); DrawText("(c) Barracks 3D model by Alberto Cano", screenWidth - 220, screenHeight - 20, 10, GRAY);
DrawFPS(10, 10); DrawFPS(10, 10);
EndDrawing(); EndDrawing();
@ -116,7 +116,7 @@ int main()
//-------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------
UnloadShader(shader); // Unload shader UnloadShader(shader); // Unload shader
UnloadTexture(texture); // Unload texture UnloadTexture(texture); // Unload texture
UnloadModel(dwarf); // Unload model UnloadModel(model); // Unload model
UnloadRenderTexture(target); // Unload render texture UnloadRenderTexture(target); // Unload render texture
CloseWindow(); // Close window and OpenGL context CloseWindow(); // Close window and OpenGL context

Binary file not shown.

Before

Width:  |  Height:  |  Size: 252 KiB

After

Width:  |  Height:  |  Size: 324 KiB

Before After
Before After

View file

@ -31,19 +31,19 @@ int main()
// Define the camera to look into our 3d world // Define the camera to look into our 3d world
Camera camera = { 0 }; Camera camera = { 0 };
camera.position = (Vector3){ 3.0f, 3.0f, 3.0f }; camera.position = (Vector3){ 4.0f, 4.0f, 4.0f };
camera.target = (Vector3){ 0.0f, 1.5f, 0.0f }; camera.target = (Vector3){ 0.0f, 1.0f, -1.0f };
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; camera.up = (Vector3){ 0.0f, 1.0f, 0.0f };
camera.fovy = 45.0f; camera.fovy = 45.0f;
camera.type = CAMERA_PERSPECTIVE; camera.type = CAMERA_PERSPECTIVE;
Model dwarf = LoadModel("resources/model/dwarf.obj"); // Load OBJ model Model model = LoadModel("resources/models/watermill.obj"); // Load OBJ model
Texture2D texture = LoadTexture("resources/model/dwarf_diffuse.png"); // Load model texture Texture2D texture = LoadTexture("resources/models/watermill_diffuse.png"); // Load model texture
Shader shader = LoadShader("resources/shaders/glsl330/base.vs", Shader shader = LoadShader("resources/shaders/glsl330/base.vs",
"resources/shaders/glsl330/grayscale.fs"); // Load model shader "resources/shaders/glsl330/grayscale.fs"); // Load model shader
dwarf.material.shader = shader; // Set shader effect to 3d model model.material.shader = shader; // Set shader effect to 3d model
dwarf.material.maps[MAP_DIFFUSE].texture = texture; // Bind texture to model model.material.maps[MAP_DIFFUSE].texture = texture; // Bind texture to model
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position
@ -68,13 +68,13 @@ int main()
BeginMode3D(camera); BeginMode3D(camera);
DrawModel(dwarf, position, 2.0f, WHITE); // Draw 3d model with texture DrawModel(model, position, 0.2f, WHITE); // Draw 3d model with texture
DrawGrid(10, 1.0f); // Draw a grid DrawGrid(10, 1.0f); // Draw a grid
EndMode3D(); EndMode3D();
DrawText("(c) Dwarf 3D model by David Moreno", screenWidth - 200, screenHeight - 20, 10, GRAY); DrawText("(c) Watermill 3D model by Alberto Cano", screenWidth - 210, screenHeight - 20, 10, GRAY);
DrawText(FormatText("Camera position: (%.2f, %.2f, %.2f)", camera.position.x, camera.position.y, camera.position.z), 600, 20, 10, BLACK); DrawText(FormatText("Camera position: (%.2f, %.2f, %.2f)", camera.position.x, camera.position.y, camera.position.z), 600, 20, 10, BLACK);
DrawText(FormatText("Camera target: (%.2f, %.2f, %.2f)", camera.target.x, camera.target.y, camera.target.z), 600, 40, 10, GRAY); DrawText(FormatText("Camera target: (%.2f, %.2f, %.2f)", camera.target.x, camera.target.y, camera.target.z), 600, 40, 10, GRAY);
@ -89,7 +89,7 @@ int main()
//-------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------
UnloadShader(shader); // Unload shader UnloadShader(shader); // Unload shader
UnloadTexture(texture); // Unload texture UnloadTexture(texture); // Unload texture
UnloadModel(dwarf); // Unload model UnloadModel(model); // Unload model
CloseWindow(); // Close window and OpenGL context CloseWindow(); // Close window and OpenGL context
//-------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 KiB

After

Width:  |  Height:  |  Size: 214 KiB

Before After
Before After

View file

@ -70,13 +70,13 @@ int main()
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - postprocessing shader"); InitWindow(screenWidth, screenHeight, "raylib [shaders] example - postprocessing shader");
// Define the camera to look into our 3d world // Define the camera to look into our 3d world
Camera camera = {{ 3.0f, 3.0f, 3.0f }, { 0.0f, 1.5f, 0.0f }, { 0.0f, 1.0f, 0.0f }, 45.0f, 0 }; Camera camera = {{ 2.0f, 3.0f, 2.0f }, { 0.0f, 1.0f, 0.0f }, { 0.0f, 1.0f, 0.0f }, 45.0f, 0 };
Model dwarf = LoadModel("resources/model/dwarf.obj"); // Load OBJ model Model model = LoadModel("resources/models/church.obj"); // Load OBJ model
Texture2D texture = LoadTexture("resources/model/dwarf_diffuse.png"); // Load model texture (diffuse map) Texture2D texture = LoadTexture("resources/models/church_diffuse.png"); // Load model texture (diffuse map)
dwarf.material.maps[MAP_DIFFUSE].texture = texture; // Set dwarf model diffuse texture model.material.maps[MAP_DIFFUSE].texture = texture; // Set model diffuse texture
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position
// Load all postpro shaders // Load all postpro shaders
// NOTE 1: All postpro shader use the base vertex shader (DEFAULT_VERTEX_SHADER) // NOTE 1: All postpro shader use the base vertex shader (DEFAULT_VERTEX_SHADER)
@ -132,7 +132,7 @@ int main()
BeginMode3D(camera); BeginMode3D(camera);
DrawModel(dwarf, position, 2.0f, WHITE); // Draw 3d model with texture DrawModel(model, position, 0.1f, WHITE); // Draw 3d model with texture
DrawGrid(10, 1.0f); // Draw a grid DrawGrid(10, 1.0f); // Draw a grid
@ -150,7 +150,7 @@ int main()
DrawRectangle(0, 9, 580, 30, Fade(LIGHTGRAY, 0.7f)); DrawRectangle(0, 9, 580, 30, Fade(LIGHTGRAY, 0.7f));
DrawText("(c) Dwarf 3D model by David Moreno", screenWidth - 200, screenHeight - 20, 10, DARKGRAY); DrawText("(c) Church 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, GRAY);
DrawText("CURRENT POSTPRO SHADER:", 10, 15, 20, BLACK); DrawText("CURRENT POSTPRO SHADER:", 10, 15, 20, BLACK);
DrawText(postproShaderText[currentShader], 330, 15, 20, RED); DrawText(postproShaderText[currentShader], 330, 15, 20, RED);
@ -169,7 +169,7 @@ int main()
for (int i = 0; i < MAX_POSTPRO_SHADERS; i++) UnloadShader(shaders[i]); for (int i = 0; i < MAX_POSTPRO_SHADERS; i++) UnloadShader(shaders[i]);
UnloadTexture(texture); // Unload texture UnloadTexture(texture); // Unload texture
UnloadModel(dwarf); // Unload model UnloadModel(model); // Unload model
UnloadRenderTexture(target); // Unload render texture UnloadRenderTexture(target); // Unload render texture
CloseWindow(); // Close window and OpenGL context CloseWindow(); // Close window and OpenGL context

Binary file not shown.

Before

Width:  |  Height:  |  Size: 189 KiB

After

Width:  |  Height:  |  Size: 139 KiB

Before After
Before After

View file

@ -21,7 +21,7 @@ int main()
InitWindow(screenWidth, screenHeight, "raylib [texture] example - image text drawing"); InitWindow(screenWidth, screenHeight, "raylib [texture] example - image text drawing");
// TTF Font loading with custom generation parameters // TTF Font loading with custom generation parameters
Font font = LoadFontEx("resources/KAISG.ttf", 64, 0, 0); Font font = LoadFontEx("resources/KAISG.ttf", 64, 95, 0);
Image parrots = LoadImage("resources/parrots.png"); // Load image in CPU memory (RAM) Image parrots = LoadImage("resources/parrots.png"); // Load image in CPU memory (RAM)

View file

@ -27,7 +27,7 @@ int main()
Texture2D scarfy = LoadTexture("resources/scarfy.png"); // Texture loading Texture2D scarfy = LoadTexture("resources/scarfy.png"); // Texture loading
Vector2 position = { 350.0f, 280.0f }; Vector2 position = { 350.0f, 280.0f };
Rectangle frameRec = { 0, 0, scarfy.width/6, scarfy.height }; Rectangle frameRec = { 0.0f, 0.0f, (float)scarfy.width/6, (float)scarfy.height };
int currentFrame = 0; int currentFrame = 0;
int framesCounter = 0; int framesCounter = 0;
@ -50,7 +50,7 @@ int main()
if (currentFrame > 5) currentFrame = 0; if (currentFrame > 5) currentFrame = 0;
frameRec.x = currentFrame*scarfy.width/6; frameRec.x = (float)currentFrame*(float)scarfy.width/6;
} }
if (IsKeyPressed(KEY_RIGHT)) framesSpeed++; if (IsKeyPressed(KEY_RIGHT)) framesSpeed++;

View file

@ -59,7 +59,16 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
PLATFORM_OS=LINUX PLATFORM_OS=LINUX
endif endif
ifeq ($(UNAMEOS),FreeBSD) ifeq ($(UNAMEOS),FreeBSD)
PLATFORM_OS=FREEBSD PLATFORM_OS=BSD
endif
ifeq ($(UNAMEOS),OpenBSD)
PLATFORM_OS=BSD
endif
ifeq ($(UNAMEOS),NetBSD)
PLATFORM_OS=BSD
endif
ifeq ($(UNAMEOS),DragonFly)
PLATFORM_OS=BSD
endif endif
ifeq ($(UNAMEOS),Darwin) ifeq ($(UNAMEOS),Darwin)
PLATFORM_OS=OSX PLATFORM_OS=OSX
@ -97,8 +106,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),OSX) ifeq ($(PLATFORM_OS),OSX)
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx
endif endif
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/freebsd RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/bsd
endif endif
endif endif
ifeq ($(PLATFORM),PLATFORM_RPI) ifeq ($(PLATFORM),PLATFORM_RPI)
@ -117,8 +126,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# OSX default compiler # OSX default compiler
CC = clang CC = clang
endif endif
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
# FreeBSD default compiler # FreeBSD, OpenBSD, NetBSD, DragonFly default compiler
CC = clang CC = clang
endif endif
endif endif
@ -160,7 +169,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS) ifeq ($(PLATFORM_OS),WINDOWS)
# resources file contains windows exe icon # resources file contains windows exe icon
# -Wl,--subsystem,windows hides the console window # -Wl,--subsystem,windows hides the console window
CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows CFLAGS += $(RAYLIB_PATH)/src/raylib.rc.o -Wl,--subsystem,windows
endif endif
ifeq ($(PLATFORM_OS),LINUX) ifeq ($(PLATFORM_OS),LINUX)
CFLAGS += -D_DEFAULT_SOURCE CFLAGS += -D_DEFAULT_SOURCE
@ -200,7 +209,7 @@ endif
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
INCLUDE_PATHS += -I/usr/local/include INCLUDE_PATHS += -I/usr/local/include
LDFLAGS += -L. -Lsrc -L/usr/local/lib LDFLAGS += -L. -Lsrc -L/usr/local/lib
endif endif
@ -237,8 +246,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# NOTE: Required packages: libopenal-dev libegl1-mesa-dev # NOTE: Required packages: libopenal-dev libegl1-mesa-dev
LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa
endif endif
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
# Libraries for FreeBSD desktop compiling # Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling
# NOTE: Required packages: mesa-libs # NOTE: Required packages: mesa-libs
LDLIBS = -lraylib -lGL -lpthread -lm LDLIBS = -lraylib -lGL -lpthread -lm

View file

@ -59,7 +59,16 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
PLATFORM_OS=LINUX PLATFORM_OS=LINUX
endif endif
ifeq ($(UNAMEOS),FreeBSD) ifeq ($(UNAMEOS),FreeBSD)
PLATFORM_OS=FREEBSD PLATFORM_OS=BSD
endif
ifeq ($(UNAMEOS),OpenBSD)
PLATFORM_OS=BSD
endif
ifeq ($(UNAMEOS),NetBSD)
PLATFORM_OS=BSD
endif
ifeq ($(UNAMEOS),DragonFly)
PLATFORM_OS=BSD
endif endif
ifeq ($(UNAMEOS),Darwin) ifeq ($(UNAMEOS),Darwin)
PLATFORM_OS=OSX PLATFORM_OS=OSX
@ -97,8 +106,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),OSX) ifeq ($(PLATFORM_OS),OSX)
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx
endif endif
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/freebsd RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/bsd
endif endif
endif endif
ifeq ($(PLATFORM),PLATFORM_RPI) ifeq ($(PLATFORM),PLATFORM_RPI)
@ -117,8 +126,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# OSX default compiler # OSX default compiler
CC = clang CC = clang
endif endif
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
# FreeBSD default compiler # FreeBSD, OpenBSD, NetBSD, DragonFly default compiler
CC = clang CC = clang
endif endif
endif endif
@ -160,7 +169,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS) ifeq ($(PLATFORM_OS),WINDOWS)
# resources file contains windows exe icon # resources file contains windows exe icon
# -Wl,--subsystem,windows hides the console window # -Wl,--subsystem,windows hides the console window
CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows CFLAGS += $(RAYLIB_PATH)/src/raylib.rc.o -Wl,--subsystem,windows
endif endif
ifeq ($(PLATFORM_OS),LINUX) ifeq ($(PLATFORM_OS),LINUX)
CFLAGS += -D_DEFAULT_SOURCE CFLAGS += -D_DEFAULT_SOURCE
@ -200,7 +209,7 @@ endif
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
INCLUDE_PATHS += -I/usr/local/include INCLUDE_PATHS += -I/usr/local/include
LDFLAGS += -L. -Lsrc -L/usr/local/lib LDFLAGS += -L. -Lsrc -L/usr/local/lib
endif endif
@ -237,8 +246,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# NOTE: Required packages: libopenal-dev libegl1-mesa-dev # NOTE: Required packages: libopenal-dev libegl1-mesa-dev
LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa
endif endif
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
# Libraries for FreeBSD desktop compiling # Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling
# NOTE: Required packages: mesa-libs # NOTE: Required packages: mesa-libs
LDLIBS = -lraylib -lGL -lpthread -lm LDLIBS = -lraylib -lGL -lpthread -lm

View file

@ -59,7 +59,16 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
PLATFORM_OS=LINUX PLATFORM_OS=LINUX
endif endif
ifeq ($(UNAMEOS),FreeBSD) ifeq ($(UNAMEOS),FreeBSD)
PLATFORM_OS=FREEBSD PLATFORM_OS=BSD
endif
ifeq ($(UNAMEOS),OpenBSD)
PLATFORM_OS=BSD
endif
ifeq ($(UNAMEOS),NetBSD)
PLATFORM_OS=BSD
endif
ifeq ($(UNAMEOS),DragonFly)
PLATFORM_OS=BSD
endif endif
ifeq ($(UNAMEOS),Darwin) ifeq ($(UNAMEOS),Darwin)
PLATFORM_OS=OSX PLATFORM_OS=OSX
@ -97,8 +106,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),OSX) ifeq ($(PLATFORM_OS),OSX)
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx
endif endif
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/freebsd RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/bsd
endif endif
endif endif
ifeq ($(PLATFORM),PLATFORM_RPI) ifeq ($(PLATFORM),PLATFORM_RPI)
@ -117,8 +126,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# OSX default compiler # OSX default compiler
CC = clang CC = clang
endif endif
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
# FreeBSD default compiler # FreeBSD, OpenBSD, NetBSD, DragonFly default compiler
CC = clang CC = clang
endif endif
endif endif
@ -160,7 +169,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS) ifeq ($(PLATFORM_OS),WINDOWS)
# resources file contains windows exe icon # resources file contains windows exe icon
# -Wl,--subsystem,windows hides the console window # -Wl,--subsystem,windows hides the console window
CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows CFLAGS += $(RAYLIB_PATH)/src/raylib.rc.o -Wl,--subsystem,windows
endif endif
ifeq ($(PLATFORM_OS),LINUX) ifeq ($(PLATFORM_OS),LINUX)
CFLAGS += -D_DEFAULT_SOURCE CFLAGS += -D_DEFAULT_SOURCE
@ -200,7 +209,7 @@ endif
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
INCLUDE_PATHS += -I/usr/local/include INCLUDE_PATHS += -I/usr/local/include
LDFLAGS += -L. -Lsrc -L/usr/local/lib LDFLAGS += -L. -Lsrc -L/usr/local/lib
endif endif
@ -237,7 +246,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# NOTE: Required packages: libopenal-dev libegl1-mesa-dev # NOTE: Required packages: libopenal-dev libegl1-mesa-dev
LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa
endif endif
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
# Libraries for FreeBSD desktop compiling # Libraries for FreeBSD desktop compiling
# NOTE: Required packages: mesa-libs # NOTE: Required packages: mesa-libs
LDLIBS = -lraylib -lGL -lpthread -lm LDLIBS = -lraylib -lGL -lpthread -lm

View file

@ -59,7 +59,16 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
PLATFORM_OS=LINUX PLATFORM_OS=LINUX
endif endif
ifeq ($(UNAMEOS),FreeBSD) ifeq ($(UNAMEOS),FreeBSD)
PLATFORM_OS=FREEBSD PLATFORM_OS=BSD
endif
ifeq ($(UNAMEOS),OpenBSD)
PLATFORM_OS=BSD
endif
ifeq ($(UNAMEOS),NetBSD)
PLATFORM_OS=BSD
endif
ifeq ($(UNAMEOS),DragonFly)
PLATFORM_OS=BSD
endif endif
ifeq ($(UNAMEOS),Darwin) ifeq ($(UNAMEOS),Darwin)
PLATFORM_OS=OSX PLATFORM_OS=OSX
@ -97,8 +106,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),OSX) ifeq ($(PLATFORM_OS),OSX)
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx
endif endif
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/freebsd RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/bsd
endif endif
endif endif
ifeq ($(PLATFORM),PLATFORM_RPI) ifeq ($(PLATFORM),PLATFORM_RPI)
@ -117,8 +126,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# OSX default compiler # OSX default compiler
CC = clang CC = clang
endif endif
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
# FreeBSD default compiler # FreeBSD, OpenBSD, NetBSD, DragonFly default compiler
CC = clang CC = clang
endif endif
endif endif
@ -160,7 +169,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS) ifeq ($(PLATFORM_OS),WINDOWS)
# resources file contains windows exe icon # resources file contains windows exe icon
# -Wl,--subsystem,windows hides the console window # -Wl,--subsystem,windows hides the console window
CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows CFLAGS += $(RAYLIB_PATH)/src/raylib.rc.o -Wl,--subsystem,windows
endif endif
ifeq ($(PLATFORM_OS),LINUX) ifeq ($(PLATFORM_OS),LINUX)
CFLAGS += -D_DEFAULT_SOURCE CFLAGS += -D_DEFAULT_SOURCE
@ -200,7 +209,7 @@ endif
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
INCLUDE_PATHS += -I/usr/local/include INCLUDE_PATHS += -I/usr/local/include
LDFLAGS += -L. -Lsrc -L/usr/local/lib LDFLAGS += -L. -Lsrc -L/usr/local/lib
endif endif
@ -237,8 +246,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# NOTE: Required packages: libopenal-dev libegl1-mesa-dev # NOTE: Required packages: libopenal-dev libegl1-mesa-dev
LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa
endif endif
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
# Libraries for FreeBSD desktop compiling # Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling
# NOTE: Required packages: mesa-libs # NOTE: Required packages: mesa-libs
LDLIBS = -lraylib -lGL -lpthread -lm LDLIBS = -lraylib -lGL -lpthread -lm

View file

@ -59,7 +59,16 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
PLATFORM_OS=LINUX PLATFORM_OS=LINUX
endif endif
ifeq ($(UNAMEOS),FreeBSD) ifeq ($(UNAMEOS),FreeBSD)
PLATFORM_OS=FREEBSD PLATFORM_OS=BSD
endif
ifeq ($(UNAMEOS),OpenBSD)
PLATFORM_OS=BSD
endif
ifeq ($(UNAMEOS),NetBSD)
PLATFORM_OS=BSD
endif
ifeq ($(UNAMEOS),DragonFly)
PLATFORM_OS=BSD
endif endif
ifeq ($(UNAMEOS),Darwin) ifeq ($(UNAMEOS),Darwin)
PLATFORM_OS=OSX PLATFORM_OS=OSX
@ -97,8 +106,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),OSX) ifeq ($(PLATFORM_OS),OSX)
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx
endif endif
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/freebsd RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/bsd
endif endif
endif endif
ifeq ($(PLATFORM),PLATFORM_RPI) ifeq ($(PLATFORM),PLATFORM_RPI)
@ -117,8 +126,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# OSX default compiler # OSX default compiler
CC = clang CC = clang
endif endif
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
# FreeBSD default compiler # FreeBSD, OpenBSD, NetBSD, DragonFly default compiler
CC = clang CC = clang
endif endif
endif endif
@ -160,7 +169,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS) ifeq ($(PLATFORM_OS),WINDOWS)
# resources file contains windows exe icon # resources file contains windows exe icon
# -Wl,--subsystem,windows hides the console window # -Wl,--subsystem,windows hides the console window
CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows CFLAGS += $(RAYLIB_PATH)/src/raylib.rc.o -Wl,--subsystem,windows
endif endif
ifeq ($(PLATFORM_OS),LINUX) ifeq ($(PLATFORM_OS),LINUX)
CFLAGS += -D_DEFAULT_SOURCE CFLAGS += -D_DEFAULT_SOURCE
@ -200,7 +209,7 @@ endif
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
INCLUDE_PATHS += -I/usr/local/include INCLUDE_PATHS += -I/usr/local/include
LDFLAGS += -L. -Lsrc -L/usr/local/lib LDFLAGS += -L. -Lsrc -L/usr/local/lib
endif endif
@ -237,8 +246,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# NOTE: Required packages: libopenal-dev libegl1-mesa-dev # NOTE: Required packages: libopenal-dev libegl1-mesa-dev
LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa
endif endif
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
# Libraries for FreeBSD desktop compiling # Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling
# NOTE: Required packages: mesa-libs # NOTE: Required packages: mesa-libs
LDLIBS = -lraylib -lGL -lpthread -lm LDLIBS = -lraylib -lGL -lpthread -lm

View file

@ -609,19 +609,11 @@ void DrawGameplayScreen(void)
{ {
//if (lightsIII[i].active) DrawCircleV(lightsIII[i].position, lightsIII[i].radius, GOLD); //if (lightsIII[i].active) DrawCircleV(lightsIII[i].position, lightsIII[i].radius, GOLD);
//else DrawCircleLines(lightsIII[i].position.x, lightsIII[i].position.y, lightsIII[i].radius, GRAY); //else DrawCircleLines(lightsIII[i].position.x, lightsIII[i].position.y, lightsIII[i].radius, GRAY);
DrawTextureRec(texLight, lightsIII[i].frameRec, (Vector2){ lightsIII[i].position.x - 32, lightsIII[i].position.y - 32 }, WHITE);
if (lightsIII[i].active)
{
DrawTextureRec(texLight, lightsIII[i].frameRec, (Vector2){ lightsIII[i].position.x - 32, lightsIII[i].position.y - 32 }, WHITE);
DrawTexture(lightGlow, lightsIII[i].position.x - lightGlow.width/2, lightsIII[i].position.y - lightGlow.height/2, Fade(WHITE, 0.3f));
DrawText(FormatText("%02i", lightsIII[i].requiredEnergy), lightsIII[i].position.x - 10, lightsIII[i].position.y + 14, 20, GRAY);
}
else
{
DrawTextureRec(texLight, lightsIII[i].frameRec, (Vector2){ lightsIII[i].position.x - 32, lightsIII[i].position.y - 32 }, WHITE);
DrawText(FormatText("%02i", lightsIII[i].requiredEnergy), lightsIII[i].position.x - 10, lightsIII[i].position.y + 14, 20, YELLOW);
}
} }
for (int i = 0; i < MAX_LIGHTS_III; i++) if (lightsIII[i].active) DrawTexture(lightGlow, lightsIII[i].position.x - lightGlow.width/2, lightsIII[i].position.y - lightGlow.height/2, Fade(WHITE, 0.3f));
for (int i = 0; i < MAX_LIGHTS_III; i++) DrawText(FormatText("%02i", lightsIII[i].requiredEnergy), lightsIII[i].position.x - 10, lightsIII[i].position.y + 14, 20, lightsIII[i].active ? GRAY : YELLOW);
} }
case LEVEL_II: case LEVEL_II:
{ {
@ -629,19 +621,11 @@ void DrawGameplayScreen(void)
{ {
//if (lightsII[i].active) DrawCircleV(lightsII[i].position, lightsII[i].radius, GOLD); //if (lightsII[i].active) DrawCircleV(lightsII[i].position, lightsII[i].radius, GOLD);
//else DrawCircleLines(lightsI[i].position.x, lightsI[i].position.y, lightsI[i].radius, GRAY); //else DrawCircleLines(lightsI[i].position.x, lightsI[i].position.y, lightsI[i].radius, GRAY);
DrawTextureRec(texLight, lightsII[i].frameRec, (Vector2){ lightsII[i].position.x - 32, lightsII[i].position.y - 32 }, WHITE);
if (lightsII[i].active)
{
DrawTextureRec(texLight, lightsII[i].frameRec, (Vector2){ lightsII[i].position.x - 32, lightsII[i].position.y - 32 }, WHITE);
DrawTexture(lightGlow, lightsII[i].position.x - lightGlow.width/2, lightsII[i].position.y - lightGlow.height/2, Fade(WHITE, 0.3f));
DrawText(FormatText("%02i", lightsII[i].requiredEnergy), lightsII[i].position.x - 10, lightsII[i].position.y + 14, 20, GRAY);
}
else
{
DrawTextureRec(texLight, lightsII[i].frameRec, (Vector2){ lightsII[i].position.x - 32, lightsII[i].position.y - 32 }, WHITE);
DrawText(FormatText("%02i", lightsII[i].requiredEnergy), lightsII[i].position.x - 10, lightsII[i].position.y + 14, 20, YELLOW);
}
} }
for (int i = 0; i < MAX_LIGHTS_II; i++) if (lightsII[i].active) DrawTexture(lightGlow, lightsII[i].position.x - lightGlow.width/2, lightsII[i].position.y - lightGlow.height/2, Fade(WHITE, 0.3f));
for (int i = 0; i < MAX_LIGHTS_II; i++) DrawText(FormatText("%02i", lightsII[i].requiredEnergy), lightsII[i].position.x - 10, lightsII[i].position.y + 14, 20, lightsII[i].active ? GRAY : YELLOW);
} }
case LEVEL_I: case LEVEL_I:
{ {
@ -649,19 +633,11 @@ void DrawGameplayScreen(void)
{ {
//if (lightsI[i].active) DrawCircleV(lightsI[i].position, lightsI[i].radius, GOLD); //if (lightsI[i].active) DrawCircleV(lightsI[i].position, lightsI[i].radius, GOLD);
//else DrawCircleLines(lightsI[i].position.x, lightsI[i].position.y, lightsI[i].radius, GRAY); //else DrawCircleLines(lightsI[i].position.x, lightsI[i].position.y, lightsI[i].radius, GRAY);
DrawTextureRec(texLight, lightsI[i].frameRec, (Vector2){ lightsI[i].position.x - 32, lightsI[i].position.y - 32 }, WHITE);
if (lightsI[i].active)
{
DrawTextureRec(texLight, lightsI[i].frameRec, (Vector2){ lightsI[i].position.x - 32, lightsI[i].position.y - 32 }, WHITE);
DrawTexture(lightGlow, lightsI[i].position.x - lightGlow.width/2, lightsI[i].position.y - lightGlow.height/2, Fade(WHITE, 0.3f));
DrawText(FormatText("%02i", lightsI[i].requiredEnergy), lightsI[i].position.x - 10, lightsI[i].position.y + 14, 20, GRAY);
}
else
{
DrawTextureRec(texLight, lightsI[i].frameRec, (Vector2){ lightsI[i].position.x - 32, lightsI[i].position.y - 32 }, WHITE);
DrawText(FormatText("%02i", lightsI[i].requiredEnergy), lightsI[i].position.x - 10, lightsI[i].position.y + 14, 20, YELLOW);
}
} }
for (int i = 0; i < MAX_LIGHTS_I; i++) if (lightsI[i].active) DrawTexture(lightGlow, lightsI[i].position.x - lightGlow.width/2, lightsI[i].position.y - lightGlow.height/2, Fade(WHITE, 0.3f));
for (int i = 0; i < MAX_LIGHTS_I; i++) DrawText(FormatText("%02i", lightsI[i].requiredEnergy), lightsI[i].position.x - 10, lightsI[i].position.y + 14, 20, lightsI[i].active ? GRAY : YELLOW);
} }
default: break; default: break;
} }

View file

@ -59,7 +59,16 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
PLATFORM_OS=LINUX PLATFORM_OS=LINUX
endif endif
ifeq ($(UNAMEOS),FreeBSD) ifeq ($(UNAMEOS),FreeBSD)
PLATFORM_OS=FREEBSD PLATFORM_OS=BSD
endif
ifeq ($(UNAMEOS),OpenBSD)
PLATFORM_OS=BSD
endif
ifeq ($(UNAMEOS),NetBSD)
PLATFORM_OS=BSD
endif
ifeq ($(UNAMEOS),DragonFly)
PLATFORM_OS=BSD
endif endif
ifeq ($(UNAMEOS),Darwin) ifeq ($(UNAMEOS),Darwin)
PLATFORM_OS=OSX PLATFORM_OS=OSX
@ -97,8 +106,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),OSX) ifeq ($(PLATFORM_OS),OSX)
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx
endif endif
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/freebsd RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/bsd
endif endif
endif endif
ifeq ($(PLATFORM),PLATFORM_RPI) ifeq ($(PLATFORM),PLATFORM_RPI)
@ -117,8 +126,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# OSX default compiler # OSX default compiler
CC = clang CC = clang
endif endif
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
# FreeBSD default compiler # FreeBSD, OpenBSD, NetBSD, DragonFly default compiler
CC = clang CC = clang
endif endif
endif endif
@ -160,7 +169,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS) ifeq ($(PLATFORM_OS),WINDOWS)
# resources file contains windows exe icon # resources file contains windows exe icon
# -Wl,--subsystem,windows hides the console window # -Wl,--subsystem,windows hides the console window
CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows CFLAGS += $(RAYLIB_PATH)/src/raylib.rc.o -Wl,--subsystem,windows
endif endif
ifeq ($(PLATFORM_OS),LINUX) ifeq ($(PLATFORM_OS),LINUX)
CFLAGS += -D_DEFAULT_SOURCE CFLAGS += -D_DEFAULT_SOURCE
@ -200,7 +209,7 @@ endif
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
INCLUDE_PATHS += -I/usr/local/include INCLUDE_PATHS += -I/usr/local/include
LDFLAGS += -L. -Lsrc -L/usr/local/lib LDFLAGS += -L. -Lsrc -L/usr/local/lib
endif endif
@ -237,8 +246,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# NOTE: Required packages: libopenal-dev libegl1-mesa-dev # NOTE: Required packages: libopenal-dev libegl1-mesa-dev
LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa
endif endif
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
# Libraries for FreeBSD desktop compiling # Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling
# NOTE: Required packages: mesa-libs # NOTE: Required packages: mesa-libs
LDLIBS = -lraylib -lGL -lpthread -lm LDLIBS = -lraylib -lGL -lpthread -lm

View file

@ -59,7 +59,16 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
PLATFORM_OS=LINUX PLATFORM_OS=LINUX
endif endif
ifeq ($(UNAMEOS),FreeBSD) ifeq ($(UNAMEOS),FreeBSD)
PLATFORM_OS=FREEBSD PLATFORM_OS=BSD
endif
ifeq ($(UNAMEOS),OpenBSD)
PLATFORM_OS=BSD
endif
ifeq ($(UNAMEOS),NetBSD)
PLATFORM_OS=BSD
endif
ifeq ($(UNAMEOS),DragonFly)
PLATFORM_OS=BSD
endif endif
ifeq ($(UNAMEOS),Darwin) ifeq ($(UNAMEOS),Darwin)
PLATFORM_OS=OSX PLATFORM_OS=OSX
@ -97,8 +106,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),OSX) ifeq ($(PLATFORM_OS),OSX)
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx
endif endif
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/freebsd RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/bsd
endif endif
endif endif
ifeq ($(PLATFORM),PLATFORM_RPI) ifeq ($(PLATFORM),PLATFORM_RPI)
@ -117,8 +126,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# OSX default compiler # OSX default compiler
CC = clang CC = clang
endif endif
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
# FreeBSD default compiler # FreeBSD, OpenBSD, NetBSD, DragonFly default compiler
CC = clang CC = clang
endif endif
endif endif
@ -160,7 +169,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS) ifeq ($(PLATFORM_OS),WINDOWS)
# resources file contains windows exe icon # resources file contains windows exe icon
# -Wl,--subsystem,windows hides the console window # -Wl,--subsystem,windows hides the console window
CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows CFLAGS += $(RAYLIB_PATH)/src/raylib.rc.o -Wl,--subsystem,windows
endif endif
ifeq ($(PLATFORM_OS),LINUX) ifeq ($(PLATFORM_OS),LINUX)
CFLAGS += -D_DEFAULT_SOURCE CFLAGS += -D_DEFAULT_SOURCE
@ -200,7 +209,7 @@ endif
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
INCLUDE_PATHS += -I/usr/local/include INCLUDE_PATHS += -I/usr/local/include
LDFLAGS += -L. -Lsrc -L/usr/local/lib LDFLAGS += -L. -Lsrc -L/usr/local/lib
endif endif
@ -237,8 +246,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# NOTE: Required packages: libopenal-dev libegl1-mesa-dev # NOTE: Required packages: libopenal-dev libegl1-mesa-dev
LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa
endif endif
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
# Libraries for FreeBSD desktop compiling # Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling
# NOTE: Required packages: mesa-libs # NOTE: Required packages: mesa-libs
LDLIBS = -lraylib -lGL -lpthread -lm LDLIBS = -lraylib -lGL -lpthread -lm

View file

@ -59,7 +59,16 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
PLATFORM_OS=LINUX PLATFORM_OS=LINUX
endif endif
ifeq ($(UNAMEOS),FreeBSD) ifeq ($(UNAMEOS),FreeBSD)
PLATFORM_OS=FREEBSD PLATFORM_OS=BSD
endif
ifeq ($(UNAMEOS),OpenBSD)
PLATFORM_OS=BSD
endif
ifeq ($(UNAMEOS),NetBSD)
PLATFORM_OS=BSD
endif
ifeq ($(UNAMEOS),DragonFly)
PLATFORM_OS=BSD
endif endif
ifeq ($(UNAMEOS),Darwin) ifeq ($(UNAMEOS),Darwin)
PLATFORM_OS=OSX PLATFORM_OS=OSX
@ -97,8 +106,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),OSX) ifeq ($(PLATFORM_OS),OSX)
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx
endif endif
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/freebsd RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/bsd
endif endif
endif endif
ifeq ($(PLATFORM),PLATFORM_RPI) ifeq ($(PLATFORM),PLATFORM_RPI)
@ -117,8 +126,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# OSX default compiler # OSX default compiler
CC = clang CC = clang
endif endif
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
# FreeBSD default compiler # FreeBSD, OpenBSD, NetBSD, DragonFly default compiler
CC = clang CC = clang
endif endif
endif endif
@ -160,7 +169,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS) ifeq ($(PLATFORM_OS),WINDOWS)
# resources file contains windows exe icon # resources file contains windows exe icon
# -Wl,--subsystem,windows hides the console window # -Wl,--subsystem,windows hides the console window
CFLAGS += $(RAYLIB_PATH)/src/raylib_icon -Wl,--subsystem,windows CFLAGS += $(RAYLIB_PATH)/src/raylib.rc.o -Wl,--subsystem,windows
endif endif
ifeq ($(PLATFORM_OS),LINUX) ifeq ($(PLATFORM_OS),LINUX)
CFLAGS += -D_DEFAULT_SOURCE CFLAGS += -D_DEFAULT_SOURCE
@ -200,7 +209,7 @@ endif
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
INCLUDE_PATHS += -I/usr/local/include INCLUDE_PATHS += -I/usr/local/include
LDFLAGS += -L. -Lsrc -L/usr/local/lib LDFLAGS += -L. -Lsrc -L/usr/local/lib
endif endif
@ -237,7 +246,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# NOTE: Required packages: libopenal-dev libegl1-mesa-dev # NOTE: Required packages: libopenal-dev libegl1-mesa-dev
LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa
endif endif
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
# Libraries for FreeBSD desktop compiling # Libraries for FreeBSD desktop compiling
# NOTE: Required packages: mesa-libs # NOTE: Required packages: mesa-libs
LDLIBS = -lraylib -lGL -lpthread -lm LDLIBS = -lraylib -lGL -lpthread -lm

Binary file not shown.

Binary file not shown.

Binary file not shown.

16
projects/README.md Normal file
View file

@ -0,0 +1,16 @@
## raylib PROJECT TEMPLATES
This folder contains raylib templates for some common IDEs.
IDE | Platform | Template type | State
----| ---------| ------------- | -----
[Builder](https://wiki.gnome.org/Apps/Builder) | Linux | example compiling | DONE
[CodeBlocks](http://www.codeblocks.org/) | Linux, Windows | - | INCOMPLETE
[Geany](https://www.geany.org/) | Linux, Windows | - | INCOMPLETE
[KDevelop](https://www.kdevelop.org/) | Linux, Windows, macOS | - | INCOMPLETE
[Notepad++](https://notepad-plus-plus.org/) | Windows | source/example compiling | DONE
[VS2015](https://www.visualstudio.com) | Windows | source/example compiling | DONE
[VS2017](https://www.visualstudio.com) | Windows | source/example compiling | DONE
[VSCode](https://code.visualstudio.com/) | Windows | - | INCOMPLETE
*New IDEs config files are welcome!*

View file

@ -9,5 +9,5 @@ URL: http://github.com/raysan5/raylib
Version: @PROJECT_VERSION@ Version: @PROJECT_VERSION@
Libs: -L${libdir} -lraylib Libs: -L${libdir} -lraylib
Libs.private: @PKG_CONFIG_LIBS_PRIVATE@ Libs.private: @PKG_CONFIG_LIBS_PRIVATE@
Requires.private: Requires.private: @GLFW_PKG_DEPS@
Cflags: -I${includedir} Cflags: -I${includedir}

View file

@ -3,6 +3,8 @@
* raylib - A simple and easy-to-use library to learn videogames programming (www.raylib.com) * raylib - A simple and easy-to-use library to learn videogames programming (www.raylib.com)
* *
* FEATURES: * FEATURES:
* - NO external dependencies, all required libraries included with raylib
* - Multiple platforms support: Windows, Linux, FreeBSD, OpenBSD, NetBSD, DragonFly, MacOS, UWP, Android, Raspberry Pi, HTML5.
* - 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 - choose at compile) * - Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES2 - choose at compile)
* - Unique OpenGL abstraction layer (usable as standalone module): [rlgl] * - Unique OpenGL abstraction layer (usable as standalone module): [rlgl]
@ -12,10 +14,8 @@
* - 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] * - Powerful math module for Vector, Matrix and Quaternion operations: [raymath]
* - Audio loading and playing with streaming support (WAV, OGG, FLAC, XM, MOD) * - Audio loading and playing with streaming support (WAV, OGG, MP3, FLAC, XM, MOD)
* - Multiple platforms support: Windows, Linux, FreeBSD, MacOS, UWP, Android, Raspberry Pi, HTML5.
* - VR stereo rendering with configurable HMD device parameters * - VR stereo rendering with configurable HMD device parameters
* - NO external dependencies, all required libraries included with raylib
* - Complete bindings to LUA (raylib-lua) and Go (raylib-go) * - Complete bindings to LUA (raylib-lua) and Go (raylib-go)
* *
* NOTES: * NOTES:
@ -33,14 +33,15 @@
* stb_image_resize (Sean Barret) for image resizing algorythms [textures] * stb_image_resize (Sean Barret) for image resizing algorythms [textures]
* stb_image_write (Sean Barret) for image writting (PNG) [utils] * stb_image_write (Sean Barret) for image writting (PNG) [utils]
* stb_truetype (Sean Barret) for ttf fonts loading [text] * stb_truetype (Sean Barret) for ttf fonts loading [text]
* stb_rect_pack (Sean Barret) for rectangles packing [text]
* stb_vorbis (Sean Barret) for OGG audio loading [audio] * stb_vorbis (Sean Barret) for OGG audio loading [audio]
* stb_perlin (Sean Barret) for Perlin noise image generation [textures] * stb_perlin (Sean Barret) for Perlin noise image generation [textures]
* par_shapes (Philip Rideout) for parametric 3d shapes generation [models] * par_shapes (Philip Rideout) for parametric 3d shapes generation [models]
* jar_xm (Joshua Reisenauer) for XM audio module loading [audio] * jar_xm (Joshua Reisenauer) for XM audio module loading [audio]
* jar_mod (Joshua Reisenauer) for MOD audio module loading [audio] * jar_mod (Joshua Reisenauer) for MOD audio module loading [audio]
* dr_flac (David Reid) for FLAC audio file loading [audio] * dr_flac (David Reid) for FLAC audio file loading [audio]
* dr_mp3 (David Reid) for MP3 audio file loading [audio]
* rgif (Charlie Tangora, Ramon Santamaria) for GIF recording [core] * rgif (Charlie Tangora, Ramon Santamaria) for GIF recording [core]
* tinfl for data decompression (DEFLATE algorithm) [rres]
* *
* *
* LICENSE: zlib/libpng * LICENSE: zlib/libpng
@ -92,7 +93,7 @@
#define FLAG_SHOW_LOGO 1 // Set to show raylib logo at startup #define FLAG_SHOW_LOGO 1 // Set to show raylib logo at startup
#define FLAG_FULLSCREEN_MODE 2 // Set to run program in fullscreen #define FLAG_FULLSCREEN_MODE 2 // Set to run program in fullscreen
#define FLAG_WINDOW_RESIZABLE 4 // Set to allow resizable window #define FLAG_WINDOW_RESIZABLE 4 // Set to allow resizable window
#define FLAG_WINDOW_DECORATED 8 // Set to show window decoration (frame and buttons) #define FLAG_WINDOW_UNDECORATED 8 // Set to disable window decoration (frame and buttons)
#define FLAG_WINDOW_TRANSPARENT 16 // Set to allow transparent window #define FLAG_WINDOW_TRANSPARENT 16 // Set to allow transparent window
#define FLAG_MSAA_4X_HINT 32 // Set to try enabling MSAA 4X #define FLAG_MSAA_4X_HINT 32 // Set to try enabling MSAA 4X
#define FLAG_VSYNC_HINT 64 // Set to try enabling V-Sync on GPU #define FLAG_VSYNC_HINT 64 // Set to try enabling V-Sync on GPU
@ -331,6 +332,8 @@ typedef struct Vector4 {
float w; float w;
} Vector4; } Vector4;
typedef Vector4 Quaternion;
// Matrix type (OpenGL style 4x4 - right handed, column major) // Matrix type (OpenGL style 4x4 - right handed, column major)
typedef struct Matrix { typedef struct Matrix {
float m0, m4, m8, m12; float m0, m4, m8, m12;
@ -389,6 +392,7 @@ typedef struct CharInfo {
int offsetX; // Character offset X when drawing int offsetX; // Character offset X when drawing
int offsetY; // Character offset Y when drawing int offsetY; // Character offset Y when drawing
int advanceX; // Character advance position X int advanceX; // Character advance position X
unsigned char *data; // Character pixel data (grayscale)
} CharInfo; } CharInfo;
// Font type, includes texture and charSet array data // Font type, includes texture and charSet array data
@ -539,12 +543,12 @@ typedef struct VrDeviceInfo {
// Enumerators Definition // Enumerators Definition
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Trace log type // Trace log type
typedef enum { typedef enum {
LOG_INFO = 1, LOG_INFO = 1,
LOG_WARNING = 2, LOG_WARNING = 2,
LOG_ERROR = 4, LOG_ERROR = 4,
LOG_DEBUG = 8, LOG_DEBUG = 8,
LOG_OTHER = 16 LOG_OTHER = 16
} LogType; } LogType;
// Shader location point type // Shader location point type
@ -636,16 +640,16 @@ typedef enum {
} TextureFilterMode; } TextureFilterMode;
// Texture parameters: wrap mode // Texture parameters: wrap mode
typedef enum { typedef enum {
WRAP_REPEAT = 0, WRAP_REPEAT = 0,
WRAP_CLAMP, WRAP_CLAMP,
WRAP_MIRROR WRAP_MIRROR
} TextureWrapMode; } TextureWrapMode;
// Color blending modes (pre-defined) // Color blending modes (pre-defined)
typedef enum { typedef enum {
BLEND_ALPHA = 0, BLEND_ALPHA = 0,
BLEND_ADDITIVE, BLEND_ADDITIVE,
BLEND_MULTIPLIED BLEND_MULTIPLIED
} BlendMode; } BlendMode;
@ -899,6 +903,7 @@ RLAPI void UnloadImage(Image image);
RLAPI void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM) RLAPI void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM)
RLAPI void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM) RLAPI void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM)
RLAPI Color *GetImageData(Image image); // Get pixel data from image as a Color struct array RLAPI Color *GetImageData(Image image); // Get pixel data from image as a Color struct array
RLAPI Vector4 *GetImageDataNormalized(Image image); // Get pixel data from image as Vector4 array (float normalized)
RLAPI int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes (image or texture) RLAPI int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes (image or texture)
RLAPI Image GetTextureData(Texture2D texture); // Get pixel data from GPU texture and return an Image RLAPI Image GetTextureData(Texture2D texture); // Get pixel data from GPU texture and return an Image
RLAPI void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data RLAPI void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data
@ -912,8 +917,9 @@ RLAPI void ImageAlphaClear(Image *image, Color color, float threshold);
RLAPI void ImageAlphaCrop(Image *image, float threshold); // Crop image depending on alpha value RLAPI void ImageAlphaCrop(Image *image, float threshold); // Crop image depending on alpha value
RLAPI void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel RLAPI void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel
RLAPI void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle RLAPI void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle
RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize and image (bilinear filtering) RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (bilinear filtering)
RLAPI void ImageResizeNN(Image *image,int newWidth,int newHeight); // Resize and image (Nearest-Neighbor scaling algorithm) RLAPI void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm)
RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color color); // Resize canvas and fill with color
RLAPI void ImageMipmaps(Image *image); // Generate all mipmap levels for a provided image RLAPI void ImageMipmaps(Image *image); // Generate all mipmap levels for a provided image
RLAPI void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) RLAPI void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering)
RLAPI Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font) RLAPI Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font)
@ -924,11 +930,14 @@ RLAPI void ImageDrawText(Image *dst, Vector2 position, const char *text, int fon
RLAPI void ImageDrawTextEx(Image *dst, Vector2 position, Font font, const char *text, float fontSize, float spacing, Color color); // Draw text (custom sprite font) within an image (destination) RLAPI void ImageDrawTextEx(Image *dst, Vector2 position, Font font, const char *text, float fontSize, float spacing, Color color); // Draw text (custom sprite font) within an image (destination)
RLAPI void ImageFlipVertical(Image *image); // Flip image vertically RLAPI void ImageFlipVertical(Image *image); // Flip image vertically
RLAPI void ImageFlipHorizontal(Image *image); // Flip image horizontally RLAPI void ImageFlipHorizontal(Image *image); // Flip image horizontally
RLAPI void ImageRotateCW(Image *image); // Rotate image clockwise 90deg
RLAPI void ImageRotateCCW(Image *image); // Rotate image counter-clockwise 90deg
RLAPI void ImageColorTint(Image *image, Color color); // Modify image color: tint RLAPI void ImageColorTint(Image *image, Color color); // Modify image color: tint
RLAPI void ImageColorInvert(Image *image); // Modify image color: invert RLAPI void ImageColorInvert(Image *image); // Modify image color: invert
RLAPI void ImageColorGrayscale(Image *image); // Modify image color: grayscale RLAPI void ImageColorGrayscale(Image *image); // Modify image color: grayscale
RLAPI void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100) RLAPI void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100)
RLAPI void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255) RLAPI void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255)
RLAPI void ImageColorReplace(Image *image, Color color, Color replace); // Modify image color: replace color
// Image generation functions // Image generation functions
RLAPI Image GenImageColor(int width, int height, Color color); // Generate image: plain color RLAPI Image GenImageColor(int width, int height, Color color); // Generate image: plain color
@ -951,29 +960,30 @@ RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint);
RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters
RLAPI void DrawTextureRec(Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle RLAPI void DrawTextureRec(Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle
RLAPI void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters RLAPI void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
// Font Loading and Text Drawing Functions (Module: text) // Font Loading and Text Drawing Functions (Module: text)
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
// Font loading/unloading functions // Font loading/unloading functions
RLAPI Font GetDefaultFont(void); // Get the default Font RLAPI Font GetDefaultFont(void); // Get the default Font
RLAPI Font LoadFont(const char *fileName); // Load Font from file into GPU memory (VRAM) RLAPI Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM)
RLAPI Font LoadFontEx(const char *fileName, int fontSize, int charsCount, int *fontChars); // Load Font from file with extended parameters RLAPI Font LoadFontEx(const char *fileName, int fontSize, int charsCount, int *fontChars); // Load font from file with extended parameters
RLAPI void UnloadFont(Font font); // Unload Font from GPU memory (VRAM) RLAPI CharInfo *LoadFontData(const char *fileName, int fontSize, int *fontChars, int charsCount, bool sdf); // Load font data for further use
RLAPI Image GenImageFontAtlas(CharInfo *chars, int fontSize, int charsCount, int padding, int packMethod); // Generate image font atlas using chars info
RLAPI void UnloadFont(Font font); // Unload Font from GPU memory (VRAM)
// Text drawing functions // Text drawing functions
RLAPI void DrawFPS(int posX, int posY); // Shows current FPS RLAPI void DrawFPS(int posX, int posY); // Shows current FPS
RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font)
RLAPI void DrawTextEx(Font font, const char* text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using Font and additional parameters RLAPI void DrawTextEx(Font font, const char* text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters
// Text misc. functions // Text misc. functions
RLAPI int MeasureText(const char *text, int fontSize); // Measure string width for default font RLAPI int MeasureText(const char *text, int fontSize); // Measure string width for default font
RLAPI Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font RLAPI Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font
RLAPI const char *FormatText(const char *text, ...); // Formatting of text with variables to 'embed' RLAPI const char *FormatText(const char *text, ...); // Formatting of text with variables to 'embed'
RLAPI const char *SubText(const char *text, int position, int length); // Get a piece of a text string RLAPI const char *SubText(const char *text, int position, int length); // Get a piece of a text string
RLAPI int GetGlyphIndex(Font font, int character); // Returns index position for a unicode character on sprite font RLAPI int GetGlyphIndex(Font font, int character); // Get index position for a unicode character on sprite font
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
// Basic 3d Shapes Drawing Functions (Module: models) // Basic 3d Shapes Drawing Functions (Module: models)
@ -1013,7 +1023,7 @@ RLAPI void ExportMesh(const char *fileName, Mesh mesh);
// Mesh manipulation functions // Mesh manipulation functions
RLAPI BoundingBox MeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits RLAPI BoundingBox MeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits
RLAPI void MeshTangents(Mesh *mesh); // Compute mesh tangents RLAPI void MeshTangents(Mesh *mesh); // Compute mesh tangents
RLAPI void MeshBinormals(Mesh *mesh); // Compute mesh binormals RLAPI void MeshBinormals(Mesh *mesh); // Compute mesh binormals
// Mesh generation functions // Mesh generation functions

Binary file not shown.

22
src/CMakeLists.txt Executable file → Normal file
View file

@ -17,7 +17,8 @@ include_directories(SYSTEM .)
file(GLOB raylib_sources *.c) file(GLOB raylib_sources *.c)
list(REMOVE_ITEM raylib_sources ${CMAKE_CURRENT_SOURCE_DIR}/rglfw.c) list(REMOVE_ITEM raylib_sources ${CMAKE_CURRENT_SOURCE_DIR}/rglfw.c)
if(NOT glfw3_FOUND AND "${PLATFORM}" MATCHES "Desktop") # Explicitly check against "ON", because USE_EXTERNAL_GLFW is a tristate option
if(NOT glfw3_FOUND AND NOT USE_EXTERNAL_GLFW STREQUAL "ON" AND "${PLATFORM}" MATCHES "Desktop")
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE) set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE) set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
@ -32,6 +33,8 @@ if(NOT glfw3_FOUND AND "${PLATFORM}" MATCHES "Desktop")
include_directories(external/glfw/include) include_directories(external/glfw/include)
list(APPEND raylib_sources $<TARGET_OBJECTS:glfw_objlib>) list(APPEND raylib_sources $<TARGET_OBJECTS:glfw_objlib>)
else()
set(GLFW_PKG_DEPS glfw)
endif() endif()
include(utils) include(utils)
@ -91,7 +94,7 @@ elseif(${PLATFORM} MATCHES "Android")
add_if_flag_compiles(-Wa,--noexecstack CMAKE_C_FLAGS) add_if_flag_compiles(-Wa,--noexecstack CMAKE_C_FLAGS)
add_if_flag_compiles(-no-canonical-prefixes CMAKE_C_FLAGS) add_if_flag_compiles(-no-canonical-prefixes CMAKE_C_FLAGS)
add_definitions(-DANDROID -D__ANDROID_API__=21) add_definitions(-DANDROID -D__ANDROID_API__=21)
include_directories(external/android/native_app_glue ) include_directories(external/android/native_app_glue)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--exclude-libs,libatomic.a -Wl,--build-id -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings -uANativeActivity_onCreate") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--exclude-libs,libatomic.a -Wl,--build-id -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings -uANativeActivity_onCreate")
elseif(${PLATFORM} MATCHES "Raspberry Pi") elseif(${PLATFORM} MATCHES "Raspberry Pi")
@ -113,8 +116,8 @@ if(${SHARED})
set(CMAKE_MACOSX_RPATH ON) set(CMAKE_MACOSX_RPATH ON)
target_link_libraries(${RAYLIB}_shared ${LIBS_PRIVATE}) target_link_libraries(${RAYLIB}_shared ${LIBS_PRIVATE})
if (${PLATFORM} MATCHES "Desktop") if (${PLATFORM} MATCHES "PLATFORM_DESKTOP")
target_link_libraries(${RAYLIB}_shared glfw ${GLFW_LIBRARIES}) target_link_libraries(${RAYLIB}_shared glfw)
endif() endif()
if (UNIX AND ${FILESYSTEM_LACKS_SYMLINKS}) if (UNIX AND ${FILESYSTEM_LACKS_SYMLINKS})
MESSAGE(WARNING "Can't version UNIX shared library on file system without symlink support") MESSAGE(WARNING "Can't version UNIX shared library on file system without symlink support")
@ -141,6 +144,8 @@ if(${SHARED})
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
) )
endif() endif()
add_test("pkg-config" ${PROJECT_SOURCE_DIR}/../cmake/test-pkgconfig.sh)
endif(${SHARED}) endif(${SHARED})
if(${STATIC}) if(${STATIC})
@ -150,8 +155,9 @@ if(${STATIC})
add_library(${RAYLIB} STATIC ${sources}) add_library(${RAYLIB} STATIC ${sources})
set(PKG_CONFIG_LIBS_PRIVATE ${__PKG_CONFIG_LIBS_PRIVATE}) set(PKG_CONFIG_LIBS_PRIVATE ${__PKG_CONFIG_LIBS_PRIVATE} ${GLFW_PKG_LIBS})
if (${PLATFORM} MATCHES "Desktop") string (REPLACE ";" " " PKG_CONFIG_LIBS_PRIVATE "${PKG_CONFIG_LIBS_PRIVATE}")
if (${PLATFORM} MATCHES "PLATFORM_DESKTOP")
target_link_libraries(${RAYLIB} glfw ${GLFW_LIBRARIES}) target_link_libraries(${RAYLIB} glfw ${GLFW_LIBRARIES})
endif() endif()
@ -163,6 +169,8 @@ if(${STATIC})
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
) )
add_test("pkg-config--static" ${PROJECT_SOURCE_DIR}/../cmake/test-pkgconfig.sh --static)
endif(${STATIC}) endif(${STATIC})
configure_file(../raylib.pc.in raylib.pc @ONLY) configure_file(../raylib.pc.in raylib.pc @ONLY)
@ -199,3 +207,5 @@ SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/../LICENSE.md")
SET(CPACK_PACKAGE_FILE_NAME "raylib-${PROJECT_VERSION}$ENV{RAYLIB_PACKAGE_SUFFIX}") SET(CPACK_PACKAGE_FILE_NAME "raylib-${PROJECT_VERSION}$ENV{RAYLIB_PACKAGE_SUFFIX}")
SET(CPACK_GENERATOR "ZIP;TGZ") # Remove this, if you want the NSIS installer on Windows SET(CPACK_GENERATOR "ZIP;TGZ") # Remove this, if you want the NSIS installer on Windows
include(CPack) include(CPack)
enable_testing()

View file

@ -6,7 +6,7 @@
# PLATFORM_DESKTOP: Windows (Win32, Win64) # PLATFORM_DESKTOP: Windows (Win32, Win64)
# PLATFORM_DESKTOP: Linux (32 and 64 bit) # PLATFORM_DESKTOP: Linux (32 and 64 bit)
# PLATFORM_DESKTOP: OSX/macOS # PLATFORM_DESKTOP: OSX/macOS
# PLATFORM_DESKTOP: FreeBSD # PLATFORM_DESKTOP: FreeBSD, OpenBSD, NetBSD, DragonFly
# PLATFORM_ANDROID: Android (ARM, ARM64) # PLATFORM_ANDROID: Android (ARM, ARM64)
# PLATFORM_RPI: Raspberry Pi (Raspbian) # PLATFORM_RPI: Raspberry Pi (Raspbian)
# PLATFORM_WEB: HTML5 (Chrome, Firefox) # PLATFORM_WEB: HTML5 (Chrome, Firefox)
@ -111,7 +111,16 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
PLATFORM_OS=LINUX PLATFORM_OS=LINUX
endif endif
ifeq ($(UNAMEOS),FreeBSD) ifeq ($(UNAMEOS),FreeBSD)
PLATFORM_OS=FREEBSD PLATFORM_OS=BSD
endif
ifeq ($(UNAMEOS),OpenBSD)
PLATFORM_OS=BSD
endif
ifeq ($(UNAMEOS),NetBSD)
PLATFORM_OS=BSD
endif
ifeq ($(UNAMEOS),DragonFly)
PLATFORM_OS=BSD
endif endif
ifeq ($(UNAMEOS),Darwin) ifeq ($(UNAMEOS),Darwin)
PLATFORM_OS=OSX PLATFORM_OS=OSX
@ -185,8 +194,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),OSX) ifeq ($(PLATFORM_OS),OSX)
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx
endif endif
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/freebsd RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/bsd
endif endif
endif endif
ifeq ($(PLATFORM),PLATFORM_RPI) ifeq ($(PLATFORM),PLATFORM_RPI)
@ -231,8 +240,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
CC = clang CC = clang
GLFW_CFLAGS = -x objective-c GLFW_CFLAGS = -x objective-c
endif endif
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
# FreeBSD default compiler # FreeBSD, OpenBSD, NetBSD, DragonFly default compiler
CC = clang CC = clang
endif endif
endif endif
@ -309,13 +318,14 @@ endif
ifeq ($(PLATFORM),PLATFORM_ANDROID) ifeq ($(PLATFORM),PLATFORM_ANDROID)
# Compiler flags for arquitecture (only ARM, not ARM64) # Compiler flags for arquitecture (only ARM, not ARM64)
#CFLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 #CFLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16
CFLAGS += -target aarch64 -mfix-cortex-a53-835769
# Compilation functions attributes options # Compilation functions attributes options
CFLAGS += -ffunction-sections -funwind-tables -fstack-protector-strong -fPIE -fPIC CFLAGS += -ffunction-sections -funwind-tables -fstack-protector-strong -fPIE -fPIC
# Compiler options for the linker # Compiler options for the linker
# -Werror=format-security # -Werror=format-security
CFLAGS += -Wa,--noexecstack -Wformat -no-canonical-prefixes CFLAGS += -Wa,--noexecstack -Wformat -no-canonical-prefixes
# Preprocessor macro definitions # Preprocessor macro definitions
CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=21 CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=21 -DMAL_NO_OSS
endif endif
# Define required compilation flags for raylib SHARED lib # Define required compilation flags for raylib SHARED lib
@ -345,7 +355,7 @@ endif
INCLUDE_PATHS = -I. -Iexternal -Iexternal/glfw/include INCLUDE_PATHS = -I. -Iexternal -Iexternal/glfw/include
ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
INCLUDE_PATHS += -I/usr/local/include INCLUDE_PATHS += -I/usr/local/include
LDFLAGS += -L. -Lsrc -L/usr/local/lib -L$(RAYLIB_RELEASE_PATH) LDFLAGS += -L. -Lsrc -L/usr/local/lib -L$(RAYLIB_RELEASE_PATH)
endif endif
@ -415,6 +425,10 @@ ifeq ($(INCLUDE_AUDIO_MODULE),TRUE)
endif endif
endif endif
ifeq ($(PLATFORM),PLATFORM_ANDROID)
OBJS += external/android/native_app_glue/android_native_app_glue.o
endif
# Default target entry # Default target entry
all: raylib all: raylib
@ -454,7 +468,7 @@ else
cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).dylib libraylib.$(RAYLIB_API_VERSION).dylib cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).dylib libraylib.$(RAYLIB_API_VERSION).dylib
cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).dylib libraylib.dylib cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).dylib libraylib.dylib
endif endif
ifeq ($(PLATFORM_OS),FREEBSD) ifeq ($(PLATFORM_OS),BSD)
# WARNING: you should type "gmake clean" before doing this target # WARNING: you should type "gmake clean" before doing this target
$(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_VERSION).so $(OBJS) -Wl,-soname,libraylib.$(RAYLIB_API_VERSION).so -lGL -lpthread $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_VERSION).so $(OBJS) -Wl,-soname,libraylib.$(RAYLIB_API_VERSION).so -lGL -lpthread
@echo "raylib shared library generated (libraylib.$(RAYLIB_VERSION).so)!" @echo "raylib shared library generated (libraylib.$(RAYLIB_VERSION).so)!"

View file

@ -17,7 +17,7 @@
* Required types and functions are defined in the same module. * Required types and functions are defined in the same module.
* *
* #define USE_OPENAL_BACKEND * #define USE_OPENAL_BACKEND
* Use OpenAL Soft audio backend usage * Use OpenAL Soft audio backend
* *
* #define SUPPORT_FILEFORMAT_WAV * #define SUPPORT_FILEFORMAT_WAV
* #define SUPPORT_FILEFORMAT_OGG * #define SUPPORT_FILEFORMAT_OGG
@ -73,11 +73,6 @@
* *
**********************************************************************************************/ **********************************************************************************************/
#include "config.h"
#if !defined(USE_OPENAL_BACKEND)
#define USE_MINI_AL 1 // Set to 1 to use mini_al; 0 to use OpenAL.
#endif
#if defined(AUDIO_STANDALONE) #if defined(AUDIO_STANDALONE)
#include "audio.h" #include "audio.h"
#include <stdarg.h> // Required for: va_list, va_start(), vfprintf(), va_end() #include <stdarg.h> // Required for: va_list, va_start(), vfprintf(), va_end()
@ -87,6 +82,10 @@
#include "utils.h" // Required for: fopen() Android mapping #include "utils.h" // Required for: fopen() Android mapping
#endif #endif
#if !defined(USE_OPENAL_BACKEND)
#define USE_MINI_AL 1 // Set to 1 to use mini_al; 0 to use OpenAL.
#endif
#include "external/mini_al.h" // Implemented in mini_al.c. Cannot implement this here because it conflicts with Win32 APIs such as CloseWindow(), etc. #include "external/mini_al.h" // Implemented in mini_al.c. Cannot implement this here because it conflicts with Win32 APIs such as CloseWindow(), etc.
#if !defined(USE_MINI_AL) || (USE_MINI_AL == 0) #if !defined(USE_MINI_AL) || (USE_MINI_AL == 0)
@ -668,7 +667,7 @@ AudioBuffer *CreateAudioBuffer(mal_format format, mal_uint32 channels, mal_uint3
mal_result resultMAL = mal_dsp_init(&dspConfig, &audioBuffer->dsp); mal_result resultMAL = mal_dsp_init(&dspConfig, &audioBuffer->dsp);
if (resultMAL != MAL_SUCCESS) if (resultMAL != MAL_SUCCESS)
{ {
TraceLog(LOG_ERROR, "LoadSoundFromWave() : Failed to create data conversion pipeline"); TraceLog(LOG_ERROR, "CreateAudioBuffer() : Failed to create data conversion pipeline");
free(audioBuffer); free(audioBuffer);
return NULL; return NULL;
} }
@ -696,7 +695,7 @@ void DeleteAudioBuffer(AudioBuffer *audioBuffer)
{ {
if (audioBuffer == NULL) if (audioBuffer == NULL)
{ {
TraceLog(LOG_ERROR, "PlayAudioBuffer() : No audio buffer"); TraceLog(LOG_ERROR, "DeleteAudioBuffer() : No audio buffer");
return; return;
} }
@ -709,7 +708,7 @@ bool IsAudioBufferPlaying(AudioBuffer *audioBuffer)
{ {
if (audioBuffer == NULL) if (audioBuffer == NULL)
{ {
TraceLog(LOG_ERROR, "PlayAudioBuffer() : No audio buffer"); TraceLog(LOG_ERROR, "IsAudioBufferPlaying() : No audio buffer");
return false; return false;
} }
@ -737,7 +736,7 @@ void StopAudioBuffer(AudioBuffer *audioBuffer)
{ {
if (audioBuffer == NULL) if (audioBuffer == NULL)
{ {
TraceLog(LOG_ERROR, "PlayAudioBuffer() : No audio buffer"); TraceLog(LOG_ERROR, "StopAudioBuffer() : No audio buffer");
return; return;
} }
@ -756,7 +755,7 @@ void PauseAudioBuffer(AudioBuffer *audioBuffer)
{ {
if (audioBuffer == NULL) if (audioBuffer == NULL)
{ {
TraceLog(LOG_ERROR, "PlayAudioBuffer() : No audio buffer"); TraceLog(LOG_ERROR, "PauseAudioBuffer() : No audio buffer");
return; return;
} }
@ -768,7 +767,7 @@ void ResumeAudioBuffer(AudioBuffer *audioBuffer)
{ {
if (audioBuffer == NULL) if (audioBuffer == NULL)
{ {
TraceLog(LOG_ERROR, "PlayAudioBuffer() : No audio buffer"); TraceLog(LOG_ERROR, "ResumeAudioBuffer() : No audio buffer");
return; return;
} }
@ -780,7 +779,7 @@ void SetAudioBufferVolume(AudioBuffer *audioBuffer, float volume)
{ {
if (audioBuffer == NULL) if (audioBuffer == NULL)
{ {
TraceLog(LOG_ERROR, "PlayAudioBuffer() : No audio buffer"); TraceLog(LOG_ERROR, "SetAudioBufferVolume() : No audio buffer");
return; return;
} }
@ -792,7 +791,7 @@ void SetAudioBufferPitch(AudioBuffer *audioBuffer, float pitch)
{ {
if (audioBuffer == NULL) if (audioBuffer == NULL)
{ {
TraceLog(LOG_ERROR, "PlayAudioBuffer() : No audio buffer"); TraceLog(LOG_ERROR, "SetAudioBufferPitch() : No audio buffer");
return; return;
} }

View file

@ -244,8 +244,8 @@ void SetCameraMode(Camera camera, int mode)
distance.y = sqrtf(dx*dx + dy*dy); distance.y = sqrtf(dx*dx + dy*dy);
// Camera angle calculation // Camera angle calculation
cameraAngle.x = asinf(fabsf(dx)/distance.x); // Camera angle in plane XZ (0 aligned with Z, move positive CCW) cameraAngle.x = asinf(fabs(dx)/distance.x); // Camera angle in plane XZ (0 aligned with Z, move positive CCW)
cameraAngle.y = -asinf(fabsf(dy)/distance.y); // Camera angle in plane XY (0 aligned with X, move positive CW) cameraAngle.y = -asinf(fabs(dy)/distance.y); // Camera angle in plane XY (0 aligned with X, move positive CW)
// NOTE: Just testing what cameraAngle means // NOTE: Just testing what cameraAngle means
//cameraAngle.x = 0.0f*DEG2RAD; // Camera angle in plane XZ (0 aligned with Z, move positive CCW) //cameraAngle.x = 0.0f*DEG2RAD; // Camera angle in plane XZ (0 aligned with Z, move positive CCW)

View file

@ -5,7 +5,7 @@
* PLATFORMS SUPPORTED: * PLATFORMS SUPPORTED:
* - PLATFORM_DESKTOP: Windows (Win32, Win64) * - PLATFORM_DESKTOP: Windows (Win32, Win64)
* - PLATFORM_DESKTOP: Linux (X11 desktop mode) * - PLATFORM_DESKTOP: Linux (X11 desktop mode)
* - PLATFORM_DESKTOP: FreeBSD (X11 desktop) * - PLATFORM_DESKTOP: FreeBSD, OpenBSD, NetBSD, DragonFly (X11 desktop)
* - PLATFORM_DESKTOP: OSX/macOS * - PLATFORM_DESKTOP: OSX/macOS
* - PLATFORM_ANDROID: Android 4.0 (ARM, ARM64) * - PLATFORM_ANDROID: Android 4.0 (ARM, ARM64)
* - PLATFORM_RPI: Raspberry Pi 0,1,2,3 (Raspbian) * - PLATFORM_RPI: Raspberry Pi 0,1,2,3 (Raspbian)
@ -15,7 +15,7 @@
* CONFIGURATION: * CONFIGURATION:
* *
* #define PLATFORM_DESKTOP * #define PLATFORM_DESKTOP
* Windowing and input system configured for desktop platforms: Windows, Linux, OSX, FreeBSD * Windowing and input system configured for desktop platforms: Windows, Linux, OSX, FreeBSD, OpenBSD, NetBSD, DragonFly
* NOTE: Oculus Rift CV1 requires PLATFORM_DESKTOP for mirror rendering - View [rlgl] module to enable it * NOTE: Oculus Rift CV1 requires PLATFORM_DESKTOP for mirror rendering - View [rlgl] module to enable it
* *
* #define PLATFORM_ANDROID * #define PLATFORM_ANDROID
@ -57,7 +57,7 @@
* Allow automatic gif recording of current screen pressing CTRL+F12, defined in KeyCallback() * Allow automatic gif recording of current screen pressing CTRL+F12, defined in KeyCallback()
* *
* DEPENDENCIES: * DEPENDENCIES:
* rglfw - Manage graphic device, OpenGL context and inputs on PLATFORM_DESKTOP (Windows, Linux, OSX. FreeBSD) * rglfw - Manage graphic device, OpenGL context and inputs on PLATFORM_DESKTOP (Windows, Linux, OSX. FreeBSD, OpenBSD, NetBSD, DragonFly)
* raymath - 3D math functionality (Vector2, Vector3, Matrix, Quaternion) * raymath - 3D math functionality (Vector2, Vector3, Matrix, Quaternion)
* camera - Multiple 3D camera modes (free, orbital, 1st person, 3rd person) * camera - Multiple 3D camera modes (free, orbital, 1st person, 3rd person)
* gestures - Gestures system for touch-ready devices (or simulated from mouse inputs) * gestures - Gestures system for touch-ready devices (or simulated from mouse inputs)
@ -1884,31 +1884,30 @@ static bool InitGraphicsDevice(int width, int height)
displayHeight = screenHeight; displayHeight = screenHeight;
#endif // defined(PLATFORM_WEB) #endif // defined(PLATFORM_WEB)
glfwDefaultWindowHints(); // Set default windows hints glfwDefaultWindowHints(); // Set default windows hints:
// Check some Window creation flags
if (configFlags & FLAG_WINDOW_RESIZABLE) glfwWindowHint(GLFW_RESIZABLE, GL_TRUE); // Resizable window
else glfwWindowHint(GLFW_RESIZABLE, GL_FALSE); // Avoid window being resizable
if (configFlags & FLAG_WINDOW_DECORATED) glfwWindowHint(GLFW_DECORATED, GL_TRUE); // Border and buttons on Window
if (configFlags & FLAG_WINDOW_TRANSPARENT)
{
// TODO: Enable transparent window (not ready yet on GLFW 3.2)
}
if (configFlags & FLAG_MSAA_4X_HINT)
{
glfwWindowHint(GLFW_SAMPLES, 4); // Enables multisampling x4 (MSAA), default is 0
TraceLog(LOG_INFO, "Trying to enable MSAA x4");
}
//glfwWindowHint(GLFW_RED_BITS, 8); // Framebuffer red color component bits //glfwWindowHint(GLFW_RED_BITS, 8); // Framebuffer red color component bits
//glfwWindowHint(GLFW_DEPTH_BITS, 16); // Depthbuffer bits (24 by default) //glfwWindowHint(GLFW_GREEN_BITS, 8); // Framebuffer green color component bits
//glfwWindowHint(GLFW_BLUE_BITS, 8); // Framebuffer blue color component bits
//glfwWindowHint(GLFW_ALPHA_BITS, 8); // Framebuffer alpha color component bits
//glfwWindowHint(GLFW_DEPTH_BITS, 24); // Depthbuffer bits
//glfwWindowHint(GLFW_REFRESH_RATE, 0); // Refresh rate for fullscreen window //glfwWindowHint(GLFW_REFRESH_RATE, 0); // Refresh rate for fullscreen window
//glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API); // Default OpenGL API to use. Alternative: GLFW_OPENGL_ES_API //glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API); // OpenGL API to use. Alternative: GLFW_OPENGL_ES_API
//glfwWindowHint(GLFW_AUX_BUFFERS, 0); // Number of auxiliar buffers //glfwWindowHint(GLFW_AUX_BUFFERS, 0); // Number of auxiliar buffers
// Check some Window creation flags
if (configFlags & FLAG_WINDOW_RESIZABLE) glfwWindowHint(GLFW_RESIZABLE, GL_TRUE); // Resizable window
else glfwWindowHint(GLFW_RESIZABLE, GL_FALSE); // Avoid window being resizable
if (configFlags & FLAG_WINDOW_UNDECORATED) glfwWindowHint(GLFW_DECORATED, GL_FALSE); // Border and buttons on Window
else glfwWindowHint(GLFW_DECORATED, GL_TRUE); // Decorated window
#if !defined(PLATFORM_WEB) // FLAG_WINDOW_TRANSPARENT not supported on HTML5
if (configFlags & FLAG_WINDOW_TRANSPARENT) glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE); // Transparent framebuffer
else glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_FALSE); // Opaque framebuffer
#endif
if (configFlags & FLAG_MSAA_4X_HINT) glfwWindowHint(GLFW_SAMPLES, 4); // Tries to enable multisampling x4 (MSAA), default is 0
// NOTE: When asking for an OpenGL context version, most drivers provide highest supported version // NOTE: When asking for an OpenGL context version, most drivers provide highest supported version
// with forward compatibility to older OpenGL versions. // with forward compatibility to older OpenGL versions.
// For example, if using OpenGL 1.1, driver can provide a 4.3 context forward compatible. // For example, if using OpenGL 1.1, driver can provide a 4.3 context forward compatible.
@ -1926,11 +1925,11 @@ static bool InitGraphicsDevice(int width, int height)
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // Profiles Hint: Only 3.3 and above! glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // Profiles Hint: Only 3.3 and above!
// Other values: GLFW_OPENGL_ANY_PROFILE, GLFW_OPENGL_COMPAT_PROFILE // Other values: GLFW_OPENGL_ANY_PROFILE, GLFW_OPENGL_COMPAT_PROFILE
#if defined(__APPLE__) #if defined(__APPLE__)
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // OSX Requires glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // OSX Requires fordward compatibility
#else #else
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_FALSE); // Fordward Compatibility Hint: Only 3.3 and above! glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_FALSE); // Fordward Compatibility Hint: Only 3.3 and above!
#endif #endif
//glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE); //glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE); // Request OpenGL DEBUG context
} }
if (fullscreen) if (fullscreen)

View file

@ -27,11 +27,6 @@ if (WIN32)
"$ENV{VULKAN_SDK}/Bin32" "$ENV{VULKAN_SDK}/Bin32"
"$ENV{VK_SDK_PATH}/Bin32") "$ENV{VK_SDK_PATH}/Bin32")
endif() endif()
elseif (APPLE)
find_library(VULKAN_LIBRARY vulkan.1 HINTS
"$ENV{VULKAN_SDK}/macOS/lib")
find_path(VULKAN_INCLUDE_DIR NAMES vulkan/vulkan.h HINTS
"$ENV{VULKAN_SDK}/macOS/include")
else() else()
find_path(VULKAN_INCLUDE_DIR NAMES vulkan/vulkan.h HINTS find_path(VULKAN_INCLUDE_DIR NAMES vulkan/vulkan.h HINTS
"$ENV{VULKAN_SDK}/include") "$ENV{VULKAN_SDK}/include")

View file

@ -327,10 +327,10 @@ endif()
# Export GLFW library dependencies # Export GLFW library dependencies
#-------------------------------------------------------------------- #--------------------------------------------------------------------
foreach(arg ${glfw_PKG_DEPS}) foreach(arg ${glfw_PKG_DEPS})
set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} ${arg}") set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} ${arg}" PARENT_SCOPE)
endforeach() endforeach()
foreach(arg ${glfw_PKG_LIBS}) foreach(arg ${glfw_PKG_LIBS})
set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} ${arg}") set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} ${arg}" PARENT_SCOPE)
endforeach() endforeach()
#-------------------------------------------------------------------- #--------------------------------------------------------------------

View file

@ -165,6 +165,8 @@ information on what to include when reporting a bug.
- Added `GLFW_HOVERED` window attribute for polling cursor hover state (#1166) - Added `GLFW_HOVERED` window attribute for polling cursor hover state (#1166)
- Added `GLFW_CENTER_CURSOR` window hint for controlling cursor centering - Added `GLFW_CENTER_CURSOR` window hint for controlling cursor centering
(#749,#842) (#749,#842)
- Added `GLFW_FOCUS_ON_SHOW` window hint and attribute to control input focus
on calling show window (#1189)
- Added `GLFW_JOYSTICK_HAT_BUTTONS` init hint (#889) - Added `GLFW_JOYSTICK_HAT_BUTTONS` init hint (#889)
- Added `GLFW_LOCK_KEY_MODS` input mode and `GLFW_MOD_*_LOCK` mod bits (#946) - Added `GLFW_LOCK_KEY_MODS` input mode and `GLFW_MOD_*_LOCK` mod bits (#946)
- Added macOS specific `GLFW_COCOA_RETINA_FRAMEBUFFER` window hint - Added macOS specific `GLFW_COCOA_RETINA_FRAMEBUFFER` window hint

View file

@ -819,6 +819,12 @@ extern "C" {
* Mouse cursor hover [window attribute](@ref GLFW_HOVERED_attrib). * Mouse cursor hover [window attribute](@ref GLFW_HOVERED_attrib).
*/ */
#define GLFW_HOVERED 0x0002000B #define GLFW_HOVERED 0x0002000B
/*! @brief Input focus on calling show window hint and attribute
*
* Input focus [window hint](@ref GLFW_FOCUS_ON_SHOW_hint) or
* [window attribute](@ref GLFW_FOCUS_ON_SHOW_attrib).
*/
#define GLFW_FOCUS_ON_SHOW 0x0002000C
/*! @brief Framebuffer bit depth hint. /*! @brief Framebuffer bit depth hint.
* *
@ -3085,6 +3091,11 @@ GLFWAPI void glfwMaximizeWindow(GLFWwindow* window);
* hidden. If the window is already visible or is in full screen mode, this * hidden. If the window is already visible or is in full screen mode, this
* function does nothing. * function does nothing.
* *
* By default, windowed mode windows are focused when shown
* Set the [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_hint) window hint
* to change this behavior for all newly created windows, or change the
* behavior for an existing window with @ref glfwSetWindowAttrib.
*
* @param[in] window The window to make visible. * @param[in] window The window to make visible.
* *
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
@ -3132,6 +3143,10 @@ GLFWAPI void glfwHideWindow(GLFWwindow* window);
* initially created. Set the [GLFW_FOCUSED](@ref GLFW_FOCUSED_hint) to * initially created. Set the [GLFW_FOCUSED](@ref GLFW_FOCUSED_hint) to
* disable this behavior. * disable this behavior.
* *
* Also by default, windowed mode windows are focused when shown
* with @ref glfwShowWindow. Set the
* [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_hint) to disable this behavior.
*
* __Do not use this function__ to steal focus from other applications unless * __Do not use this function__ to steal focus from other applications unless
* you are certain that is what the user wants. Focus stealing can be * you are certain that is what the user wants. Focus stealing can be
* extremely disruptive. * extremely disruptive.
@ -3306,8 +3321,9 @@ GLFWAPI int glfwGetWindowAttrib(GLFWwindow* window, int attrib);
* *
* The supported attributes are [GLFW_DECORATED](@ref GLFW_DECORATED_attrib), * The supported attributes are [GLFW_DECORATED](@ref GLFW_DECORATED_attrib),
* [GLFW_RESIZABLE](@ref GLFW_RESIZABLE_attrib), * [GLFW_RESIZABLE](@ref GLFW_RESIZABLE_attrib),
* [GLFW_FLOATING](@ref GLFW_FLOATING_attrib) and * [GLFW_FLOATING](@ref GLFW_FLOATING_attrib),
* [GLFW_AUTO_ICONIFY](@ref GLFW_AUTO_ICONIFY_attrib). * [GLFW_AUTO_ICONIFY](@ref GLFW_AUTO_ICONIFY_attrib) and
* [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_attrib).
* *
* Some of these attributes are ignored for full screen windows. The new * Some of these attributes are ignored for full screen windows. The new
* value will take effect if the window is later made windowed. * value will take effect if the window is later made windowed.

View file

@ -163,4 +163,3 @@ if (GLFW_INSTALL)
ARCHIVE DESTINATION "lib${LIB_SUFFIX}" ARCHIVE DESTINATION "lib${LIB_SUFFIX}"
LIBRARY DESTINATION "lib${LIB_SUFFIX}") LIBRARY DESTINATION "lib${LIB_SUFFIX}")
endif() endif()

View file

@ -32,7 +32,6 @@
#include <math.h> #include <math.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <ctype.h>
// Internal key state used for sticky keys // Internal key state used for sticky keys
#define _GLFW_STICK 3 #define _GLFW_STICK 3
@ -1086,7 +1085,9 @@ GLFWAPI int glfwUpdateGamepadMappings(const char* string)
while (*c) while (*c)
{ {
if (isxdigit(*c)) if ((*c >= '0' && *c <= '9') ||
(*c >= 'a' && *c <= 'f') ||
(*c >= 'A' && *c <= 'F'))
{ {
char line[1024]; char line[1024];

View file

@ -267,6 +267,7 @@ struct _GLFWwndconfig
GLFWbool floating; GLFWbool floating;
GLFWbool maximized; GLFWbool maximized;
GLFWbool centerCursor; GLFWbool centerCursor;
GLFWbool focusOnShow;
struct { struct {
GLFWbool retina; GLFWbool retina;
char frameName[256]; char frameName[256];
@ -372,6 +373,7 @@ struct _GLFWwindow
GLFWbool decorated; GLFWbool decorated;
GLFWbool autoIconify; GLFWbool autoIconify;
GLFWbool floating; GLFWbool floating;
GLFWbool focusOnShow;
GLFWbool shouldClose; GLFWbool shouldClose;
void* userPointer; void* userPointer;
GLFWvidmode videoMode; GLFWvidmode videoMode;

View file

@ -242,7 +242,9 @@ typedef VkBool32 (APIENTRY *PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR)(
#include "egl_context.h" #include "egl_context.h"
#include "osmesa_context.h" #include "osmesa_context.h"
#define _GLFW_WNDCLASSNAME L"GLFW30" #if !defined(_GLFW_WNDCLASSNAME)
#define _GLFW_WNDCLASSNAME L"GLFW30"
#endif
#define _glfw_dlopen(name) LoadLibraryA(name) #define _glfw_dlopen(name) LoadLibraryA(name)
#define _glfw_dlclose(handle) FreeLibrary((HMODULE) handle) #define _glfw_dlclose(handle) FreeLibrary((HMODULE) handle)

View file

@ -201,6 +201,7 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
window->decorated = wndconfig.decorated; window->decorated = wndconfig.decorated;
window->autoIconify = wndconfig.autoIconify; window->autoIconify = wndconfig.autoIconify;
window->floating = wndconfig.floating; window->floating = wndconfig.floating;
window->focusOnShow = wndconfig.focusOnShow;
window->cursorMode = GLFW_CURSOR_NORMAL; window->cursorMode = GLFW_CURSOR_NORMAL;
window->minwidth = GLFW_DONT_CARE; window->minwidth = GLFW_DONT_CARE;
@ -267,6 +268,7 @@ void glfwDefaultWindowHints(void)
_glfw.hints.window.focused = GLFW_TRUE; _glfw.hints.window.focused = GLFW_TRUE;
_glfw.hints.window.autoIconify = GLFW_TRUE; _glfw.hints.window.autoIconify = GLFW_TRUE;
_glfw.hints.window.centerCursor = GLFW_TRUE; _glfw.hints.window.centerCursor = GLFW_TRUE;
_glfw.hints.window.focusOnShow = GLFW_TRUE;
// The default is 24 bits of color, 24 bits of depth and 8 bits of stencil, // The default is 24 bits of color, 24 bits of depth and 8 bits of stencil,
// double buffered // double buffered
@ -370,6 +372,9 @@ GLFWAPI void glfwWindowHint(int hint, int value)
case GLFW_CENTER_CURSOR: case GLFW_CENTER_CURSOR:
_glfw.hints.window.centerCursor = value ? GLFW_TRUE : GLFW_FALSE; _glfw.hints.window.centerCursor = value ? GLFW_TRUE : GLFW_FALSE;
return; return;
case GLFW_FOCUS_ON_SHOW:
_glfw.hints.window.focusOnShow = value ? GLFW_TRUE : GLFW_FALSE;
return;
case GLFW_CLIENT_API: case GLFW_CLIENT_API:
_glfw.hints.context.client = value; _glfw.hints.context.client = value;
return; return;
@ -755,7 +760,9 @@ GLFWAPI void glfwShowWindow(GLFWwindow* handle)
return; return;
_glfwPlatformShowWindow(window); _glfwPlatformShowWindow(window);
_glfwPlatformFocusWindow(window);
if (window->focusOnShow)
_glfwPlatformFocusWindow(window);
} }
GLFWAPI void glfwRequestWindowAttention(GLFWwindow* handle) GLFWAPI void glfwRequestWindowAttention(GLFWwindow* handle)
@ -810,6 +817,8 @@ GLFWAPI int glfwGetWindowAttrib(GLFWwindow* handle, int attrib)
return _glfwPlatformWindowMaximized(window); return _glfwPlatformWindowMaximized(window);
case GLFW_HOVERED: case GLFW_HOVERED:
return _glfwPlatformWindowHovered(window); return _glfwPlatformWindowHovered(window);
case GLFW_FOCUS_ON_SHOW:
return window->focusOnShow;
case GLFW_TRANSPARENT_FRAMEBUFFER: case GLFW_TRANSPARENT_FRAMEBUFFER:
return _glfwPlatformFramebufferTransparent(window); return _glfwPlatformFramebufferTransparent(window);
case GLFW_RESIZABLE: case GLFW_RESIZABLE:
@ -886,6 +895,8 @@ GLFWAPI void glfwSetWindowAttrib(GLFWwindow* handle, int attrib, int value)
if (!window->monitor) if (!window->monitor)
_glfwPlatformSetWindowFloating(window, value); _glfwPlatformSetWindowFloating(window, value);
} }
else if (attrib == GLFW_FOCUS_ON_SHOW)
window->focusOnShow = value;
else else
_glfwInputError(GLFW_INVALID_ENUM, "Invalid window attribute 0x%08X", attrib); _glfwInputError(GLFW_INVALID_ENUM, "Invalid window attribute 0x%08X", attrib);
} }

View file

@ -2672,8 +2672,9 @@ void _glfwPlatformPollEvents(void)
#if defined(__linux__) #if defined(__linux__)
_glfwDetectJoystickConnectionLinux(); _glfwDetectJoystickConnectionLinux();
#endif #endif
int count = XPending(_glfw.x11.display); XPending(_glfw.x11.display);
while (count--)
while (XQLength(_glfw.x11.display))
{ {
XEvent event; XEvent event;
XNextEvent(_glfw.x11.display, &event); XNextEvent(_glfw.x11.display, &event);

View file

@ -2365,7 +2365,7 @@ static void jar_xm_tick(jar_xm_context_t* ctx) {
float panning, volume; float panning, volume;
panning = ch->panning + panning = ch->panning +
(ch->panning_envelope_panning - .5f) * (.5f - fabsf(ch->panning - .5f)) * 2.0f; (ch->panning_envelope_panning - .5f) * (.5f - fabs(ch->panning - .5f)) * 2.0f;
if(ch->tremor_on) { if(ch->tremor_on) {
volume = .0f; volume = .0f;

View file

@ -1837,9 +1837,9 @@ void DrawBoundingBox(BoundingBox box, Color color)
{ {
Vector3 size; Vector3 size;
size.x = fabsf(box.max.x - box.min.x); size.x = fabs(box.max.x - box.min.x);
size.y = fabsf(box.max.y - box.min.y); size.y = fabs(box.max.y - box.min.y);
size.z = fabsf(box.max.z - box.min.z); size.z = fabs(box.max.z - box.min.z);
Vector3 center = { box.min.x + size.x/2.0f, box.min.y + size.y/2.0f, box.min.z + size.z/2.0f }; Vector3 center = { box.min.x + size.x/2.0f, box.min.y + size.y/2.0f, box.min.z + size.z/2.0f };
@ -2074,7 +2074,7 @@ RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight)
RayHitInfo result = { 0 }; RayHitInfo result = { 0 };
if (fabsf(ray.direction.y) > EPSILON) if (fabs(ray.direction.y) > EPSILON)
{ {
float distance = (ray.position.y - groundHeight)/-ray.direction.y; float distance = (ray.position.y - groundHeight)/-ray.direction.y;

Some files were not shown because too many files have changed in this diff Show more