This commit is contained in:
maxwes08
2025-09-15 10:48:45 +02:00
parent 50f9d4c0c8
commit 40dd5c3a9e
4 changed files with 90 additions and 31 deletions

View File

@@ -2,6 +2,7 @@
using OpenTK.Windowing.Common;
using OpenTK.Windowing.Common.Input;
using OpenTK.Windowing.Desktop;
using OpenTK.Windowing.GraphicsLibraryFramework;
namespace Voxel
{
@@ -17,11 +18,19 @@ namespace Voxel
{
base.OnUpdateFrame(e);
if (Input.GetKey(OpenTK.Windowing.GraphicsLibraryFramework.Keys.Escape))
if (Input.GetKey(Keys.Escape))
{
Close();
}
if (Input.GetKey(Keys.F11))
{
if (!IsFullscreen)
WindowState = WindowState.Fullscreen;
else
WindowState = WindowState.Normal;
}
if (Player != null)
{
Player.Update((float)e.Time);
@@ -93,5 +102,17 @@ namespace Voxel
base.OnKeyDown(e);
Input.SetKey(e.Key, true);
}
protected override void OnMouseDown(MouseButtonEventArgs e)
{
base.OnMouseDown(e);
Input.SetMouseButton(e.Button, true);
}
protected override void OnMouseUp(MouseButtonEventArgs e)
{
base.OnMouseUp(e);
Input.SetMouseButton(e.Button, false);
}
}
}