MCPcopy Create free account
hub / github.com/ddiakopoulos/polymer / enter_fullscreen

Method enter_fullscreen

libraries/lib-app-base/src/glfw-app.cpp:331–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329#include <shellapi.h>
330
331void polymer_app::enter_fullscreen(GLFWwindow * window, int2 & windowedSize, int2 & windowedPos)
332{
333 glfwGetWindowSize(window, &windowedSize.x, &windowedSize.y);
334 glfwGetWindowPos(window, &windowedPos.x, &windowedPos.y);
335
336 HWND hwnd = glfwGetWin32Window(window);
337 SetWindowLong(hwnd, GWL_EXSTYLE, 0);
338 SetWindowLong(hwnd, GWL_STYLE, WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
339 SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED | SWP_SHOWWINDOW);
340
341 int32_t newScreenWidth = get_screen_size(window).x;
342 int32_t newScreenHeight = get_screen_size(window).y;
343
344 int monitorCount;
345 GLFWmonitor** monitors = glfwGetMonitors(&monitorCount);
346 int currentMonitor = get_current_monitor(window);
347 int xpos, ypos;
348 glfwGetMonitorPos(monitors[currentMonitor], &xpos, &ypos);
349
350 SetWindowPos(hwnd, HWND_TOPMOST, xpos, ypos, (int) newScreenWidth, (int) newScreenHeight, SWP_SHOWWINDOW);
351}
352
353void polymer_app::exit_fullscreen(GLFWwindow * window, const int2 & windowedSize, const int2 & windowedPos)
354{

Callers

nothing calls this directly

Calls 2

get_screen_sizeFunction · 0.85
get_current_monitorFunction · 0.85

Tested by

no test coverage detected