WindowsWindow now calls DestroyWindow

This commit is contained in:
Simon Lübeß
2020-12-30 14:48:37 +01:00
parent 9a010f7c4a
commit a02b781347
@@ -159,11 +159,20 @@ namespace GlitchyEngine
Init(desc);
}
[LinkName(.C)]
static extern Windows.IntBool DestroyWindow(Windows.HWnd hWnd);
[LinkName("UnregisterClassW")]
static extern Windows.IntBool UnregisterClass(char16* className, Windows.HInstance hInstance);
public ~this()
{
if(!DestroyWindow(_windowHandle))
{
HResult res = (.)GetLastError();
Log.EngineLogger.Error($"Failed to destroy window: Message ({(int)res}): {res}");
}
UnregisterClass(WindowClassName.ToScopedNativeWChar!(), _instanceHandle);
}