From 1e5420f42a5608e56824a4e2f1a126e75c06b047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20L=C3=BCbe=C3=9F?= Date: Fri, 13 Nov 2020 13:50:01 +0100 Subject: [PATCH] Replaced sketchy manual linking with not so sketchy override via extension --- .../src/Platform/Windows/WindowsWindow.bf | 21 ++++++++++++------- GlitchyEngine/src/Window.bf | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/GlitchyEngine/src/Platform/Windows/WindowsWindow.bf b/GlitchyEngine/src/Platform/Windows/WindowsWindow.bf index d391a10..ed77ab6 100644 --- a/GlitchyEngine/src/Platform/Windows/WindowsWindow.bf +++ b/GlitchyEngine/src/Platform/Windows/WindowsWindow.bf @@ -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; diff --git a/GlitchyEngine/src/Window.bf b/GlitchyEngine/src/Window.bf index 9ac2647..ab1b8cb 100644 --- a/GlitchyEngine/src/Window.bf +++ b/GlitchyEngine/src/Window.bf @@ -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. */