From aff47d156474afc5f0e7e0d8b5ce61c013d470b3 Mon Sep 17 00:00:00 2001 From: ChrisDill Date: Tue, 26 May 2020 10:59:25 +0100 Subject: [PATCH] Added bool IsCursorOnScreen(void). (#1262) - The Mouse struct already stores cursorOnScreen. This function simply exposes it to the usage code. --- src/core.c | 6 ++++++ src/raylib.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/core.c b/src/core.c index 6ac24ded4..e54c55590 100644 --- a/src/core.c +++ b/src/core.c @@ -1318,6 +1318,12 @@ void DisableCursor(void) CORE.Input.Mouse.cursorHidden = true; } +// Check if cursor is on the current screen. +bool IsCursorOnScreen(void) +{ + return CORE.Input.Mouse.cursorOnScreen; +} + // Set background color (framebuffer clear color) void ClearBackground(Color color) { diff --git a/src/raylib.h b/src/raylib.h index 490755e9c..9d9fd8c56 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -903,6 +903,7 @@ RLAPI void HideCursor(void); // Hides curso RLAPI bool IsCursorHidden(void); // Check if cursor is not visible RLAPI void EnableCursor(void); // Enables cursor (unlock cursor) RLAPI void DisableCursor(void); // Disables cursor (lock cursor) +RLAPI bool IsCursorOnScreen(void); // Check if cursor is on the current screen. // Drawing-related functions RLAPI void ClearBackground(Color color); // Set background color (framebuffer clear color)