aboutsummaryrefslogtreecommitdiff
path: root/examples/ex03b_input_mouse.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/ex03b_input_mouse.c')
-rw-r--r--examples/ex03b_input_mouse.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/examples/ex03b_input_mouse.c b/examples/ex03b_input_mouse.c
index db713fac..690c4c4b 100644
--- a/examples/ex03b_input_mouse.c
+++ b/examples/ex03b_input_mouse.c
@@ -13,6 +13,8 @@
int main()
{
+ // Initialization
+ //--------------------------------------------------------------------------------------
int screenWidth = 800;
int screenHeight = 450;
@@ -20,16 +22,14 @@ int main()
int counter = 0;
int mouseX, mouseY;
- // Initialization
- //---------------------------------------------------------
InitWindow(screenWidth, screenHeight, "raylib example 06 - mouse input");
- //----------------------------------------------------------
+ //---------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
- //-----------------------------------------------------
+ //----------------------------------------------------------------------------------
if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON))
{
mouseX = GetMouseX();
@@ -38,26 +38,26 @@ int main()
ballPosition.x = (float)mouseX;
ballPosition.y = (float)mouseY;
}
- //-----------------------------------------------------
+ //----------------------------------------------------------------------------------
// Draw
- //-----------------------------------------------------
+ //----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
DrawCircleV(ballPosition, 40, GOLD);
- DrawText("mouse click to draw the ball", 10, 10, 20, 1, DARKGRAY);
+ DrawText("mouse click to draw the ball", 10, 10, 20, DARKGRAY);
EndDrawing();
- //-----------------------------------------------------
+ //----------------------------------------------------------------------------------
}
// De-Initialization
- //---------------------------------------------------------
+ //--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
- //----------------------------------------------------------
+ //--------------------------------------------------------------------------------------
return 0;
} \ No newline at end of file