mirror of
https://github.com/raysan5/raylib.git
synced 2026-01-22 23:29:18 -05:00
Update rcore_desktop_glfw.c
This commit is contained in:
@ -267,12 +267,15 @@ void ToggleBorderlessWindowed(void)
|
|||||||
int monitorPosX = 0;
|
int monitorPosX = 0;
|
||||||
int monitorPosY = 0;
|
int monitorPosY = 0;
|
||||||
glfwGetMonitorPos(monitors[monitor], &monitorPosX, &monitorPosY);
|
glfwGetMonitorPos(monitors[monitor], &monitorPosX, &monitorPosY);
|
||||||
const int monitorWidth = mode->width;
|
CORE.Window.position.x = monitorPosX;
|
||||||
const int monitorHeight = mode->height;
|
CORE.Window.position.x = monitorPosY;
|
||||||
|
|
||||||
|
CORE.Window.screen.width = mode->width;
|
||||||
|
CORE.Window.screen.height = mode->height;
|
||||||
|
|
||||||
// Set screen position and size
|
// Set screen position and size
|
||||||
glfwSetWindowMonitor(platform.handle, monitors[monitor], monitorPosX, monitorPosY,
|
glfwSetWindowMonitor(platform.handle, monitors[monitor], CORE.Window.position.x, CORE.Window.position.y,
|
||||||
monitorWidth, monitorHeight, mode->refreshRate);
|
CORE.Window.screen.width, CORE.Window.screen.height, mode->refreshRate);
|
||||||
|
|
||||||
// Refocus window
|
// Refocus window
|
||||||
glfwFocusWindow(platform.handle);
|
glfwFocusWindow(platform.handle);
|
||||||
@ -1817,7 +1820,7 @@ static void WindowSizeCallback(GLFWwindow *window, int width, int height)
|
|||||||
// WARNING: If FLAG_WINDOW_HIGHDPI is set, WindowContentScaleCallback() is called before this function
|
// WARNING: If FLAG_WINDOW_HIGHDPI is set, WindowContentScaleCallback() is called before this function
|
||||||
static void FramebufferSizeCallback(GLFWwindow *window, int width, int height)
|
static void FramebufferSizeCallback(GLFWwindow *window, int width, int height)
|
||||||
{
|
{
|
||||||
TRACELOG(LOG_INFO, "GLFW3: Window framebuffer size callback called [%i,%i]", width, height);
|
//TRACELOG(LOG_INFO, "GLFW3: Window framebuffer size callback called [%i,%i]", width, height);
|
||||||
|
|
||||||
// WARNING: On window minimization, callback is called,
|
// WARNING: On window minimization, callback is called,
|
||||||
// but we don't want to change internal screen values, it breaks things
|
// but we don't want to change internal screen values, it breaks things
|
||||||
@ -1873,7 +1876,7 @@ static void FramebufferSizeCallback(GLFWwindow *window, int width, int height)
|
|||||||
// WARNING: If FLAG_WINDOW_HIGHDPI is not set, this function is not called
|
// WARNING: If FLAG_WINDOW_HIGHDPI is not set, this function is not called
|
||||||
static void WindowContentScaleCallback(GLFWwindow *window, float scalex, float scaley)
|
static void WindowContentScaleCallback(GLFWwindow *window, float scalex, float scaley)
|
||||||
{
|
{
|
||||||
TRACELOG(LOG_INFO, "GLFW3: Window content scale changed, scale: [%.2f,%.2f]", scalex, scaley);
|
//TRACELOG(LOG_INFO, "GLFW3: Window content scale changed, scale: [%.2f,%.2f]", scalex, scaley);
|
||||||
|
|
||||||
float fbWidth = (float)CORE.Window.screen.width*scalex;
|
float fbWidth = (float)CORE.Window.screen.width*scalex;
|
||||||
float fbHeight = (float)CORE.Window.screen.height*scaley;
|
float fbHeight = (float)CORE.Window.screen.height*scaley;
|
||||||
|
|||||||
Reference in New Issue
Block a user