mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-08-04 02:32:13 +00:00
Normalized line endings.
This commit is contained in:
parent
70fc0db9ee
commit
8905630f12
|
@ -8,11 +8,11 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
using OpenTK.Input;
|
using OpenTK.Input;
|
||||||
|
|
||||||
namespace Examples.Tests
|
namespace Examples.Tests
|
||||||
|
@ -21,49 +21,49 @@ namespace Examples.Tests
|
||||||
public class GameWindowStates : GameWindow
|
public class GameWindowStates : GameWindow
|
||||||
{
|
{
|
||||||
TextureFont font = new TextureFont(new Font(FontFamily.GenericSansSerif, 16.0f));
|
TextureFont font = new TextureFont(new Font(FontFamily.GenericSansSerif, 16.0f));
|
||||||
TextPrinter printer = new TextPrinter();
|
TextPrinter printer = new TextPrinter();
|
||||||
|
|
||||||
WindowState[] window_state_sequence = new WindowState[]
|
WindowState[] window_state_sequence = new WindowState[]
|
||||||
{
|
{
|
||||||
WindowState.Normal,
|
WindowState.Normal,
|
||||||
WindowState.Maximized,
|
WindowState.Maximized,
|
||||||
WindowState.Fullscreen,
|
WindowState.Fullscreen,
|
||||||
WindowState.Minimized
|
WindowState.Minimized
|
||||||
};
|
};
|
||||||
|
|
||||||
WindowBorder[] window_border_sequence = new WindowBorder[]
|
WindowBorder[] window_border_sequence = new WindowBorder[]
|
||||||
{
|
{
|
||||||
WindowBorder.Resizable,
|
WindowBorder.Resizable,
|
||||||
WindowBorder.Fixed,
|
WindowBorder.Fixed,
|
||||||
WindowBorder.Hidden,
|
WindowBorder.Hidden,
|
||||||
};
|
};
|
||||||
|
|
||||||
int window_state_counter = 0;
|
int window_state_counter = 0;
|
||||||
int WindowStateCounter
|
int WindowStateCounter
|
||||||
{
|
{
|
||||||
get { return window_state_counter; }
|
get { return window_state_counter; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (value < 0)
|
if (value < 0)
|
||||||
window_state_counter = window_state_sequence.Length - 1;
|
window_state_counter = window_state_sequence.Length - 1;
|
||||||
else
|
else
|
||||||
window_state_counter = ++window_state_counter % window_state_sequence.Length;
|
window_state_counter = ++window_state_counter % window_state_sequence.Length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int window_border_counter = 0;
|
int window_border_counter = 0;
|
||||||
int WindowBorderCounter
|
int WindowBorderCounter
|
||||||
{
|
{
|
||||||
get { return window_border_counter; }
|
get { return window_border_counter; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (value < 0)
|
if (value < 0)
|
||||||
window_border_counter = window_border_sequence.Length - 1;
|
window_border_counter = window_border_sequence.Length - 1;
|
||||||
else
|
else
|
||||||
window_border_counter = ++window_border_counter % window_border_sequence.Length;
|
window_border_counter = ++window_border_counter % window_border_sequence.Length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public GameWindowStates()
|
public GameWindowStates()
|
||||||
|
@ -84,32 +84,32 @@ namespace Examples.Tests
|
||||||
this.Exit();
|
this.Exit();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OpenTK.Input.Key.Number1:
|
case OpenTK.Input.Key.Number1:
|
||||||
if (sender[Key.ShiftLeft] || sender[Key.ShiftRight])
|
if (sender[Key.ShiftLeft] || sender[Key.ShiftRight])
|
||||||
WindowStateCounter--;
|
WindowStateCounter--;
|
||||||
else
|
else
|
||||||
WindowStateCounter++;
|
WindowStateCounter++;
|
||||||
WindowState = window_state_sequence[WindowStateCounter];
|
WindowState = window_state_sequence[WindowStateCounter];
|
||||||
|
|
||||||
// switch (this.WindowState)
|
// switch (this.WindowState)
|
||||||
// {
|
// {
|
||||||
// case WindowState.Normal: this.WindowState = WindowState.Maximized; break;1
|
// case WindowState.Normal: this.WindowState = WindowState.Maximized; break;1
|
||||||
// case WindowState.Maximized: this.WindowState = WindowState.Fullscreen; break;
|
// case WindowState.Maximized: this.WindowState = WindowState.Fullscreen; break;
|
||||||
// case WindowState.Fullscreen:
|
// case WindowState.Fullscreen:
|
||||||
// this.WindowState = WindowState.Normal;
|
// this.WindowState = WindowState.Normal;
|
||||||
// this.WindowState = WindowState.Minimized;
|
// this.WindowState = WindowState.Minimized;
|
||||||
// break;
|
// break;
|
||||||
// case WindowState.Minimized: this.WindowState = WindowState.Normal;
|
// case WindowState.Minimized: this.WindowState = WindowState.Normal;
|
||||||
// break;
|
// break;
|
||||||
//
|
//
|
||||||
// }
|
// }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OpenTK.Input.Key.Number2:
|
case OpenTK.Input.Key.Number2:
|
||||||
if (sender[Key.ShiftLeft] || sender[Key.ShiftRight])
|
if (sender[Key.ShiftLeft] || sender[Key.ShiftRight])
|
||||||
WindowBorderCounter--;
|
WindowBorderCounter--;
|
||||||
else
|
else
|
||||||
WindowBorderCounter++;
|
WindowBorderCounter++;
|
||||||
WindowBorder = window_border_sequence[WindowBorderCounter];
|
WindowBorder = window_border_sequence[WindowBorderCounter];
|
||||||
// this.WindowState = WindowState.Normal;
|
// this.WindowState = WindowState.Normal;
|
||||||
// switch (this.WindowBorder)
|
// switch (this.WindowBorder)
|
||||||
|
@ -119,14 +119,14 @@ namespace Examples.Tests
|
||||||
// case WindowBorder.Resizable: this.WindowBorder = WindowBorder.Fixed; break;
|
// case WindowBorder.Resizable: this.WindowBorder = WindowBorder.Fixed; break;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OpenTK.Input.Key.Number3:
|
case OpenTK.Input.Key.Number3:
|
||||||
if (this.WindowState == WindowState.Fullscreen)
|
if (this.WindowState == WindowState.Fullscreen)
|
||||||
this.WindowState = WindowState.Normal;
|
this.WindowState = WindowState.Normal;
|
||||||
else
|
else
|
||||||
this.WindowState = WindowState.Fullscreen;
|
this.WindowState = WindowState.Fullscreen;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -143,17 +143,17 @@ namespace Examples.Tests
|
||||||
printer.Begin();
|
printer.Begin();
|
||||||
|
|
||||||
printer.Draw("Instructions:", font); GL.Translate(0, font.Height, 0);
|
printer.Draw("Instructions:", font); GL.Translate(0, font.Height, 0);
|
||||||
printer.Draw(String.Format("1 - cycle through window styles (current: {0}).", this.WindowState), font);
|
printer.Draw(String.Format("1 - cycle through window styles (current: {0}).", this.WindowState), font);
|
||||||
GL.Translate(0, font.Height, 0);
|
GL.Translate(0, font.Height, 0);
|
||||||
printer.Draw(String.Format("2 - cycle through window borders (current: {0}).", this.WindowBorder), font);
|
printer.Draw(String.Format("2 - cycle through window borders (current: {0}).", this.WindowBorder), font);
|
||||||
GL.Translate(0, font.Height, 0);
|
GL.Translate(0, font.Height, 0);
|
||||||
printer.Draw(String.Format("3 - toggle fullscreen (current: {0}).",
|
printer.Draw(String.Format("3 - toggle fullscreen (current: {0}).",
|
||||||
this.WindowState == WindowState.Fullscreen ? "enabled" : "disabled"), font);
|
this.WindowState == WindowState.Fullscreen ? "enabled" : "disabled"), font);
|
||||||
|
|
||||||
|
|
||||||
printer.End();
|
printer.End();
|
||||||
|
|
||||||
SwapBuffers();
|
SwapBuffers();
|
||||||
Thread.Sleep(5);
|
Thread.Sleep(5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ namespace Examples.Tests
|
||||||
{
|
{
|
||||||
using (GameWindowStates ex = new GameWindowStates())
|
using (GameWindowStates ex = new GameWindowStates())
|
||||||
{
|
{
|
||||||
Utilities.SetWindowTitle(ex);
|
Utilities.SetWindowTitle(ex);
|
||||||
ex.Run(20.0);
|
ex.Run(20.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -538,7 +538,7 @@ namespace OpenTK.Platform.Windows
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WindowBorder.Fixed:
|
case WindowBorder.Fixed:
|
||||||
style |= WindowStyle.OverlappedWindow & ~(WindowStyle.ThickFrame | WindowStyle.MaximizeBox |
|
style |= WindowStyle.OverlappedWindow & ~(WindowStyle.ThickFrame | WindowStyle.MaximizeBox |
|
||||||
WindowStyle.SizeBox);
|
WindowStyle.SizeBox);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue