Added NativeWindow-property to Window

This commit is contained in:
Simon Lübeß
2020-11-13 19:44:16 +01:00
parent 6b97fdaccb
commit 001bd346a9
2 changed files with 11 additions and 6 deletions
@@ -126,6 +126,8 @@ namespace GlitchyEngine.Platform.Windows
set => _isVSync = value; set => _isVSync = value;
} }
public override void* NativeWindow => (void*)(int)_windowHandle;
public this(WindowDescription desc) public this(WindowDescription desc)
{ {
_minMaxInfo.MaximumTrackingSize.x = int32.MaxValue; _minMaxInfo.MaximumTrackingSize.x = int32.MaxValue;
+9 -6
View File
@@ -27,18 +27,12 @@ namespace GlitchyEngine
} }
} }
// Todo: interface?
public abstract class Window public abstract class Window
{ {
public delegate void EventCallback(Event e); public delegate void EventCallback(Event e);
protected EventCallback _eventCallback ~ delete _; protected EventCallback _eventCallback ~ delete _;
/**
* Function used to create a platform specific window.
*/
public static extern Window CreateWindow(WindowDescription description);
/** /**
* Gets or Sets the minimum width of the window. * Gets or Sets the minimum width of the window.
*/ */
@@ -85,6 +79,10 @@ namespace GlitchyEngine
*/ */
public abstract bool IsVSync {get; set;} public abstract bool IsVSync {get; set;}
public abstract void* NativeWindow {get;}
public EventCallback EventCallback public EventCallback EventCallback
{ {
get => _eventCallback; get => _eventCallback;
@@ -92,5 +90,10 @@ namespace GlitchyEngine
} }
public abstract void Update(); public abstract void Update();
/**
* Function used to create a platform specific window.
*/
public static extern Window CreateWindow(WindowDescription description);
} }
} }