Skip to content

Commit 54b754c

Browse files
authored
Merge pull request #168 from RobLoach/update-raylib-4.5.0
Update to raylib v4.5.0
2 parents 14622a8 + 14f4bf6 commit 54b754c

19 files changed

+6400
-5136
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ set(CMAKE_CXX_FLAGS_DEBUG "-g")
2323
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
2424

2525
# version doesn't seem to pick correct version
26-
#find_package(raylib 4.2 QUIET EXACT)
26+
#find_package(raylib 4.5 QUIET EXACT)
2727
if (NOT raylib_FOUND)
2828
include(FetchContent)
2929
FetchContent_Declare(
3030
raylib
3131
GIT_REPOSITORY https://github.com/raysan5/raylib.git
32-
GIT_TAG 4.2.0
32+
GIT_TAG 4.5.0
3333
GIT_SHALLOW TRUE
3434
)
3535
FetchContent_GetProperties(raylib)

docs/API.md

Lines changed: 633 additions & 398 deletions
Large diffs are not rendered by default.

drm/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ raylib.MAX_GAMEPAD_BUTTONS = 32
1414
raylib.MAX_TOUCH_POINTS = 10
1515
raylib.MAX_KEY_PRESSED_QUEUE = 16
1616
raylib.DEG2RAD = Math.PI / 180
17+
1718
// Wrapped Functions
1819

1920
/**
@@ -32,5 +33,6 @@ raylib.rlColor4ub = (r, g, b, a) => {
3233
// workaround as the C addon version isn't compiling?
3334
raylib.rlColor4f(r / 255, g / 255, b / 255, a / 255)
3435
}
36+
3537
// Export the bindings for the module.
3638
module.exports = raylib

examples/core/core_3d_camera_first_person.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,14 @@ for (let i = 0; i < MAX_COLUMNS; i++) {
4141
colors.push(r.Color(r.GetRandomValue(20, 255), r.GetRandomValue(10, 55), 30, 255))
4242
}
4343

44-
r.SetCameraMode(camera, r.CAMERA_FIRST_PERSON) // Set a first person camera mode
45-
4644
r.SetTargetFPS(60) // Set our game to run at 60 frames-per-second
4745
// --------------------------------------------------------------------------------------
4846

4947
// Main game loop
5048
while (!r.WindowShouldClose()) { // Detect window close button or ESC key
5149
// Update
5250
// ----------------------------------------------------------------------------------
53-
r.UpdateCamera(camera) // Update camera
51+
r.UpdateCamera(camera, r.CAMERA_FIRST_PERSON) // Update camera
5452
// ----------------------------------------------------------------------------------
5553

5654
// Draw

examples/core/core_vr_simulator.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,14 @@ camera.type = r.CAMERA_PERSPECTIVE // Camera type
6969

7070
const cubePosition = r.Vector3()
7171

72-
r.SetCameraMode(camera, r.CAMERA_FIRST_PERSON) // Set first person camera mode
73-
7472
r.SetTargetFPS(90) // Set our game to run at 90 frames-per-second
7573
// --------------------------------------------------------------------------------------
7674

7775
// Main game loop
7876
while (!r.WindowShouldClose()) { // Detect window close button or ESC key
7977
// Update
8078
// ----------------------------------------------------------------------------------
81-
r.UpdateCamera(camera) // Update camera (simulator mode)
79+
r.UpdateCamera(camera, r.CAMERA_FIRST_PERSON) // Update camera (simulator mode)
8280

8381
if (r.IsKeyPressed(r.KEY_SPACE)) r.ToggleVrMode() // Toggle VR mode
8482
// ----------------------------------------------------------------------------------

examples/core/core_world_screen.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,14 @@ const camera = r.Camera(
3030
const cubePosition = r.Vector3()
3131
let cubeScreenPosition = r.Vector2()
3232

33-
r.SetCameraMode(camera, r.CAMERA_FREE) // Set a free camera mode
34-
3533
r.SetTargetFPS(60) // Set our game to run at 60 frames-per-second
3634
// --------------------------------------------------------------------------------------
3735

3836
// Main game loop
3937
while (!r.WindowShouldClose()) { // Detect window close button or ESC key
4038
// Update
4139
// ----------------------------------------------------------------------------------
42-
r.UpdateCamera(camera) // Update camera
40+
r.UpdateCamera(camera, r.CAMERA_FREE) // Update camera
4341

4442
// Calculate cube screen space position (with a little offset to be in top)
4543
const cubePositionVector = r.Vector3(cubePosition.x, cubePosition.y + 2.5, cubePosition.z)

examples/models/models_billboard.js

Lines changed: 0 additions & 70 deletions
This file was deleted.

examples/models/models_rlgl_solar_system.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ const camera = {
4343
projection: r.CAMERA_PERSPECTIVE
4444
}
4545

46-
r.SetCameraMode(camera, r.CAMERA_FREE)
47-
4846
const rotationSpeed = 0.2 // General system rotation speed
4947

5048
let earthRotation = 0.0 // Rotation of earth around itself (days) in degrees
@@ -59,7 +57,7 @@ r.SetTargetFPS(60) // Set our game to run at 60 frames-per-second
5957
while (!r.WindowShouldClose()) {
6058
// Update
6159
// ----------------------------------------------------------------------------------
62-
r.UpdateCamera(camera)
60+
r.UpdateCamera(camera, r.CAMERA_FREE)
6361

6462
earthRotation += (5.0 * rotationSpeed)
6563
earthOrbitRotation += (365 / 360.0 * (5.0 * rotationSpeed) * rotationSpeed)

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ raylib.MAX_GAMEPAD_BUTTONS = 32
1414
raylib.MAX_TOUCH_POINTS = 10
1515
raylib.MAX_KEY_PRESSED_QUEUE = 16
1616
raylib.DEG2RAD = Math.PI / 180
17+
1718
// Wrapped Functions
1819

1920
/**
@@ -32,5 +33,6 @@ raylib.rlColor4ub = (r, g, b, a) => {
3233
// workaround as the C addon version isn't compiling?
3334
raylib.rlColor4f(r / 255, g / 255, b / 255, a / 255)
3435
}
36+
3537
// Export the bindings for the module.
3638
module.exports = raylib

0 commit comments

Comments
 (0)