Added a way to create window platform independant

This commit is contained in:
Simon Lübeß
2020-11-09 22:36:36 +01:00
parent efb46ff25c
commit 9a84e0409f
3 changed files with 15 additions and 2 deletions
+1 -2
View File
@@ -14,8 +14,7 @@ namespace GlitchyEngine
public this()
{
// Todo: make Platform independent
_window = new WindowsWindow(WindowDescription());
_window = Window.CreateWindow(WindowDescription());
_window.EventCallback = new => OnEvent;
}
@@ -108,6 +108,14 @@ namespace GlitchyEngine.Platform.Windows
set;
}
#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;
+6
View File
@@ -34,6 +34,12 @@ namespace GlitchyEngine
protected EventCallback _eventCallback ~ delete _;
/**
* Function used to create a platform specific window.
*/
[LinkName("GlitchyEngine.Window.CreateWindow")]
public static extern Window CreateWindow(WindowDescription description);
/**
* Gets or Sets the minimum width of the window.
*/