Normalized line endings.

This commit is contained in:
the_fiddler 2008-05-03 16:34:39 +00:00
parent cecc9c4867
commit 3d07e2597f
2 changed files with 78 additions and 78 deletions

View file

@ -8,11 +8,11 @@ using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using System.Drawing;
using System.Threading;
using System.Drawing;
using System.Threading;
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Graphics;
using OpenTK.Input;
namespace Examples.Tests
@ -21,49 +21,49 @@ namespace Examples.Tests
public class GameWindowStates : GameWindow
{
TextureFont font = new TextureFont(new Font(FontFamily.GenericSansSerif, 16.0f));
TextPrinter printer = new TextPrinter();
WindowState[] window_state_sequence = new WindowState[]
{
WindowState.Normal,
WindowState.Maximized,
WindowState.Fullscreen,
WindowState.Minimized
};
WindowBorder[] window_border_sequence = new WindowBorder[]
{
WindowBorder.Resizable,
WindowBorder.Fixed,
WindowBorder.Hidden,
};
int window_state_counter = 0;
int WindowStateCounter
{
get { return window_state_counter; }
set
{
if (value < 0)
window_state_counter = window_state_sequence.Length - 1;
else
window_state_counter = ++window_state_counter % window_state_sequence.Length;
}
}
int window_border_counter = 0;
int WindowBorderCounter
{
get { return window_border_counter; }
set
{
if (value < 0)
window_border_counter = window_border_sequence.Length - 1;
else
window_border_counter = ++window_border_counter % window_border_sequence.Length;
}
}
TextPrinter printer = new TextPrinter();
WindowState[] window_state_sequence = new WindowState[]
{
WindowState.Normal,
WindowState.Maximized,
WindowState.Fullscreen,
WindowState.Minimized
};
WindowBorder[] window_border_sequence = new WindowBorder[]
{
WindowBorder.Resizable,
WindowBorder.Fixed,
WindowBorder.Hidden,
};
int window_state_counter = 0;
int WindowStateCounter
{
get { return window_state_counter; }
set
{
if (value < 0)
window_state_counter = window_state_sequence.Length - 1;
else
window_state_counter = ++window_state_counter % window_state_sequence.Length;
}
}
int window_border_counter = 0;
int WindowBorderCounter
{
get { return window_border_counter; }
set
{
if (value < 0)
window_border_counter = window_border_sequence.Length - 1;
else
window_border_counter = ++window_border_counter % window_border_sequence.Length;
}
}
public GameWindowStates()
@ -84,32 +84,32 @@ namespace Examples.Tests
this.Exit();
break;
case OpenTK.Input.Key.Number1:
if (sender[Key.ShiftLeft] || sender[Key.ShiftRight])
WindowStateCounter--;
else
WindowStateCounter++;
WindowState = window_state_sequence[WindowStateCounter];
case OpenTK.Input.Key.Number1:
if (sender[Key.ShiftLeft] || sender[Key.ShiftRight])
WindowStateCounter--;
else
WindowStateCounter++;
WindowState = window_state_sequence[WindowStateCounter];
// switch (this.WindowState)
// {
// case WindowState.Normal: this.WindowState = WindowState.Maximized; break;1
// case WindowState.Maximized: this.WindowState = WindowState.Fullscreen; break;
// case WindowState.Fullscreen:
// this.WindowState = WindowState.Normal;
// this.WindowState = WindowState.Minimized;
// break;
// case WindowState.Maximized: this.WindowState = WindowState.Fullscreen; break;
// case WindowState.Fullscreen:
// this.WindowState = WindowState.Normal;
// this.WindowState = WindowState.Minimized;
// break;
// case WindowState.Minimized: this.WindowState = WindowState.Normal;
// break;
//
// }
break;
case OpenTK.Input.Key.Number2:
if (sender[Key.ShiftLeft] || sender[Key.ShiftRight])
WindowBorderCounter--;
else
WindowBorderCounter++;
case OpenTK.Input.Key.Number2:
if (sender[Key.ShiftLeft] || sender[Key.ShiftRight])
WindowBorderCounter--;
else
WindowBorderCounter++;
WindowBorder = window_border_sequence[WindowBorderCounter];
// this.WindowState = WindowState.Normal;
// switch (this.WindowBorder)
@ -119,14 +119,14 @@ namespace Examples.Tests
// case WindowBorder.Resizable: this.WindowBorder = WindowBorder.Fixed; break;
// }
break;
case OpenTK.Input.Key.Number3:
if (this.WindowState == WindowState.Fullscreen)
this.WindowState = WindowState.Normal;
else
this.WindowState = WindowState.Fullscreen;
break;
case OpenTK.Input.Key.Number3:
if (this.WindowState == WindowState.Fullscreen)
this.WindowState = WindowState.Normal;
else
this.WindowState = WindowState.Fullscreen;
break;
}
}
@ -143,17 +143,17 @@ namespace Examples.Tests
printer.Begin();
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);
printer.Draw(String.Format("2 - cycle through window borders (current: {0}).", this.WindowBorder), font);
GL.Translate(0, font.Height, 0);
printer.Draw(String.Format("3 - toggle fullscreen (current: {0}).",
this.WindowState == WindowState.Fullscreen ? "enabled" : "disabled"), font);
printer.Draw(String.Format("2 - cycle through window borders (current: {0}).", this.WindowBorder), font);
GL.Translate(0, font.Height, 0);
printer.Draw(String.Format("3 - toggle fullscreen (current: {0}).",
this.WindowState == WindowState.Fullscreen ? "enabled" : "disabled"), font);
printer.End();
SwapBuffers();
SwapBuffers();
Thread.Sleep(5);
}
@ -161,7 +161,7 @@ namespace Examples.Tests
{
using (GameWindowStates ex = new GameWindowStates())
{
Utilities.SetWindowTitle(ex);
Utilities.SetWindowTitle(ex);
ex.Run(20.0);
}
}

View file

@ -538,7 +538,7 @@ namespace OpenTK.Platform.Windows
break;
case WindowBorder.Fixed:
style |= WindowStyle.OverlappedWindow & ~(WindowStyle.ThickFrame | WindowStyle.MaximizeBox |
style |= WindowStyle.OverlappedWindow & ~(WindowStyle.ThickFrame | WindowStyle.MaximizeBox |
WindowStyle.SizeBox);
break;