diff options
| author | raysan5 <raysan5@gmail.com> | 2016-01-16 12:52:55 +0100 |
|---|---|---|
| committer | raysan5 <raysan5@gmail.com> | 2016-01-16 12:52:55 +0100 |
| commit | 183795b8aa78fdf0b8064d72d77eaea8e7b6397b (patch) | |
| tree | 1d18bec6a5510d3c225f05d09cc9649492cb4209 /examples/core_input_mouse.c | |
| parent | 91e00431d48ad90602af30ee015922243cf975cd (diff) | |
| download | raylib-183795b8aa78fdf0b8064d72d77eaea8e7b6397b.tar.gz raylib-183795b8aa78fdf0b8064d72d77eaea8e7b6397b.zip | |
Review literals type
Diffstat (limited to 'examples/core_input_mouse.c')
| -rw-r--r-- | examples/core_input_mouse.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/examples/core_input_mouse.c b/examples/core_input_mouse.c index c64b421e..358b5fd6 100644 --- a/examples/core_input_mouse.c +++ b/examples/core_input_mouse.c @@ -20,8 +20,9 @@ int main() InitWindow(screenWidth, screenHeight, "raylib [core] example - mouse input"); - int mouseX, mouseY; - Vector2 ballPosition = { -100.0, -100.0 }; + Vector2 ballPosition = { -100.0f, -100.0f }; + + SetTargetFPS(60); //--------------------------------------------------------------------------------------- // Main game loop @@ -31,11 +32,7 @@ int main() //---------------------------------------------------------------------------------- if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) { - mouseX = GetMouseX(); - mouseY = GetMouseY(); - - ballPosition.x = (float)mouseX; - ballPosition.y = (float)mouseY; + ballPosition = GetMousePosition(); } //---------------------------------------------------------------------------------- |
