layout codes of WinWindow.cpp

This commit is contained in:
hyzboy 2024-06-22 03:02:43 +08:00
parent 8d091ebfb0
commit 3b769e692b

View File

@ -10,9 +10,7 @@ namespace hgl
bool RegistryWinClass(HINSTANCE hInstance)
{
WNDCLASSEXW win_class;
hgl_zero(win_class);
WNDCLASSEXW win_class{};
win_class.cbSize = sizeof(WNDCLASSEXW);
win_class.style = CS_HREDRAW | CS_VREDRAW;
@ -54,8 +52,8 @@ namespace hgl
if (width && height)
{
const uint32 screen_width=GetSystemMetrics(SM_CXSCREEN);
const uint32 screen_height=GetSystemMetrics(SM_CYSCREEN);
const int screen_width =GetSystemMetrics(SM_CXSCREEN);
const int screen_height=GetSystemMetrics(SM_CYSCREEN);
win_left = (screen_width - win_width ) / 2;
win_top = (screen_height - win_height) / 2;