Skip to content

Commit

Permalink
5.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
CrackedPixel committed Jul 10, 2024
1 parent 5f56fbf commit 70a273a
Show file tree
Hide file tree
Showing 196 changed files with 17,377 additions and 17,370 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
cd ${{ env.RELEASE_NAME }}
mkdir include
mkdir lib
cd ../../../raylib
cd ../../../prefix-raylib
# ${{ matrix.ARCH }}-linux-gnu-gcc -v
# TODO: Support 32bit (i386) static/shared library building
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/webassembly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
run: |
cd src
emcc -v
make PLATFORM=PLATFORM_WEB EMSDK_PATH="D:/a/raylib/raylib/emsdk-cache/emsdk-main" RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
make PLATFORM=PLATFORM_WEB EMSDK_PATH="D:/a/raylib/prefix-raylib/emsdk-cache/emsdk-main" RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
cd ..
- name: Generate Artifacts
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
cd ${{ env.RELEASE_NAME }}
mkdir include
mkdir lib
cd ../../../raylib
cd ../../../prefix-raylib
# Setup MSBuild.exe path if required
- name: Setup MSBuild
Expand Down
25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# This is a fork of raylib with the pure goal of renaming functions to prevent name conflicts for people who otherwise can't get around it.

## All credit to the original work goes to Ramon "RL_Ray" Santamaria and you should use his original project if possible.

### If you feel something else should be renamed you can let me know, open an issue, or prepare a PR.

---
<img align="left" style="width:260px" src="https://github.com/raysan5/raylib/blob/master/logo/raylib_logo_animation.gif" width="288px">

**raylib is a simple and easy-to-use library to enjoy videogames programming.**
Expand Down Expand Up @@ -40,13 +47,13 @@ features
- Written in plain C code (C99) using PascalCase/camelCase notation
- Hardware accelerated with OpenGL (**1.1, 2.1, 3.3, 4.3, ES 2.0, ES 3.0**)
- **Unique OpenGL abstraction layer** (usable as standalone module): [rlgl](https://github.com/raysan5/raylib/blob/master/src/rlgl.h)
- Multiple **Fonts** formats supported (TTF, OTF, Image fonts, AngelCode fonts)
- Multiple **Fonts** formats supported (TTF, OTF, RL_Image fonts, AngelCode fonts)
- Multiple texture formats supported, including **compressed formats** (DXT, ETC, ASTC)
- **Full 3D support**, including 3D Shapes, Models, Billboards, Heightmaps and more!
- Flexible Materials system, supporting classic maps and **PBR maps**
- **Animated 3D models** supported (skeletal bones animation) (IQM, M3D, glTF)
- 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, RL_Matrix and RL_Quaternion operations: [raymath](https://github.com/raysan5/raylib/blob/master/src/raymath.h)
- Audio loading and playing with streaming support (WAV, QOA, OGG, MP3, FLAC, XM, MOD)
- **VR stereo rendering** support with configurable HMD device parameters
- Huge examples collection with [+140 code examples](https://github.com/raysan5/raylib/tree/master/examples)!
Expand All @@ -61,17 +68,17 @@ This is a basic raylib example, it creates a window and draws the text `"Congrat

int main(void)
{
InitWindow(800, 450, "raylib [core] example - basic window");
RL_InitWindow(800, 450, "raylib [core] example - basic window");

while (!WindowShouldClose())
while (!RL_WindowShouldClose())
{
BeginDrawing();
ClearBackground(RAYWHITE);
DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
EndDrawing();
RL_BeginDrawing();
RL_ClearBackground(RL_RAYWHITE);
RL_DrawText("Congrats! You created your first window!", 190, 200, 20, RL_LIGHTGRAY);
RL_EndDrawing();
}

CloseWindow();
RL_CloseWindow();

return 0;
}
Expand Down
52 changes: 26 additions & 26 deletions examples/audio/audio_mixed_processor.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,70 +53,70 @@ int main(void)
const int screenWidth = 800;
const int screenHeight = 450;

InitWindow(screenWidth, screenHeight, "raylib [audio] example - processing mixed output");
RL_InitWindow(screenWidth, screenHeight, "raylib [audio] example - processing mixed output");

InitAudioDevice(); // Initialize audio device
RL_InitAudioDevice(); // Initialize audio device

AttachAudioMixedProcessor(ProcessAudio);
RL_AttachAudioMixedProcessor(ProcessAudio);

Music music = LoadMusicStream("resources/country.mp3");
Sound sound = LoadSound("resources/coin.wav");
RL_Music music = RL_LoadMusicStream("resources/country.mp3");
RL_Sound sound = RL_LoadSound("resources/coin.wav");

PlayMusicStream(music);
RL_PlayMusicStream(music);

SetTargetFPS(60); // Set our game to run at 60 frames-per-second
RL_SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------

// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
while (!RL_WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
UpdateMusicStream(music); // Update music buffer with new stream data
RL_UpdateMusicStream(music); // Update music buffer with new stream data

// Modify processing variables
//----------------------------------------------------------------------------------
if (IsKeyPressed(KEY_LEFT)) exponent -= 0.05f;
if (IsKeyPressed(KEY_RIGHT)) exponent += 0.05f;
if (RL_IsKeyPressed(KEY_LEFT)) exponent -= 0.05f;
if (RL_IsKeyPressed(KEY_RIGHT)) exponent += 0.05f;

if (exponent <= 0.5f) exponent = 0.5f;
if (exponent >= 3.0f) exponent = 3.0f;

if (IsKeyPressed(KEY_SPACE)) PlaySound(sound);
if (RL_IsKeyPressed(KEY_SPACE)) RL_PlaySound(sound);

// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
RL_BeginDrawing();

ClearBackground(RAYWHITE);
RL_ClearBackground(RL_RAYWHITE);

DrawText("MUSIC SHOULD BE PLAYING!", 255, 150, 20, LIGHTGRAY);
RL_DrawText("MUSIC SHOULD BE PLAYING!", 255, 150, 20, RL_LIGHTGRAY);

DrawText(TextFormat("EXPONENT = %.2f", exponent), 215, 180, 20, LIGHTGRAY);
RL_DrawText(RL_TextFormat("EXPONENT = %.2f", exponent), 215, 180, 20, RL_LIGHTGRAY);

DrawRectangle(199, 199, 402, 34, LIGHTGRAY);
RL_DrawRectangle(199, 199, 402, 34, RL_LIGHTGRAY);
for (int i = 0; i < 400; i++)
{
DrawLine(201 + i, 232 - (int)averageVolume[i] * 32, 201 + i, 232, MAROON);
RL_DrawLine(201 + i, 232 - (int)averageVolume[i] * 32, 201 + i, 232, RL_MAROON);
}
DrawRectangleLines(199, 199, 402, 34, GRAY);
RL_DrawRectangleLines(199, 199, 402, 34, RL_GRAY);

DrawText("PRESS SPACE TO PLAY OTHER SOUND", 200, 250, 20, LIGHTGRAY);
DrawText("USE LEFT AND RIGHT ARROWS TO ALTER DISTORTION", 140, 280, 20, LIGHTGRAY);
RL_DrawText("PRESS SPACE TO PLAY OTHER SOUND", 200, 250, 20, RL_LIGHTGRAY);
RL_DrawText("USE LEFT AND RIGHT ARROWS TO ALTER DISTORTION", 140, 280, 20, RL_LIGHTGRAY);

EndDrawing();
RL_EndDrawing();
//----------------------------------------------------------------------------------
}

// De-Initialization
//--------------------------------------------------------------------------------------
UnloadMusicStream(music); // Unload music stream buffers from RAM
RL_UnloadMusicStream(music); // Unload music stream buffers from RAM

DetachAudioMixedProcessor(ProcessAudio); // Disconnect audio processor
RL_DetachAudioMixedProcessor(ProcessAudio); // Disconnect audio processor

CloseAudioDevice(); // Close audio device (music streaming is automatically stopped)
RL_CloseAudioDevice(); // Close audio device (music streaming is automatically stopped)

CloseWindow(); // Close window and OpenGL context
RL_CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------

return 0;
Expand Down
100 changes: 50 additions & 50 deletions examples/audio/audio_module_playing.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
#define MAX_CIRCLES 64

typedef struct {
Vector2 position;
RL_Vector2 position;
float radius;
float alpha;
float speed;
Color color;
RL_Color color;
} CircleWave;

//------------------------------------------------------------------------------------
Expand All @@ -33,73 +33,73 @@ int main(void)
const int screenWidth = 800;
const int screenHeight = 450;

SetConfigFlags(FLAG_MSAA_4X_HINT); // NOTE: Try to enable MSAA 4X
RL_SetConfigFlags(FLAG_MSAA_4X_HINT); // NOTE: Try to enable MSAA 4X

InitWindow(screenWidth, screenHeight, "raylib [audio] example - module playing (streaming)");
RL_InitWindow(screenWidth, screenHeight, "raylib [audio] example - module playing (streaming)");

InitAudioDevice(); // Initialize audio device
RL_InitAudioDevice(); // Initialize audio device

Color colors[14] = { ORANGE, RED, GOLD, LIME, BLUE, VIOLET, BROWN, LIGHTGRAY, PINK,
YELLOW, GREEN, SKYBLUE, PURPLE, BEIGE };
RL_Color colors[14] = { RL_ORANGE, RL_RED, RL_GOLD, RL_LIME, RL_BLUE, RL_VIOLET, RL_BROWN, RL_LIGHTGRAY, RL_PINK,
RL_YELLOW, RL_GREEN, RL_SKYBLUE, RL_PURPLE, RL_BEIGE };

// Creates some circles for visual effect
CircleWave circles[MAX_CIRCLES] = { 0 };

for (int i = MAX_CIRCLES - 1; i >= 0; i--)
{
circles[i].alpha = 0.0f;
circles[i].radius = (float)GetRandomValue(10, 40);
circles[i].position.x = (float)GetRandomValue((int)circles[i].radius, (int)(screenWidth - circles[i].radius));
circles[i].position.y = (float)GetRandomValue((int)circles[i].radius, (int)(screenHeight - circles[i].radius));
circles[i].speed = (float)GetRandomValue(1, 100)/2000.0f;
circles[i].color = colors[GetRandomValue(0, 13)];
circles[i].radius = (float)RL_GetRandomValue(10, 40);
circles[i].position.x = (float)RL_GetRandomValue((int)circles[i].radius, (int)(screenWidth - circles[i].radius));
circles[i].position.y = (float)RL_GetRandomValue((int)circles[i].radius, (int)(screenHeight - circles[i].radius));
circles[i].speed = (float)RL_GetRandomValue(1, 100)/2000.0f;
circles[i].color = colors[RL_GetRandomValue(0, 13)];
}

Music music = LoadMusicStream("resources/mini1111.xm");
RL_Music music = RL_LoadMusicStream("resources/mini1111.xm");
music.looping = false;
float pitch = 1.0f;

PlayMusicStream(music);
RL_PlayMusicStream(music);

float timePlayed = 0.0f;
bool pause = false;

SetTargetFPS(60); // Set our game to run at 60 frames-per-second
RL_SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------

// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
while (!RL_WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
UpdateMusicStream(music); // Update music buffer with new stream data
RL_UpdateMusicStream(music); // Update music buffer with new stream data

// Restart music playing (stop and play)
if (IsKeyPressed(KEY_SPACE))
if (RL_IsKeyPressed(KEY_SPACE))
{
StopMusicStream(music);
PlayMusicStream(music);
RL_StopMusicStream(music);
RL_PlayMusicStream(music);
pause = false;
}

// Pause/Resume music playing
if (IsKeyPressed(KEY_P))
if (RL_IsKeyPressed(KEY_P))
{
pause = !pause;

if (pause) PauseMusicStream(music);
else ResumeMusicStream(music);
if (pause) RL_PauseMusicStream(music);
else RL_ResumeMusicStream(music);
}

if (IsKeyDown(KEY_DOWN)) pitch -= 0.01f;
else if (IsKeyDown(KEY_UP)) pitch += 0.01f;
if (RL_IsKeyDown(KEY_DOWN)) pitch -= 0.01f;
else if (RL_IsKeyDown(KEY_UP)) pitch += 0.01f;

SetMusicPitch(music, pitch);
RL_SetMusicPitch(music, pitch);

// Get timePlayed scaled to bar dimensions
timePlayed = GetMusicTimePlayed(music)/GetMusicTimeLength(music)*(screenWidth - 40);
timePlayed = RL_GetMusicTimePlayed(music)/RL_GetMusicTimeLength(music)*(screenWidth - 40);

// Color circles animation
// RL_Color circles animation
for (int i = MAX_CIRCLES - 1; (i >= 0) && !pause; i--)
{
circles[i].alpha += circles[i].speed;
Expand All @@ -110,50 +110,50 @@ int main(void)
if (circles[i].alpha <= 0.0f)
{
circles[i].alpha = 0.0f;
circles[i].radius = (float)GetRandomValue(10, 40);
circles[i].position.x = (float)GetRandomValue((int)circles[i].radius, (int)(screenWidth - circles[i].radius));
circles[i].position.y = (float)GetRandomValue((int)circles[i].radius, (int)(screenHeight - circles[i].radius));
circles[i].color = colors[GetRandomValue(0, 13)];
circles[i].speed = (float)GetRandomValue(1, 100)/2000.0f;
circles[i].radius = (float)RL_GetRandomValue(10, 40);
circles[i].position.x = (float)RL_GetRandomValue((int)circles[i].radius, (int)(screenWidth - circles[i].radius));
circles[i].position.y = (float)RL_GetRandomValue((int)circles[i].radius, (int)(screenHeight - circles[i].radius));
circles[i].color = colors[RL_GetRandomValue(0, 13)];
circles[i].speed = (float)RL_GetRandomValue(1, 100)/2000.0f;
}
}
//----------------------------------------------------------------------------------

// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
RL_BeginDrawing();

ClearBackground(RAYWHITE);
RL_ClearBackground(RL_RAYWHITE);

for (int i = MAX_CIRCLES - 1; i >= 0; i--)
{
DrawCircleV(circles[i].position, circles[i].radius, Fade(circles[i].color, circles[i].alpha));
RL_DrawCircleV(circles[i].position, circles[i].radius, RL_Fade(circles[i].color, circles[i].alpha));
}

// Draw time bar
DrawRectangle(20, screenHeight - 20 - 12, screenWidth - 40, 12, LIGHTGRAY);
DrawRectangle(20, screenHeight - 20 - 12, (int)timePlayed, 12, MAROON);
DrawRectangleLines(20, screenHeight - 20 - 12, screenWidth - 40, 12, GRAY);
RL_DrawRectangle(20, screenHeight - 20 - 12, screenWidth - 40, 12, RL_LIGHTGRAY);
RL_DrawRectangle(20, screenHeight - 20 - 12, (int)timePlayed, 12, RL_MAROON);
RL_DrawRectangleLines(20, screenHeight - 20 - 12, screenWidth - 40, 12, RL_GRAY);

// Draw help instructions
DrawRectangle(20, 20, 425, 145, WHITE);
DrawRectangleLines(20, 20, 425, 145, GRAY);
DrawText("PRESS SPACE TO RESTART MUSIC", 40, 40, 20, BLACK);
DrawText("PRESS P TO PAUSE/RESUME", 40, 70, 20, BLACK);
DrawText("PRESS UP/DOWN TO CHANGE SPEED", 40, 100, 20, BLACK);
DrawText(TextFormat("SPEED: %f", pitch), 40, 130, 20, MAROON);

EndDrawing();
RL_DrawRectangle(20, 20, 425, 145, RL_WHITE);
RL_DrawRectangleLines(20, 20, 425, 145, RL_GRAY);
RL_DrawText("PRESS SPACE TO RESTART MUSIC", 40, 40, 20, RL_BLACK);
RL_DrawText("PRESS P TO PAUSE/RESUME", 40, 70, 20, RL_BLACK);
RL_DrawText("PRESS UP/DOWN TO CHANGE SPEED", 40, 100, 20, RL_BLACK);
RL_DrawText(RL_TextFormat("SPEED: %f", pitch), 40, 130, 20, RL_MAROON);

RL_EndDrawing();
//----------------------------------------------------------------------------------
}

// De-Initialization
//--------------------------------------------------------------------------------------
UnloadMusicStream(music); // Unload music stream buffers from RAM
RL_UnloadMusicStream(music); // Unload music stream buffers from RAM

CloseAudioDevice(); // Close audio device (music streaming is automatically stopped)
RL_CloseAudioDevice(); // Close audio device (music streaming is automatically stopped)

CloseWindow(); // Close window and OpenGL context
RL_CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------

return 0;
Expand Down
Loading

0 comments on commit 70a273a

Please sign in to comment.