MCPcopy Create free account
hub / github.com/OneLoneCoder/olcPixelGameEngine / SetWindowSize

Method SetWindowSize

olcPixelGameEngine.h:6880–6899  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6878 }
6879
6880 olc::rcode SetWindowSize(const olc::vi2d& vWindowPos, const olc::vi2d& vWindowSize)
6881 {
6882 vWinPos = vWindowPos;
6883 vWinSize = vWindowSize;
6884 RECT rWndRect;
6885 rWndRect.left = vWinPos.x;
6886 rWndRect.top = vWinPos.y;
6887 rWndRect.right = rWndRect.left + vWinSize.x;
6888 rWndRect.bottom = rWndRect.top + vWinSize.y;
6889 rWndRect = rWndRect;
6890 DWORD dwExStyle = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
6891 DWORD dwStyle = WS_CAPTION | WS_SYSMENU | WS_VISIBLE | WS_THICKFRAME;
6892 AdjustWindowRectEx(&rWndRect, dwStyle, FALSE, dwExStyle);
6893 int width = rWndRect.right - rWndRect.left;
6894 int height = rWndRect.bottom - rWndRect.top;
6895 vWinPos = { rWndRect.left, rWndRect.top };
6896 vWinSize = { width, height };
6897 SetWindowPos(olc_hWnd, NULL, vWinPos.x, vWinPos.y, width, height, SWP_SHOWWINDOW);
6898 return olc::OK;
6899 }
6900
6901 virtual olc::rcode StartSystemEventLoop() override
6902 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected