Implemented Layers and LayerStack

This commit is contained in:
Simon Lübeß
2020-11-09 00:10:02 +01:00
parent aa2165ef77
commit efb46ff25c
6 changed files with 148 additions and 15 deletions
+29 -2
View File
@@ -1,17 +1,44 @@
using System;
using GlitchyEngine;
using GlitchyEngine.Events;
using System.Diagnostics;
using GlitchLog;
namespace Sandbox
{
class ExampleLayer : Layer
{
[AllowAppend]
public this() : base("Example") { }
public override void Update()
{
Log.ClientLogger.Info("ExampleLayer.Update");
// Just for temporary vsyncing
// Todo: remove
DwmFlush();
}
[CLink, Import("Dwmapi.lib")]
static extern void DwmFlush();
public override void OnEvent(Event event)
{
Log.ClientLogger.Trace("{}", event);
}
}
class SandboxApp : Application
{
public this()
{
PushLayer(new ExampleLayer());
}
[Export, LinkName("CreateApplication")]
public static Application CreateApplication()
{
return new SandboxApp();
}
}