mirror of
https://github.com/raylib-cs/raylib-cs
synced 2025-06-30 19:03:42 -04:00
Fixed trailing whitespace
- Removed trailing whitespace from bindings and examples.
This commit is contained in:
@ -13,8 +13,8 @@ public partial class bunnymark
|
||||
* Copyright (c) 2014 Ramon Santamaria (@raysan5)
|
||||
*
|
||||
********************************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
public const int MAX_BUNNIES = 100000;
|
||||
|
||||
struct Bunny
|
||||
@ -23,25 +23,25 @@ public partial class bunnymark
|
||||
public Vector2 speed;
|
||||
public Color color;
|
||||
}
|
||||
|
||||
|
||||
public static int Main()
|
||||
{
|
||||
// Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
int screenWidth = 1280;
|
||||
int screenHeight = 960;
|
||||
|
||||
|
||||
InitWindow(screenWidth, screenHeight, "raylib example - Bunnymark");
|
||||
|
||||
|
||||
Texture2D texBunny = LoadTexture("resources/wabbit_alpha.png");
|
||||
|
||||
|
||||
Bunny[] bunnies = new Bunny[MAX_BUNNIES]; // Bunnies array
|
||||
|
||||
|
||||
int bunniesCount = 0; // Bunnies counter
|
||||
|
||||
|
||||
SetTargetFPS(60);
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
// Main game loop
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
{
|
||||
@ -58,24 +58,24 @@ public partial class bunnymark
|
||||
bunniesCount++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Update bunnies
|
||||
for (int i = 0; i < bunniesCount; i++)
|
||||
{
|
||||
bunnies[i].position.x += bunnies[i].speed.x;
|
||||
bunnies[i].position.y += bunnies[i].speed.y;
|
||||
|
||||
|
||||
if ((bunnies[i].position.x > GetScreenWidth()) || (bunnies[i].position.x < 0)) bunnies[i].speed.x *= -1;
|
||||
if ((bunnies[i].position.y > GetScreenHeight()) || (bunnies[i].position.y < 0)) bunnies[i].speed.y *= -1;
|
||||
}
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
|
||||
for (int i = 0; i < bunniesCount; i++)
|
||||
{
|
||||
// NOTE: When internal QUADS batch limit is reached, a draw call is launched and
|
||||
@ -84,23 +84,23 @@ public partial class bunnymark
|
||||
// a stall and consequently a frame drop, limiting number of bunnies drawn at 60 fps
|
||||
DrawTexture(texBunny, (int)bunnies[i].position.x, (int)bunnies[i].position.y, RAYWHITE);
|
||||
}
|
||||
|
||||
|
||||
DrawRectangle(0, 0, screenWidth, 40, LIGHTGRAY);
|
||||
DrawText("raylib bunnymark", 10, 10, 20, DARKGRAY);
|
||||
// DrawText(FormatText("bunnies: %i", bunniesCount), 400, 10, 20, RED);
|
||||
DrawText($"bunnies: {bunniesCount}", 400, 10, 20, RED);
|
||||
DrawFPS(260, 10);
|
||||
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user