mirror of
https://github.com/raysan5/raylib.git
synced 2026-10-11 04:01:54 -04:00
Compare commits
2 Commits
6f5f7acdd6
...
260d270c58
| Author | SHA1 | Date | |
|---|---|---|---|
| 260d270c58 | |||
| bdf10f516c |
@ -1615,10 +1615,6 @@ int InitPlatform(void)
|
|||||||
|
|
||||||
if ((CORE.Window.screen.width == 0) || (CORE.Window.screen.height == 0)) FLAG_SET(CORE.Window.flags, FLAG_FULLSCREEN_MODE);
|
if ((CORE.Window.screen.width == 0) || (CORE.Window.screen.height == 0)) FLAG_SET(CORE.Window.flags, FLAG_FULLSCREEN_MODE);
|
||||||
|
|
||||||
// Init window in fullscreen mode if requested
|
|
||||||
// NOTE: Keeping original screen size for toggle
|
|
||||||
if (FLAG_IS_SET(CORE.Window.flags, FLAG_FULLSCREEN_MODE))
|
|
||||||
{
|
|
||||||
// NOTE: Fullscreen applications default to the primary monitor
|
// NOTE: Fullscreen applications default to the primary monitor
|
||||||
GLFWmonitor *monitor = glfwGetPrimaryMonitor();
|
GLFWmonitor *monitor = glfwGetPrimaryMonitor();
|
||||||
if (!monitor)
|
if (!monitor)
|
||||||
@ -1627,6 +1623,10 @@ int InitPlatform(void)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Init window in fullscreen mode if requested
|
||||||
|
// NOTE: Keeping original screen size for toggle
|
||||||
|
if (FLAG_IS_SET(CORE.Window.flags, FLAG_FULLSCREEN_MODE))
|
||||||
|
{
|
||||||
// Set dimensions from monitor
|
// Set dimensions from monitor
|
||||||
const GLFWvidmode *mode = glfwGetVideoMode(monitor);
|
const GLFWvidmode *mode = glfwGetVideoMode(monitor);
|
||||||
|
|
||||||
@ -1667,6 +1667,18 @@ int InitPlatform(void)
|
|||||||
if (CORE.Window.screen.width == 0) CORE.Window.screen.width = 1;
|
if (CORE.Window.screen.width == 0) CORE.Window.screen.width = 1;
|
||||||
if (CORE.Window.screen.height == 0) CORE.Window.screen.height = 1;
|
if (CORE.Window.screen.height == 0) CORE.Window.screen.height = 1;
|
||||||
|
|
||||||
|
int workX = 0;
|
||||||
|
int workY = 0;
|
||||||
|
int workWidth = 0;
|
||||||
|
int workHeight = 0;
|
||||||
|
glfwGetMonitorWorkarea(monitor, &workX, &workY, &workWidth, &workHeight);
|
||||||
|
|
||||||
|
// If the area requested by the user exceeds the maximum workable area, clamp it to that
|
||||||
|
// GLFW has a problem where if the window is greater than the workable area (this means
|
||||||
|
// the taskbar / dockable areas) it won't show up if the window isn't fullscreen
|
||||||
|
if (CORE.Window.screen.width > workWidth) CORE.Window.screen.width = workWidth;
|
||||||
|
if (CORE.Window.screen.height > workHeight) CORE.Window.screen.height = workHeight;
|
||||||
|
|
||||||
platform.handle = glfwCreateWindow(CORE.Window.screen.width, CORE.Window.screen.height, (CORE.Window.title != 0)? CORE.Window.title : " ", NULL, NULL);
|
platform.handle = glfwCreateWindow(CORE.Window.screen.width, CORE.Window.screen.height, (CORE.Window.title != 0)? CORE.Window.title : " ", NULL, NULL);
|
||||||
if (!platform.handle)
|
if (!platform.handle)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user