Fixed Fullscreen mode + added a method to change the resolution.
This commit is contained in:
parent
261a3be02d
commit
b58e3f72f8
5 changed files with 93 additions and 9 deletions
|
|
@ -1,9 +1,12 @@
|
|||
using OpenTK;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using OpenTK.Input;
|
||||
using SM.Base;
|
||||
using SM.Base.Window;
|
||||
using SM2D;
|
||||
using SM2D.Drawing;
|
||||
using SM2D.Pipelines;
|
||||
using SM2D.Scene;
|
||||
using Font = SM.Base.Drawing.Text.Font;
|
||||
|
|
@ -20,13 +23,24 @@ namespace SM_TEST
|
|||
{
|
||||
window = new GLWindow();
|
||||
window.ApplySetup(new Window2DSetup());
|
||||
window.SetRenderPipeline(Basic2DPipeline.Pipeline);
|
||||
window.SetScene(scene = new Scene());
|
||||
scene.Objects.Add(new DrawObject2D());
|
||||
window.UpdateFrame += WindowOnUpdateFrame;
|
||||
window.Run();
|
||||
|
||||
Debug.WriteLine("Window Closed");
|
||||
}
|
||||
|
||||
private static void WindowOnUpdateFrame(object sender, FrameEventArgs e)
|
||||
{
|
||||
if (SM.Base.Controls.Keyboard.IsDown(Key.F, true))
|
||||
{
|
||||
window.WindowFlags = WindowFlags.ExclusiveFullscreen;
|
||||
window.ChangeFullscreenResolution(DisplayDevice.Default.SelectResolution(1280,720, DisplayDevice.Default.BitsPerPixel, DisplayDevice.Default.RefreshRate));
|
||||
}
|
||||
if (SM.Base.Controls.Keyboard.IsDown(Key.W, true)) window.WindowFlags = WindowFlags.Window;
|
||||
if (SM.Base.Controls.Keyboard.IsDown(Key.B, true)) window.WindowFlags = WindowFlags.BorderlessWindow;
|
||||
|
||||
}
|
||||
|
||||
private static void WindowOnLoad(IGenericWindow window)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue