Lines Matching refs:window
33 static void applySizeLimits(_GLFWwindow* window, int* width, int* height)
35 if (window->numer != GLFW_DONT_CARE && window->denom != GLFW_DONT_CARE)
37 const float ratio = (float) window->numer / (float) window->denom;
41 if (window->minwidth != GLFW_DONT_CARE)
42 *width = _glfw_max(*width, window->minwidth);
43 else if (window->maxwidth != GLFW_DONT_CARE)
44 *width = _glfw_min(*width, window->maxwidth);
46 if (window->minheight != GLFW_DONT_CARE)
47 *height = _glfw_min(*height, window->minheight);
48 else if (window->maxheight != GLFW_DONT_CARE)
49 *height = _glfw_max(*height, window->maxheight);
52 static void fitToMonitor(_GLFWwindow* window)
55 _glfwGetVideoModeNull(window->monitor, &mode);
56 _glfwGetMonitorPosNull(window->monitor,
57 &window->null.xpos,
58 &window->null.ypos);
59 window->null.width = mode.width;
60 window->null.height = mode.height;
63 static void acquireMonitor(_GLFWwindow* window)
65 _glfwInputMonitorWindow(window->monitor, window);
68 static void releaseMonitor(_GLFWwindow* window)
70 if (window->monitor->window != window)
73 _glfwInputMonitorWindow(window->monitor, NULL);
76 static int createNativeWindow(_GLFWwindow* window,
80 if (window->monitor)
81 fitToMonitor(window);
86 window->null.xpos = 17;
87 window->null.ypos = 17;
91 window->null.xpos = wndconfig->xpos;
92 window->null.ypos = wndconfig->ypos;
95 window->null.width = wndconfig->width;
96 window->null.height = wndconfig->height;
99 window->null.visible = wndconfig->visible;
100 window->null.decorated = wndconfig->decorated;
101 window->null.maximized = wndconfig->maximized;
102 window->null.floating = wndconfig->floating;
103 window->null.transparent = fbconfig->transparent;
104 window->null.opacity = 1.f;
114 GLFWbool _glfwCreateWindowNull(_GLFWwindow* window,
119 if (!createNativeWindow(window, wndconfig, fbconfig))
129 if (!_glfwCreateContextOSMesa(window, ctxconfig, fbconfig))
136 if (!_glfwCreateContextEGL(window, ctxconfig, fbconfig))
140 if (!_glfwRefreshContextAttribs(window, ctxconfig))
145 _glfwSetWindowMousePassthroughNull(window, GLFW_TRUE);
147 if (window->monitor)
149 _glfwShowWindowNull(window);
150 _glfwFocusWindowNull(window);
151 acquireMonitor(window);
154 _glfwCenterCursorInContentArea(window);
160 _glfwShowWindowNull(window);
162 _glfwFocusWindowNull(window);
169 void _glfwDestroyWindowNull(_GLFWwindow* window)
171 if (window->monitor)
172 releaseMonitor(window);
174 if (_glfw.null.focusedWindow == window)
177 if (window->context.destroy)
178 window->context.destroy(window);
181 void _glfwSetWindowTitleNull(_GLFWwindow* window, const char* title)
185 void _glfwSetWindowIconNull(_GLFWwindow* window, int count, const GLFWimage* images)
189 void _glfwSetWindowMonitorNull(_GLFWwindow* window,
195 if (window->monitor == monitor)
199 _glfwSetWindowPosNull(window, xpos, ypos);
200 _glfwSetWindowSizeNull(window, width, height);
206 if (window->monitor)
207 releaseMonitor(window);
209 _glfwInputWindowMonitor(window, monitor);
211 if (window->monitor)
213 window->null.visible = GLFW_TRUE;
214 acquireMonitor(window);
215 fitToMonitor(window);
219 _glfwSetWindowPosNull(window, xpos, ypos);
220 _glfwSetWindowSizeNull(window, width, height);
224 void _glfwGetWindowPosNull(_GLFWwindow* window, int* xpos, int* ypos)
227 *xpos = window->null.xpos;
229 *ypos = window->null.ypos;
232 void _glfwSetWindowPosNull(_GLFWwindow* window, int xpos, int ypos)
234 if (window->monitor)
237 if (window->null.xpos != xpos || window->null.ypos != ypos)
239 window->null.xpos = xpos;
240 window->null.ypos = ypos;
241 _glfwInputWindowPos(window, xpos, ypos);
245 void _glfwGetWindowSizeNull(_GLFWwindow* window, int* width, int* height)
248 *width = window->null.width;
250 *height = window->null.height;
253 void _glfwSetWindowSizeNull(_GLFWwindow* window, int width, int height)
255 if (window->monitor)
258 if (window->null.width != width || window->null.height != height)
260 window->null.width = width;
261 window->null.height = height;
262 _glfwInputFramebufferSize(window, width, height);
263 _glfwInputWindowDamage(window);
264 _glfwInputWindowSize(window, width, height);
268 void _glfwSetWindowSizeLimitsNull(_GLFWwindow* window,
272 int width = window->null.width;
273 int height = window->null.height;
274 applySizeLimits(window, &width, &height);
275 _glfwSetWindowSizeNull(window, width, height);
278 void _glfwSetWindowAspectRatioNull(_GLFWwindow* window, int n, int d)
280 int width = window->null.width;
281 int height = window->null.height;
282 applySizeLimits(window, &width, &height);
283 _glfwSetWindowSizeNull(window, width, height);
286 void _glfwGetFramebufferSizeNull(_GLFWwindow* window, int* width, int* height)
289 *width = window->null.width;
291 *height = window->null.height;
294 void _glfwGetWindowFrameSizeNull(_GLFWwindow* window,
298 if (window->null.decorated && !window->monitor)
322 void _glfwGetWindowContentScaleNull(_GLFWwindow* window, float* xscale, float* yscale)
330 void _glfwIconifyWindowNull(_GLFWwindow* window)
332 if (_glfw.null.focusedWindow == window)
335 _glfwInputWindowFocus(window, GLFW_FALSE);
338 if (!window->null.iconified)
340 window->null.iconified = GLFW_TRUE;
341 _glfwInputWindowIconify(window, GLFW_TRUE);
343 if (window->monitor)
344 releaseMonitor(window);
348 void _glfwRestoreWindowNull(_GLFWwindow* window)
350 if (window->null.iconified)
352 window->null.iconified = GLFW_FALSE;
353 _glfwInputWindowIconify(window, GLFW_FALSE);
355 if (window->monitor)
356 acquireMonitor(window);
358 else if (window->null.maximized)
360 window->null.maximized = GLFW_FALSE;
361 _glfwInputWindowMaximize(window, GLFW_FALSE);
365 void _glfwMaximizeWindowNull(_GLFWwindow* window)
367 if (!window->null.maximized)
369 window->null.maximized = GLFW_TRUE;
370 _glfwInputWindowMaximize(window, GLFW_TRUE);
374 GLFWbool _glfwWindowMaximizedNull(_GLFWwindow* window)
376 return window->null.maximized;
379 GLFWbool _glfwWindowHoveredNull(_GLFWwindow* window)
381 return _glfw.null.xcursor >= window->null.xpos &&
382 _glfw.null.ycursor >= window->null.ypos &&
383 _glfw.null.xcursor <= window->null.xpos + window->null.width - 1 &&
384 _glfw.null.ycursor <= window->null.ypos + window->null.height - 1;
387 GLFWbool _glfwFramebufferTransparentNull(_GLFWwindow* window)
389 return window->null.transparent;
392 void _glfwSetWindowResizableNull(_GLFWwindow* window, GLFWbool enabled)
394 window->null.resizable = enabled;
397 void _glfwSetWindowDecoratedNull(_GLFWwindow* window, GLFWbool enabled)
399 window->null.decorated = enabled;
402 void _glfwSetWindowFloatingNull(_GLFWwindow* window, GLFWbool enabled)
404 window->null.floating = enabled;
407 void _glfwSetWindowMousePassthroughNull(_GLFWwindow* window, GLFWbool enabled)
411 float _glfwGetWindowOpacityNull(_GLFWwindow* window)
413 return window->null.opacity;
416 void _glfwSetWindowOpacityNull(_GLFWwindow* window, float opacity)
418 window->null.opacity = opacity;
421 void _glfwSetRawMouseMotionNull(_GLFWwindow *window, GLFWbool enabled)
430 void _glfwShowWindowNull(_GLFWwindow* window)
432 window->null.visible = GLFW_TRUE;
435 void _glfwRequestWindowAttentionNull(_GLFWwindow* window)
439 void _glfwHideWindowNull(_GLFWwindow* window)
441 if (_glfw.null.focusedWindow == window)
444 _glfwInputWindowFocus(window, GLFW_FALSE);
447 window->null.visible = GLFW_FALSE;
450 void _glfwFocusWindowNull(_GLFWwindow* window)
454 if (_glfw.null.focusedWindow == window)
457 if (!window->null.visible)
461 _glfw.null.focusedWindow = window;
470 _glfwInputWindowFocus(window, GLFW_TRUE);
473 GLFWbool _glfwWindowFocusedNull(_GLFWwindow* window)
475 return _glfw.null.focusedWindow == window;
478 GLFWbool _glfwWindowIconifiedNull(_GLFWwindow* window)
480 return window->null.iconified;
483 GLFWbool _glfwWindowVisibleNull(_GLFWwindow* window)
485 return window->null.visible;
504 void _glfwGetCursorPosNull(_GLFWwindow* window, double* xpos, double* ypos)
507 *xpos = _glfw.null.xcursor - window->null.xpos;
509 *ypos = _glfw.null.ycursor - window->null.ypos;
512 void _glfwSetCursorPosNull(_GLFWwindow* window, double x, double y)
514 _glfw.null.xcursor = window->null.xpos + (int) x;
515 _glfw.null.ycursor = window->null.ypos + (int) y;
518 void _glfwSetCursorModeNull(_GLFWwindow* window, int mode)
538 void _glfwSetCursorNull(_GLFWwindow* window, _GLFWcursor* cursor)
567 EGLNativeWindowType _glfwGetEGLNativeWindowNull(_GLFWwindow* window)
721 _GLFWwindow* window,