Implemented WindowsWindow and EventCallback

This commit is contained in:
Simon Lübeß
2020-11-08 18:21:54 +01:00
parent 634f310b7f
commit aa2165ef77
4 changed files with 331 additions and 44 deletions
+38 -1
View File
@@ -1,4 +1,6 @@
using System;
using GlitchyEngine.Events;
namespace GlitchyEngine
{
public struct WindowDescription
@@ -28,7 +30,27 @@ namespace GlitchyEngine
// Todo: interface?
public abstract class Window
{
// Todo: callback/events?
public delegate void EventCallback(Event e);
protected EventCallback _eventCallback ~ delete _;
/**
* Gets or Sets the minimum width of the window.
*/
public abstract int32 MinWidth {get; set;}
/**
* Gets or Sets the minimum height of the window.
*/
public abstract int32 MinHeight {get; set;}
/**
* Gets or Sets the maximum width of the window.
*/
public abstract int32 MaxWidth {get; set;}
/**
* Gets or Sets the maximum height of the window.
*/
public abstract int32 MaxHeight {get; set;}
/**
* Gets or Sets the width of the window.
@@ -38,6 +60,15 @@ 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.
*/
public abstract int32 PositionX {get; set;}
/**
* Gets or Sets the y-coordinate of the upper-left corner of the client area of the window.
*/
public abstract int32 PositionY {get; set;}
/**
* Gets or Sets the windows title.
*/
@@ -48,6 +79,12 @@ namespace GlitchyEngine
*/
public abstract bool IsVSync {get; set;}
public EventCallback EventCallback
{
get => _eventCallback;
set => _eventCallback = value;
}
public abstract void Update();
}
}