1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-23 10:48:51 -05:00

Remove monitor from _GLFWwndconfig

This commit is contained in:
Camilla Berglund 2016-03-14 15:17:28 +01:00
parent 3a6fe042ea
commit ea888114fa
7 changed files with 19 additions and 23 deletions

View File

@ -904,7 +904,7 @@ static GLFWbool createWindow(_GLFWwindow* window,
unsigned int styleMask = 0; unsigned int styleMask = 0;
if (wndconfig->monitor || !wndconfig->decorated) if (window->monitor || !wndconfig->decorated)
styleMask = NSBorderlessWindowMask; styleMask = NSBorderlessWindowMask;
else else
{ {
@ -917,7 +917,7 @@ static GLFWbool createWindow(_GLFWwindow* window,
NSRect contentRect; NSRect contentRect;
if (wndconfig->monitor) if (window->monitor)
{ {
GLFWvidmode mode; GLFWvidmode mode;
int xpos, ypos; int xpos, ypos;
@ -945,10 +945,8 @@ static GLFWbool createWindow(_GLFWwindow* window,
if (wndconfig->resizable) if (wndconfig->resizable)
[window->ns.object setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; [window->ns.object setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
if (wndconfig->monitor) if (window->monitor)
{
[window->ns.object setLevel:NSMainMenuWindowLevel + 1]; [window->ns.object setLevel:NSMainMenuWindowLevel + 1];
}
else else
{ {
[window->ns.object center]; [window->ns.object center];
@ -998,7 +996,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
return GLFW_FALSE; return GLFW_FALSE;
} }
if (wndconfig->monitor) if (window->monitor)
{ {
_glfwPlatformShowWindow(window); _glfwPlatformShowWindow(window);
if (!enterFullscreenMode(window)) if (!enterFullscreenMode(window))

View File

@ -247,7 +247,6 @@ struct _GLFWwndconfig
GLFWbool autoIconify; GLFWbool autoIconify;
GLFWbool floating; GLFWbool floating;
GLFWbool maximized; GLFWbool maximized;
_GLFWmonitor* monitor;
}; };

View File

@ -351,10 +351,10 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
return GLFW_FALSE; return GLFW_FALSE;
} }
if (wndconfig->monitor) if (window->monitor)
{ {
GLFWvidmode mode; GLFWvidmode mode;
_glfwPlatformGetVideoMode(wndconfig->monitor, &mode); _glfwPlatformGetVideoMode(window->monitor, &mode);
mir_surface_set_state(window->mir.surface, mir_surface_state_fullscreen); mir_surface_set_state(window->mir.surface, mir_surface_state_fullscreen);

View File

@ -760,15 +760,15 @@ static int createWindow(_GLFWwindow* window, const _GLFWwndconfig* wndconfig)
DWORD style = getWindowStyle(window); DWORD style = getWindowStyle(window);
DWORD exStyle = getWindowExStyle(window); DWORD exStyle = getWindowExStyle(window);
if (wndconfig->monitor) if (window->monitor)
{ {
GLFWvidmode mode; GLFWvidmode mode;
// NOTE: This window placement is temporary and approximate, as the // NOTE: This window placement is temporary and approximate, as the
// correct position and size cannot be known until the monitor // correct position and size cannot be known until the monitor
// video mode has been set // video mode has been set
_glfwPlatformGetMonitorPos(wndconfig->monitor, &xpos, &ypos); _glfwPlatformGetMonitorPos(window->monitor, &xpos, &ypos);
_glfwPlatformGetVideoMode(wndconfig->monitor, &mode); _glfwPlatformGetVideoMode(window->monitor, &mode);
fullWidth = mode.width; fullWidth = mode.width;
fullHeight = mode.height; fullHeight = mode.height;
} }
@ -822,7 +822,7 @@ static int createWindow(_GLFWwindow* window, const _GLFWwndconfig* wndconfig)
WM_COPYGLOBALDATA, MSGFLT_ALLOW, NULL); WM_COPYGLOBALDATA, MSGFLT_ALLOW, NULL);
} }
if (wndconfig->floating && !wndconfig->monitor) if (wndconfig->floating && !window->monitor)
{ {
SetWindowPos(window->win32.handle, SetWindowPos(window->win32.handle,
HWND_TOPMOST, HWND_TOPMOST,

View File

@ -143,7 +143,6 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
wndconfig.width = width; wndconfig.width = width;
wndconfig.height = height; wndconfig.height = height;
wndconfig.title = title; wndconfig.title = title;
wndconfig.monitor = (_GLFWmonitor*) monitor;
ctxconfig.share = (_GLFWwindow*) share; ctxconfig.share = (_GLFWwindow*) share;
if (ctxconfig.share) if (ctxconfig.share)
@ -155,7 +154,7 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
} }
} }
if (wndconfig.monitor) if (monitor)
{ {
wndconfig.resizable = GLFW_TRUE; wndconfig.resizable = GLFW_TRUE;
wndconfig.visible = GLFW_TRUE; wndconfig.visible = GLFW_TRUE;
@ -176,7 +175,7 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
window->videoMode.blueBits = fbconfig.blueBits; window->videoMode.blueBits = fbconfig.blueBits;
window->videoMode.refreshRate = _glfw.hints.refreshRate; window->videoMode.refreshRate = _glfw.hints.refreshRate;
window->monitor = wndconfig.monitor; window->monitor = (_GLFWmonitor*) monitor;
window->resizable = wndconfig.resizable; window->resizable = wndconfig.resizable;
window->decorated = wndconfig.decorated; window->decorated = wndconfig.decorated;
window->autoIconify = wndconfig.autoIconify; window->autoIconify = wndconfig.autoIconify;
@ -218,7 +217,7 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
_glfwPlatformMakeContextCurrent(previous); _glfwPlatformMakeContextCurrent(previous);
} }
if (wndconfig.monitor) if (window->monitor)
{ {
int width, height; int width, height;
_glfwPlatformGetWindowSize(window, &width, &height); _glfwPlatformGetWindowSize(window, &width, &height);

View File

@ -329,13 +329,13 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
return GLFW_FALSE; return GLFW_FALSE;
} }
if (wndconfig->monitor) if (window->monitor)
{ {
wl_shell_surface_set_fullscreen( wl_shell_surface_set_fullscreen(
window->wl.shell_surface, window->wl.shell_surface,
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT, WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
0, 0,
wndconfig->monitor->wl.output); window->monitor->wl.output);
} }
else else
{ {

View File

@ -300,7 +300,7 @@ static GLFWbool createWindow(_GLFWwindow* window,
(XPointer) window); (XPointer) window);
} }
if (wndconfig->monitor) if (window->monitor)
{ {
if (!_glfw.x11.NET_WM_STATE || !_glfw.x11.NET_WM_STATE_FULLSCREEN) if (!_glfw.x11.NET_WM_STATE || !_glfw.x11.NET_WM_STATE_FULLSCREEN)
{ {
@ -441,10 +441,10 @@ static GLFWbool createWindow(_GLFWwindow* window,
XSizeHints* hints = XAllocSizeHints(); XSizeHints* hints = XAllocSizeHints();
hints->flags = 0; hints->flags = 0;
if (wndconfig->monitor) if (window->monitor)
{ {
hints->flags |= PPosition; hints->flags |= PPosition;
_glfwPlatformGetMonitorPos(wndconfig->monitor, &hints->x, &hints->y); _glfwPlatformGetMonitorPos(window->monitor, &hints->x, &hints->y);
} }
if (!wndconfig->resizable) if (!wndconfig->resizable)
@ -1447,7 +1447,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
#endif #endif
} }
if (wndconfig->monitor) if (window->monitor)
{ {
_glfwPlatformShowWindow(window); _glfwPlatformShowWindow(window);
enterFullscreenMode(window); enterFullscreenMode(window);