peak
This commit is contained in:
23
Window.cs
23
Window.cs
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user