mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
Implemented Layers and LayerStack
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user