summaryrefslogtreecommitdiffhomepage
path: root/src/rcore.c
diff options
context:
space:
mode:
authorRay <[email protected]>2022-04-24 11:02:50 +0200
committerRay <[email protected]>2022-04-24 11:02:50 +0200
commitd433de7efaeacd1852f80690fe5fdc5b8881f665 (patch)
treeb2a8c51b72a18bcea9d9a64e272dac40795a394c /src/rcore.c
parent233cf3970c9148c4963cfdea20e49e761104f9de (diff)
downloadraylib-d433de7efaeacd1852f80690fe5fdc5b8881f665.tar.gz
raylib-d433de7efaeacd1852f80690fe5fdc5b8881f665.zip
Initialize (reset) input global state #2360
Diffstat (limited to 'src/rcore.c')
-rw-r--r--src/rcore.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rcore.c b/src/rcore.c
index b7a96938..4d0883f2 100644
--- a/src/rcore.c
+++ b/src/rcore.c
@@ -179,7 +179,7 @@
#include <stdlib.h> // Required for: srand(), rand(), atexit()
#include <stdio.h> // Required for: sprintf() [Used in OpenURL()]
-#include <string.h> // Required for: strrchr(), strcmp(), strlen()
+#include <string.h> // Required for: strrchr(), strcmp(), strlen(), memset()
#include <time.h> // Required for: time() [Used in InitTimer()]
#include <math.h> // Required for: tan() [Used in BeginMode3D()], atan2f() [Used in LoadVrStereoConfig()]
@@ -754,8 +754,9 @@ void InitWindow(int width, int height, const char *title)
#endif
if ((title != NULL) && (title[0] != 0)) CORE.Window.title = title;
-
- // Initialize required global values different than 0
+
+ // Initialize global input state
+ memset(&CORE.Input, 0, sizeof(CORE.Input));
CORE.Input.Keyboard.exitKey = KEY_ESCAPE;
CORE.Input.Mouse.scale = (Vector2){ 1.0f, 1.0f };
CORE.Input.Mouse.cursor = MOUSE_CURSOR_ARROW;