Skip to content

Commit

Permalink
Fixed WindowState, Start working on the new Input system.
Browse files Browse the repository at this point in the history
  • Loading branch information
MrScautHD committed Sep 19, 2024
1 parent e3b65dc commit a0e6705
Show file tree
Hide file tree
Showing 8 changed files with 479 additions and 324 deletions.
22 changes: 18 additions & 4 deletions src/Bliss.Test/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
using Bliss.CSharp.Graphics.Rendering.Batches.Primitives;
using Bliss.CSharp.Graphics.Rendering.Batches.Sprites;
using Bliss.CSharp.Graphics.Rendering.Passes;
using Bliss.CSharp.Interact;
using Bliss.CSharp.Interact.Keyboards;
using Bliss.CSharp.Logging;
using Bliss.CSharp.Textures;
using Bliss.CSharp.Windowing;
Expand Down Expand Up @@ -76,7 +78,7 @@ public void Run() {
this.CommandList = this.GraphicsDevice.ResourceFactory.CreateCommandList();

Logger.Info("Initialize input...");
//TODO: Input.Init(this.MainWindow);
Input.Init(this.MainWindow);

this.Init();

Expand All @@ -88,7 +90,7 @@ public void Run() {
Time.Update();

this.MainWindow.PumpEvents();
//TODO: Input.Begin(this.MainWindow.PumpEvents());
Input.Begin();

if (!this.MainWindow.Exists) {
break;
Expand All @@ -104,7 +106,7 @@ public void Run() {
}

this.Draw(this.GraphicsDevice, this.CommandList);
//TODO: Input.End();
Input.End();
}

Logger.Warn("Application shuts down!");
Expand All @@ -121,7 +123,19 @@ protected virtual void Init() {
this._font = new Font("content/fonts/fontoe.ttf");
}

protected virtual void Update() { }
protected virtual void Update() {
if (Input.IsKeyPressed(KeyboardKey.A)) {
Logger.Warn("A GOT PRESSED!!!!");
}

if (Input.IsKeyDown(KeyboardKey.D)) {
Logger.Warn("D IS DOWN!!!!");
}

if (Input.IsKeyReleased(KeyboardKey.D)) {
Logger.Warn("D IS Released!!!!");
}
}

protected virtual void AfterUpdate() { }

Expand Down
Loading

0 comments on commit a0e6705

Please sign in to comment.