Skip to content

Commit

Permalink
rename to use RAYLIB_ prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
BBBmau committed Dec 6, 2024
1 parent b936b1d commit 2d84540
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions system/ui/raylib/spinner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ int main(int argc, char *argv[]) {

while (!WindowShouldClose()) {
BeginDrawing();
ClearBackground(COLOR_BLACK);
ClearBackground(RAYLIB_BLACK);

rotation = fmod(rotation + kRotationRate, 360.0f);
Vector2 center = {GetScreenWidth() / 2.0f, GetScreenHeight() / 2.0f};
Expand All @@ -37,8 +37,8 @@ int main(int argc, char *argv[]) {
// Draw rotating spinner and static comma logo
DrawTexturePro(spinnerTexture, {0, 0, (float)kTextureSize, (float)kTextureSize},
{center.x, center.y, (float)kTextureSize, (float)kTextureSize},
spinnerOrigin, rotation, COLOR_WHITE);
DrawTextureV(commaTexture, commaPosition, COLOR_WHITE);
spinnerOrigin, rotation, RAYLIB_WHITE);
DrawTextureV(commaTexture, commaPosition, RAYLIB_WHITE);

// Check for user input
if (std::cin.rdbuf()->in_avail() > 0) {
Expand All @@ -50,14 +50,14 @@ int main(int argc, char *argv[]) {
float yPos = GetScreenHeight() - kMargin - kProgressBarHeight;
if (std::all_of(userInput.begin(), userInput.end(), ::isdigit)) {
Rectangle bar = {center.x - kProgressBarWidth / 2.0f, yPos, kProgressBarWidth, kProgressBarHeight};
DrawRectangleRounded(bar, 0.5f, 10, COLOR_GRAY);
DrawRectangleRounded(bar, 0.5f, 10, RAYLIB_GRAY);

int progress = std::clamp(std::stoi(userInput), 0, 100);
bar.width *= progress / 100.0f;
DrawRectangleRounded(bar, 0.5f, 10, COLOR_RAYWHITE);
DrawRectangleRounded(bar, 0.5f, 10, RAYLIB_RAYWHITE);
} else {
Vector2 textSize = MeasureTextEx(getFont(), userInput.c_str(), kFontSize, 1.0);
DrawTextEx(getFont(), userInput.c_str(), {center.x - textSize.x / 2, yPos}, kFontSize, 1.0, COLOR_WHITE);
DrawTextEx(getFont(), userInput.c_str(), {center.x - textSize.x / 2, yPos}, kFontSize, 1.0, RAYLIB_WHITE);
}
}

Expand Down

0 comments on commit 2d84540

Please sign in to comment.