diff options
| author | victorfisac <[email protected]> | 2016-01-20 13:48:00 +0100 |
|---|---|---|
| committer | victorfisac <[email protected]> | 2016-01-20 13:48:00 +0100 |
| commit | c04752c0e4b646638ce6adf991750763c2dbf393 (patch) | |
| tree | 9fdafdbdd04dda343a25ac40768900d2d5016da6 /examples/core_input_mouse.c | |
| parent | 4cc394c376c83926da67afe14855d2a3e2b06cfd (diff) | |
| parent | 29c618a35e19c1c00be94bf423ad6af7ecf1d3f8 (diff) | |
| download | raylib-c04752c0e4b646638ce6adf991750763c2dbf393.tar.gz raylib-c04752c0e4b646638ce6adf991750763c2dbf393.zip | |
Merge remote-tracking branch 'refs/remotes/raysan5/develop' into develop
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(); } //---------------------------------------------------------------------------------- |
