set minimum window size

This commit is contained in:
jacob 2025-01-21 08:32:05 -06:00
parent ab6761b733
commit 9d745e3475
2 changed files with 9 additions and 2 deletions

View File

@ -698,8 +698,8 @@ INTERNAL struct dx11_texture *dx11_texture_alloc(enum renderer_texture_format fo
} }
D3D11_TEXTURE2D_DESC desc = ZI; D3D11_TEXTURE2D_DESC desc = ZI;
desc.Width = size.x; desc.Width = max_i32(size.x, 1);
desc.Height = size.y; desc.Height = max_i32(size.y, 1);
desc.MipLevels = 1; desc.MipLevels = 1;
desc.ArraySize = 1; desc.ArraySize = 1;
desc.SampleDesc.Count = 1; desc.SampleDesc.Count = 1;

View File

@ -1188,6 +1188,13 @@ INTERNAL LRESULT CALLBACK win32_window_proc(HWND hwnd, UINT msg, WPARAM wparam,
scratch_end(scratch); scratch_end(scratch);
} break; } break;
/* Minmax info */
case WM_GETMINMAXINFO: {
/* Set minimum window size */
LPMINMAXINFO mmi = (LPMINMAXINFO)lparam;
mmi->ptMinTrackSize.x = 100;
mmi->ptMinTrackSize.y = 100;
} break;
default: { default: {
result = DefWindowProcW(hwnd, msg, wparam, lparam); result = DefWindowProcW(hwnd, msg, wparam, lparam);