Get client width & height

This commit is contained in:
Chris 2023-05-11 22:28:05 -07:00
parent 5978358e58
commit 6a899fa1f7
2 changed files with 18 additions and 0 deletions

View File

@ -955,6 +955,8 @@ RLAPI int GetScreenWidth(void); // Get current
RLAPI int GetScreenHeight(void); // Get current screen height
RLAPI int GetRenderWidth(void); // Get current render width (it considers HiDPI)
RLAPI int GetRenderHeight(void); // Get current render height (it considers HiDPI)
RLAPI int GetClientWidth(void); // Get current client width
RLAPI int GetClientHeight(void); // Get current client height
RLAPI int GetMonitorCount(void); // Get number of connected monitors
RLAPI int GetCurrentMonitor(void); // Get current connected monitor
RLAPI Vector2 GetMonitorPosition(int monitor); // Get specified monitor position

View File

@ -1694,6 +1694,22 @@ int GetScreenHeight(void)
return CORE.Window.screen.height;
}
// Get current client width
int GetClientWidth(void)
{
int width;
glfwGetWindowSize(CORE.Window.handle, &width, NULL);
return width;
}
// Get current client height
int GetClientHeight(void)
{
int height;
glfwGetWindowSize(CORE.Window.handle, NULL, &height);
return height;
}
// Get current render width which is equal to screen width * dpi scale
int GetRenderWidth(void)
{