Skip to content

Commit

Permalink
win32: fullscreen;
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornbytes committed May 13, 2024
1 parent 6754c83 commit e763963
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions src/core/os_win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,22 +460,32 @@ bool os_window_open(const os_window_config* config) {
return false;
}

DWORD style = WS_OVERLAPPEDWINDOW | WS_VISIBLE;
DWORD style = WS_VISIBLE;
uint32_t width, height;

if (!config->resizable) {
style &= ~WS_THICKFRAME;
if (config->fullscreen) {
style |= WS_POPUP;
width = GetSystemMetrics(SM_CXSCREEN);
height = GetSystemMetrics(SM_CYSCREEN);
} else {
style |= WS_OVERLAPPEDWINDOW;
width = config->width;
height = config->height;

if (!config->resizable) {
style &= ~WS_THICKFRAME;
}
}

RECT rect = { 0, 0, config->width, config->height };
RECT rect = { 0, 0, width, height };
AdjustWindowRect(&rect, style, FALSE);

state.window = CreateWindowW(wc.lpszClassName, wtitle, style,
CW_USEDEFAULT, CW_USEDEFAULT, rect.right - rect.left, rect.bottom - rect.top,
NULL, NULL, state.instance, NULL);


state.width = config->width;
state.height = config->height;
state.width = width;
state.height = height;
state.cursor = LoadCursor(NULL, IDC_ARROW);

return !!state.window;
Expand Down

0 comments on commit e763963

Please sign in to comment.