Expose a function to get the frame buffer size from GLFW.
This commit is contained in:
parent
1896268775
commit
1e612f2f4b
|
|
@ -979,6 +979,7 @@ RLAPI int GetMonitorPhysicalHeight(int monitor); // Get specifi
|
|||
RLAPI int GetMonitorRefreshRate(int monitor); // Get specified monitor refresh rate
|
||||
RLAPI Vector2 GetWindowPosition(void); // Get window position XY on monitor
|
||||
RLAPI Vector2 GetWindowScaleDPI(void); // Get window scale DPI factor
|
||||
RLAPI Vector2 GetFrameBufferSize(void); // Get the actual frame buffer size regardless of DPI mode
|
||||
RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the specified monitor
|
||||
RLAPI void SetClipboardText(const char *text); // Set clipboard text content
|
||||
RLAPI const char *GetClipboardText(void); // Get clipboard text content
|
||||
|
|
|
|||
15
src/rcore.c
15
src/rcore.c
|
|
@ -2117,6 +2117,21 @@ Vector2 GetWindowScaleDPI(void)
|
|||
return scale;
|
||||
}
|
||||
|
||||
// Get the actual frame buffer size regardless of DPI mode
|
||||
RLAPI Vector2 GetFrameBufferSize(void)
|
||||
{
|
||||
Vector2 size = { (float)CORE.Window.currentFbo.width, (float)CORE.Window.currentFbo.height };
|
||||
#if defined(PLATFORM_DESKTOP)
|
||||
int w = 0;
|
||||
int h = 0;
|
||||
|
||||
glfwGetFramebufferSize(glfwGetCurrentContext(), &w, &h);
|
||||
size = (Vector2){ (float)w, (float)h };
|
||||
#endif
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
// Get the human-readable, UTF-8 encoded name of the selected monitor
|
||||
const char *GetMonitorName(int monitor)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user