Skip to content

Commit

Permalink
3.5.0-beta3
Browse files Browse the repository at this point in the history
  • Loading branch information
RobLoach committed Feb 18, 2021
1 parent 24052dd commit d1c5ef2
Show file tree
Hide file tree
Showing 32 changed files with 189 additions and 74 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [x.x.x] - Unreleased
## [3.5.0-beta3] - 2021-02-18
### Added
- Added a C++ version of raylib's loading thread example (by (@pkeir)[https://github.com/pkeir])
- Updated documentation
### Fixed
- Made the global wrapped functions static to avoid redeclaration

Expand Down
2 changes: 1 addition & 1 deletion CPPLINT.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set noparent
root=..
linelength=100
linelength=120
exclude_files=vendor
exclude_files=docs
filter=-runtime/explicit
6 changes: 3 additions & 3 deletions examples/audio/audio_music_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ int main() {
//--------------------------------------------------------------------------------------

// Main game loop
while (!window.ShouldClose()) // Detect window close button or ESC key
while (!window.ShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
Expand Down Expand Up @@ -63,7 +63,7 @@ int main() {
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();

{
ClearBackground(RAYWHITE);

DrawText("MUSIC SHOULD BE PLAYING!", 255, 150, 20, LIGHTGRAY);
Expand All @@ -74,7 +74,7 @@ int main() {

DrawText("PRESS SPACE TO RESTART MUSIC", 215, 250, 20, LIGHTGRAY);
DrawText("PRESS P TO PAUSE/RESUME MUSIC", 208, 280, 20, LIGHTGRAY);

}
EndDrawing();
//----------------------------------------------------------------------------------
}
Expand Down
4 changes: 2 additions & 2 deletions examples/audio/audio_sound_loading.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ int main() {
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();

{
ClearBackground(RAYWHITE);

DrawText("Press SPACE to PLAY the WAV sound!", 200, 180, 20, LIGHTGRAY);
DrawText("Press ENTER to PLAY the OGG sound!", 200, 220, 20, LIGHTGRAY);

}
EndDrawing();
//----------------------------------------------------------------------------------
}
Expand Down
14 changes: 7 additions & 7 deletions examples/core/core_3d_camera_first_person.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ int main() {

camera.SetMode(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
//--------------------------------------------------------------------------------------

// Main game loop
while (!window.ShouldClose()) // Detect window close button or ESC key
while (!window.ShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
Expand All @@ -58,11 +58,11 @@ int main() {
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();

{
background.ClearBackground();

camera.BeginMode();

{
DrawPlane(Vector3{ 0.0f, 0.0f, 0.0f }, Vector2{ 32.0f, 32.0f }, LIGHTGRAY); // Draw ground
DrawCube(Vector3{ -16.0f, 2.5f, 0.0f }, 1.0f, 5.0f, 32.0f, BLUE); // Draw a blue wall
DrawCube(Vector3{ 16.0f, 2.5f, 0.0f }, 1.0f, 5.0f, 32.0f, LIME); // Draw a green wall
Expand All @@ -74,16 +74,16 @@ int main() {
positions[i].DrawCube(2.0f, heights[i], 2.0f, colors[i]);
positions[i].DrawCubeWires(2.0f, heights[i], 2.0f, MAROON);
}

}
camera.EndMode();

DrawRectangle( 10, 10, 220, 70, Fade(SKYBLUE, 0.5f));
DrawRectangle( 10, 10, 220, 70, raylib::Color::SkyBlue().Fade(0.5f));
DrawRectangleLines( 10, 10, 220, 70, BLUE);

DrawText("First person camera default controls:", 20, 20, 10, BLACK);
DrawText("- Move with keys: W, A, S, D", 40, 40, 10, DARKGRAY);
DrawText("- Mouse move to look around", 40, 60, 10, DARKGRAY);

}
EndDrawing();
//----------------------------------------------------------------------------------
}
Expand Down
9 changes: 4 additions & 5 deletions examples/core/core_basic_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,10 @@ int main() {
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();

ClearBackground(RAYWHITE);

textColor.DrawText("Congrats! You created your first window!", 190, 200, 20);

{
ClearBackground(RAYWHITE);
textColor.DrawText("Congrats! You created your first window!", 190, 200, 20);
}
EndDrawing();
//----------------------------------------------------------------------------------
}
Expand Down
4 changes: 2 additions & 2 deletions examples/core/core_drop_files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ int main() {

// Iterate through all the dropped files.
for (int i = 0; i < droppedFiles.size(); i++) {
if (i%2 == 0)
if (i % 2 == 0)
DrawRectangle(0, 85 + 40*i, screenWidth, 40, Fade(LIGHTGRAY, 0.5f));
else
DrawRectangle(0, 85 + 40*i, screenWidth, 40, Fade(LIGHTGRAY, 0.3f));

// Display the path to the dropped file.
DrawText(droppedFiles[i].c_str(), 120, 100 + 40*i, 10, GRAY);
DrawText(droppedFiles[i].c_str(), 120, 100 + 40 * i, 10, GRAY);
}

DrawText("Drop new files...", 100, 110 + 40 * droppedFiles.size(), 20, DARKGRAY);
Expand Down
4 changes: 2 additions & 2 deletions examples/core/core_input_mouse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ int main() {
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();

{
background.ClearBackground();

ballPosition.DrawCircle(40, ballColor);

textColor.DrawText("move ball with mouse and click mouse button to change color", 10, 10, 20);

}
EndDrawing();
//----------------------------------------------------------------------------------
}
Expand Down
5 changes: 2 additions & 3 deletions examples/core/core_loading_thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ int main(void)
// Draw
//----------------------------------------------------------------------
BeginDrawing();
{

ClearBackground(RAYWHITE);

Expand All @@ -110,12 +111,10 @@ int main(void)
DrawRectangle(150, 200, 500, 60, LIME);
DrawText("DATA LOADED!", 250, 210, 40, GREEN);
break;

default:
break;
}

DrawRectangleLines(150, 200, 500, 60, DARKGRAY);
}

EndDrawing();
//----------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions examples/core/core_random_values.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ int main() {
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();

{
ClearBackground(RAYWHITE);

DrawText("Every 2 seconds a new random value is generated:", 130, 100, 20, MAROON);

DrawText(FormatText("%i", randValue), 360, 180, 80, LIGHTGRAY);

}
EndDrawing();
//----------------------------------------------------------------------------------
}
Expand Down
12 changes: 6 additions & 6 deletions examples/core/core_world_screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,21 @@ int main() {
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();

{
ClearBackground(RAYWHITE);

BeginMode3D(camera);

camera.BeginMode();
{
DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED);
DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, MAROON);

DrawGrid(10, 1.0f);

EndMode3D();
}
camera.EndMode();

DrawText("Enemy: 100 / 100", cubeScreenPosition.x - MeasureText("Enemy: 100/100", 20)/2, cubeScreenPosition.y, 20, BLACK);
DrawText("Text is always on top of the cube", (screenWidth - MeasureText("Text is always on top of the cube", 20))/2, 25, 20, GRAY);

}
EndDrawing();
//----------------------------------------------------------------------------------
}
Expand Down
8 changes: 4 additions & 4 deletions examples/models/models_billboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,19 @@ int main() {
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
{

ClearBackground(RAYWHITE);

camera.BeginMode();

{
DrawGrid(10, 1.0f); // Draw a grid

camera.DrawBillboard(bill, billPosition, 2.0f, WHITE);

}
camera.EndMode();

DrawFPS(10, 10);

}
EndDrawing();
//----------------------------------------------------------------------------------
}
Expand Down
8 changes: 4 additions & 4 deletions examples/models/models_first_person_maze.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ int main(void)
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();

{
ClearBackground(RAYWHITE);

camera.BeginMode();

{
model.Draw(mapPosition); // Draw maze map
// playerPosition.DrawCube((Vector3){ 0.2f, 0.4f, 0.2f }, RED); // Draw player

}
camera.EndMode();

cubicmap.Draw((Vector2){ static_cast<float>(GetScreenWidth() - cubicmap.width*4 - 20), 20 }, 0.0f, 4.0f, WHITE);
Expand All @@ -105,7 +105,7 @@ int main(void)
DrawRectangle(GetScreenWidth() - cubicmap.width*4 - 20 + playerCellX*4, 20 + playerCellY*4, 4, 4, RED);

DrawFPS(10, 10);

}
EndDrawing();
//----------------------------------------------------------------------------------
}
Expand Down
4 changes: 2 additions & 2 deletions examples/multiple/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

Player::Player() {
position = Rectangle{
GetScreenWidth() / 2 - 50,
GetScreenHeight() / 2 - 50,
GetScreenWidth() / 2.0f - 50,
GetScreenHeight() / 2.0f - 50,
100,
100
};
Expand Down
8 changes: 5 additions & 3 deletions examples/multiple/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ int main() {
Player player;
while (!window.ShouldClose()) {
window.BeginDrawing();
ClearBackground(SKYBLUE);
player.Update();
player.Draw();
{
ClearBackground(SKYBLUE);
player.Update();
player.Draw();
}
window.EndDrawing();
}

Expand Down
4 changes: 2 additions & 2 deletions examples/physics/physics_demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ int main(void)
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();

{
ClearBackground(BLACK);

DrawFPS(screenWidth - 90, screenHeight - 30);
Expand Down Expand Up @@ -126,7 +126,7 @@ int main(void)

DrawText("Physac", logoX, logoY, 30, WHITE);
DrawText("Powered by", logoX + 50, logoY - 7, 10, WHITE);

}
EndDrawing();
//----------------------------------------------------------------------------------
}
Expand Down
1 change: 0 additions & 1 deletion examples/shapes/shapes_collision_area.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ int main(void)
raylib::Rectangle boxB(GetScreenWidth()/2 - 30, GetScreenHeight()/2 - 30, 60, 60);

raylib::Rectangle boxCollision(0); // Collision rectangle
///raylib::Rectangle boxCollision(0,0); // Collision rectangle

int screenUpperLimit = 40; // Top menu limits

Expand Down
4 changes: 2 additions & 2 deletions examples/shapes/shapes_logo_raylib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ int main() {
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();

{
background.ClearBackground();

foreground.DrawRectangle(screenWidth/2 - 128, screenHeight/2 - 128, 256, 256);
Expand All @@ -44,7 +44,7 @@ int main() {
foreground.DrawText("cpp", screenWidth/2 - 74, screenHeight/2 + 54, 50);

DrawText("this is NOT a texture!", 350, 370, 10, GRAY);

}
EndDrawing();
//----------------------------------------------------------------------------------
}
Expand Down
5 changes: 3 additions & 2 deletions examples/text/text_font_loading.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ int main() {
// Draw
//----------------------------------------------------------------------------------
window.BeginDrawing();
{

ClearBackground(RAYWHITE);

Expand All @@ -74,8 +75,8 @@ int main() {
fontTtf.DrawText(msg, (Vector2){ 20.0f, 100.0f }, fontTtf.baseSize, 2, LIME);
DrawText("Using TTF font generated", 20, GetScreenHeight() - 30, 20, GRAY);
}

EndDrawing();
}
window.EndDrawing();
//----------------------------------------------------------------------------------
}

Expand Down
4 changes: 2 additions & 2 deletions examples/text/text_font_spritefont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ int main(void)
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();

{
ClearBackground(RAYWHITE);

font1.DrawText(msg1, fontPosition1, font1.baseSize, -3);
font2.DrawText(msg2, fontPosition2, font2.baseSize, -2);
font3.DrawText(msg3, fontPosition3, font3.baseSize, 2);

}
EndDrawing();
//----------------------------------------------------------------------------------
}
Expand Down
4 changes: 2 additions & 2 deletions examples/text/text_raylib_fonts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ int main() {
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();

{
background.ClearBackground();

textColor.DrawText("free fonts included with raylib", 250, 20, 20);
Expand All @@ -92,7 +92,7 @@ int main() {
{
fonts[i].DrawText(messages[i], positions[i], fonts[i].baseSize*2, spacings[i], colors[i]);
}

}
EndDrawing();
//----------------------------------------------------------------------------------
}
Expand Down
Loading

0 comments on commit d1c5ef2

Please sign in to comment.