Replaced sketchy manual linking with not so sketchy override via extension

This commit is contained in:
Simon Lübeß
2020-11-13 13:50:01 +01:00
parent 4401d80948
commit 1e5420f42a
2 changed files with 14 additions and 9 deletions
@@ -10,6 +10,19 @@ using imgui_beef;
using GlitchyEngine.Platform.DX11;
using static System.Windows;
namespace GlitchyEngine
{
#if GE_WINDOWS
public extension Window
{
public static override Window CreateWindow(WindowDescription description)
{
return new GlitchyEngine.Platform.Windows.WindowsWindow(description);
}
}
#endif
}
namespace GlitchyEngine.Platform.Windows
{
public class WindowsWindow : Window
@@ -113,14 +126,6 @@ namespace GlitchyEngine.Platform.Windows
set => _isVSync = value;
}
#if GE_WINDOWS
[Export, LinkName("GlitchyEngine.Window.CreateWindow")]
public static new Window CreateWindow(WindowDescription description)
{
return new WindowsWindow(description);
}
#endif
public this(WindowDescription desc)
{
_minMaxInfo.MaximumTrackingSize.x = int32.MaxValue;