Skip to content

Commit

Permalink
ADDED: SetWindowFocused() #3142
Browse files Browse the repository at this point in the history
  • Loading branch information
raysan5 committed Jul 2, 2023
1 parent 5361d49 commit d1ab031
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/raylib.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions src/rcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit d1ab031

Please sign in to comment.