diff options
author | nathansmith117 <thenathansmithsmith@gmail.com> | 2024-02-21 18:17:41 +0000 |
---|---|---|
committer | nathansmith117 <thenathansmithsmith@gmail.com> | 2024-02-21 18:17:41 +0000 |
commit | 2f6a0233b16d25df9b79a61b93fd8a72626bad3c (patch) | |
tree | fb505b87c4492494bc43c488da594ec31bf2ab35 /src/util.c | |
parent | ba522d0b6e8172d2d9f0ee107fbb2d6499380847 (diff) | |
download | PenguinYippies-2f6a0233b16d25df9b79a61b93fd8a72626bad3c.tar.gz PenguinYippies-2f6a0233b16d25df9b79a61b93fd8a72626bad3c.tar.bz2 PenguinYippies-2f6a0233b16d25df9b79a61b93fd8a72626bad3c.zip |
Fixed mouse position with render texture
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c new file mode 100644 index 0000000..308343c --- /dev/null +++ b/src/util.c @@ -0,0 +1,11 @@ +#include "util.h" +#include "game.h" + +Vector2 getScaledMousePosition() +{ + Vector2 mousePosition = GetMousePosition(); + mousePosition.x *= (float)WINDOW_WIDTH / GetScreenWidth(); + mousePosition.y *= (float)WINDOW_HEIGHT / GetScreenHeight(); + + return mousePosition; +} |