From b549baa6b76c3f27f1aebcd4cd61333ad1deb960 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 11 Jun 2022 12:08:16 +0200 Subject: [PATCH] New feature: support MOUSE_PASSTHROUGH #2516 --- src/raylib.h | 1 + src/rcore.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/raylib.h b/src/raylib.h index 472181299..951c0da5d 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -501,6 +501,7 @@ typedef enum { FLAG_WINDOW_ALWAYS_RUN = 0x00000100, // Set to allow windows running while minimized FLAG_WINDOW_TRANSPARENT = 0x00000010, // Set to allow transparent framebuffer FLAG_WINDOW_HIGHDPI = 0x00002000, // Set to support HighDPI + FLAG_WINDOW_MOUSE_PASSTHROUGH = 0x0002000d, // Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED FLAG_MSAA_4X_HINT = 0x00000020, // Set to try enabling MSAA 4X FLAG_INTERLACED_HINT = 0x00010000 // Set to try enabling interlaced video format (for V3D) } ConfigFlags; diff --git a/src/rcore.c b/src/rcore.c index b90cbfd1a..44fd96c1e 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -4036,6 +4036,10 @@ static bool InitGraphicsDevice(int width, int height) #endif } else glfwWindowHint(GLFW_SCALE_TO_MONITOR, GLFW_FALSE); + + // Mouse passthrough + if ((CORE.Window.flags & FLAG_WINDOW_MOUSE_PASSTHROUGH) > 0) glfwWindowHint(GLFW_MOUSE_PASSTHROUGH, GLFW_TRUE); + else glfwWindowHint(GLFW_MOUSE_PASSTHROUGH, GLFW_FALSE); #endif if (CORE.Window.flags & FLAG_MSAA_4X_HINT)