summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorRay <[email protected]>2023-07-02 17:48:00 +0200
committerRay <[email protected]>2023-07-02 17:48:00 +0200
commitd1ab031a273f6d012c81f3ed637771b7f3c72ef4 (patch)
tree0fd3bdc45a3f88d8d348fffdcf7cc13314b6dee4 /src
parent5361d498c33deeb1e1ad44aed24a53a4f9e97618 (diff)
downloadraylib-d1ab031a273f6d012c81f3ed637771b7f3c72ef4.tar.gz
raylib-d1ab031a273f6d012c81f3ed637771b7f3c72ef4.zip
ADDED: `SetWindowFocused()` #3142
Diffstat (limited to 'src')
-rw-r--r--src/raylib.h1
-rw-r--r--src/rcore.c8
2 files changed, 9 insertions, 0 deletions
diff --git a/src/raylib.h b/src/raylib.h
index 539a3135..f9f36626 100644
--- a/src/raylib.h
+++ b/src/raylib.h
@@ -958,6 +958,7 @@ RLAPI void SetWindowMonitor(int monitor); // Set monitor
RLAPI void SetWindowMinSize(int width, int height); // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)
RLAPI void SetWindowSize(int width, int height); // Set window dimensions
RLAPI void SetWindowOpacity(float opacity); // Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP)
+RLAPI void SetWindowFocused(void); // Set window focused (only PLATFORM_DESKTOP)
RLAPI void *GetWindowHandle(void); // Get native window handle
RLAPI int GetScreenWidth(void); // Get current screen width
RLAPI int GetScreenHeight(void); // Get current screen height
diff --git a/src/rcore.c b/src/rcore.c
index bba8f5ef..135ccb6c 100644
--- a/src/rcore.c
+++ b/src/rcore.c
@@ -1705,6 +1705,14 @@ void SetWindowOpacity(float opacity)
#endif
}
+// Set window focused
+void SetWindowFocused(void)
+{
+#if defined(PLATFORM_DESKTOP)
+ glfwFocusWindow(CORE.Window.handle);
+#endif
+}
+
// Get current screen width
int GetScreenWidth(void)
{