Remove redundant methods from OpenTK

This commit is contained in:
UnknownShadow200 2017-05-28 17:17:25 +10:00
parent 9536fa2483
commit 37e0f0fdda
7 changed files with 10 additions and 103 deletions

View File

@ -11,6 +11,9 @@ namespace ClassicalSharp {
/// <summary> Implementation of a native window and native input handling mechanism on Windows, OSX, and Linux. </summary>
public sealed class DesktopWindow : GameWindow, IPlatformWindow {
public int Width { get { return ClientSize.Width; } }
public int Height { get { return ClientSize.Height; } }
Game game;
public DesktopWindow(Game game, string username, bool nullContext, int width, int height) :
base(width, height, GraphicsMode.Default, Program.AppName + " (" + username + ")", nullContext, 0, DisplayDevice.Default) {

View File

@ -43,10 +43,10 @@ namespace Launcher {
public AsyncDownloader Downloader;
/// <summary> Returns the width of the client drawing area. </summary>
public int Width { get { return Window.Width; } }
public int Width { get { return Window.ClientSize.Width; } }
/// <summary> Returns the height of the client drawing area. </summary>
public int Height { get { return Window.Height; } }
public int Height { get { return Window.ClientSize.Height; } }
/// <summary> Bitmap that contains the entire array of pixels that describe the client drawing area. </summary>
public Bitmap Framebuffer;

View File

@ -73,18 +73,6 @@ namespace OpenTK {
/// <summary> Gets or sets a <see cref="System.Drawing.Size"/> structure that contains the external size of this window. </summary>
Size Size { get; set; }
/// <summary> Gets or sets the horizontal location of this window on the desktop. </summary>
int X { get; set; }
/// <summary> Gets or sets the vertical location of this window on the desktop. </summary>
int Y { get; set; }
/// <summary> Gets or sets the external width of this window. </summary>
int Width { get; set; }
/// <summary> Gets or sets the external height of this window. </summary>
int Height { get; set; }
/// <summary> Gets or sets a <see cref="System.Drawing.Rectangle"/> structure that contains the internal bounds of this window, in client coordinates.
/// The internal bounds include the drawing area of the window, but exclude the titlebar and window borders. </summary>
Rectangle ClientRectangle { get; set; }

View File

@ -165,12 +165,6 @@ namespace OpenTK {
public bool Focused {
get { EnsureUndisposed(); return implementation.Focused; }
}
/// <summary> Gets or sets the external height of this window. </summary>
public int Height {
get { EnsureUndisposed(); return implementation.Height; }
set { EnsureUndisposed(); implementation.Height = value; }
}
/// <summary> Gets or sets the System.Drawing.Icon for this GameWindow. </summary>
public Icon Icon {
@ -201,12 +195,6 @@ namespace OpenTK {
get { EnsureUndisposed(); return implementation.Visible; }
set { EnsureUndisposed(); implementation.Visible = value; }
}
/// <summary> Gets or sets the external width of this window. </summary>
public int Width {
get { EnsureUndisposed(); return implementation.Width; }
set { EnsureUndisposed(); implementation.Width = value; }
}
/// <summary> Gets the <see cref="OpenTK.Platform.IWindowInfo"/> of this window. </summary>
public IWindowInfo WindowInfo {
@ -219,18 +207,6 @@ namespace OpenTK {
set { implementation.WindowState = value; }
}
/// <summary> Gets or sets the horizontal location of this window on the desktop. </summary>
public int X {
get { EnsureUndisposed(); return implementation.X; }
set { EnsureUndisposed(); implementation.X = value; }
}
/// <summary> Gets or sets the vertical location of this window on the desktop. </summary>
public int Y {
get { EnsureUndisposed(); return implementation.Y; }
set { EnsureUndisposed(); implementation.Y = value; }
}
/// <summary> Gets the primary Keyboard device, or null if no Keyboard exists. </summary>
public KeyboardDevice Keyboard {
get { return implementation.Keyboard; }

View File

@ -191,9 +191,9 @@ namespace OpenTK.Platform.MacOS
int width, height;
context.SetFullScreen(window, out width, out height);
Debug.Print("Prev Size: {0}, {1}", Width, Height);
Debug.Print("Prev Size: {0}, {1}", ClientSize.Width, ClientSize.Height);
clientRectangle.Size = new Size(width, height);
Debug.Print("New Size: {0}, {1}", Width, Height);
Debug.Print("New Size: {0}, {1}", ClientSize.Width, ClientSize.Height);
// TODO: if we go full screen we need to make this use the device specified.
bounds = mDisplayDevice.Bounds;
@ -316,12 +316,12 @@ namespace OpenTK.Platform.MacOS
return OSStatus.NoError;
case WindowEventKind.WindowBoundsChanged:
int thisWidth = Width;
int thisHeight = Height;
int thisWidth = ClientSize.Width;
int thisHeight = ClientSize.Height;
LoadSize();
if (thisWidth != Width || thisHeight != Height)
if (thisWidth != ClientSize.Width || thisHeight != ClientSize.Height)
OnResize();
return OSStatus.EventNotHandled;
@ -752,26 +752,6 @@ namespace OpenTK.Platform.MacOS
set { SetSize((short)value.Width, (short)value.Height); }
}
public int Width {
get { return ClientRectangle.Width; }
set { SetClientSize((short)value, (short)Height); }
}
public int Height {
get { return ClientRectangle.Height; }
set { SetClientSize((short)Width, (short)value); }
}
public int X {
get { return ClientRectangle.X; }
set { Location = new Point(value, Y); }
}
public int Y {
get { return ClientRectangle.Y; }
set { Location = new Point(X, value); }
}
public Rectangle ClientRectangle {
get { return clientRectangle; }
set {

View File

@ -503,26 +503,6 @@ namespace OpenTK.Platform.Windows
}
}
public int Width {
get { return ClientRectangle.Width; }
set { ClientRectangle = new Rectangle(0, 0, value, Height); }
}
public int Height {
get { return ClientRectangle.Height; }
set { ClientRectangle = new Rectangle(0, 0, Width, value); }
}
public int X {
get { return Location.X; }
set { Location = new Point(value, Y); }
}
public int Y {
get { return Location.Y; }
set { Location = new Point(X, value); }
}
public Icon Icon {
get { return icon; }
set {

View File

@ -482,26 +482,6 @@ namespace OpenTK.Platform.X11 {
get { return ClientRectangle.Size; }
set { ClientRectangle = new Rectangle(Point.Empty, value); }
}
public int Width {
get { return ClientSize.Width; }
set { ClientSize = new Size(value, Height); }
}
public int Height {
get { return ClientSize.Height; }
set { ClientSize = new Size(Width, value); }
}
public int X {
get { return Location.X; }
set { Location = new Point(value, Y); }
}
public int Y {
get { return Location.Y; }
set { Location = new Point(X, value); }
}
public Icon Icon {
get { return icon; }