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;
+1 -1
View File
@@ -37,7 +37,6 @@ namespace GlitchyEngine
/**
* Function used to create a platform specific window.
*/
[LinkName("GlitchyEngine.Window.CreateWindow")]
public static extern Window CreateWindow(WindowDescription description);
/**
@@ -66,6 +65,7 @@ namespace GlitchyEngine
* Gets or Sets the height of the window.
*/
public abstract int32 Height {get; set;}
/**
* Gets or Sets the x-coordinate of the upper-left corner of the client area of the window.
*/