get rid of some unused code

This commit is contained in:
UnknownShadow200 2018-06-05 22:45:26 +10:00
parent 918b204cbc
commit 0ece5b49f8
11 changed files with 8 additions and 134 deletions

View File

@ -253,7 +253,6 @@
<Compile Include="Math\Picking.cs" />
<Compile Include="Platform\DesktopWindow.cs" />
<Compile Include="Platform\Font.cs" />
<Compile Include="Platform\IPlatformWindow.cs" />
<Compile Include="Platform\Platform.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />

View File

@ -207,7 +207,7 @@ namespace ClassicalSharp {
}
}
internal IPlatformWindow window;
internal DesktopWindow window;
public MouseDevice Mouse;
public KeyboardDevice Keyboard;

View File

@ -9,7 +9,7 @@ using Clipboard = System.Windows.Forms.Clipboard;
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 sealed class DesktopWindow : GameWindow {
public int Width { get { return ClientSize.Width; } }
public int Height { get { return ClientSize.Height; } }

View File

@ -1,51 +0,0 @@
// Copyright 2014-2017 ClassicalSharp | Licensed under BSD-3
using System;
using System.Drawing;
using OpenTK;
using OpenTK.Input;
using OpenTK.Platform;
namespace ClassicalSharp {
/// <summary> Abstracts away a platform specific window, and input handler mechanism. </summary>
public interface IPlatformWindow {
Size ClientSize { get; set; }
int Width { get; }
int Height { get; }
bool VSync { get; set; }
bool Exists { get; }
bool Focused { get; }
bool CursorVisible { get; set; }
Point DesktopCursorPos { get; set; }
MouseDevice Mouse { get; }
KeyboardDevice Keyboard { get; }
Point PointToScreen(Point coords);
WindowState WindowState { get; set; }
IWindowInfo WindowInfo { get; }
string ClipboardText { get; set; }
void LoadIcon();
void Run();
void SwapBuffers();
void Exit();
event EventHandler<KeyPressEventArgs> KeyPress;
}
}

View File

@ -1,9 +1,8 @@
// Copyright 2014-2017 ClassicalSharp | Licensed under BSD-3
using System;
using System.IO;
using System.Net;
using System.Windows.Forms;
using OpenTK;
using System;
using System.IO;
using System.Net;
using OpenTK;
namespace ClassicalSharp {

View File

@ -1,8 +1,6 @@
// ClassicalSharp copyright 2014-2016 UnknownShadow200 | Licensed under MIT
using System;
using System.IO;
using System.Windows.Forms;
using ClassicalSharp;
using System;
using ClassicalSharp;
namespace Launcher {

View File

@ -131,11 +131,5 @@ namespace OpenTK {
/// <summary> Occurs whenever a character is typed. </summary>
event EventHandler<KeyPressEventArgs> KeyPress;
/// <summary> Occurs whenever the mouse cursor leaves the window <see cref="Bounds"/>. </summary>
event EventHandler MouseLeave;
/// <summary> Occurs whenever the mouse cursor enters the window <see cref="Bounds"/>. </summary>
event EventHandler MouseEnter;
}
}

View File

@ -229,12 +229,6 @@ namespace OpenTK {
/// <summary> Occurs whenever the window is moved. </summary>
public event EventHandler Move;
/// <summary> Occurs whenever the mouse cursor enters the window <see cref="Bounds"/>. </summary>
public event EventHandler MouseEnter;
/// <summary> Occurs whenever the mouse cursor leaves the window <see cref="Bounds"/>. </summary>
public event EventHandler MouseLeave;
/// <summary> Occurs whenever the window is resized. </summary>
public event EventHandler Resize;
@ -298,16 +292,6 @@ namespace OpenTK {
protected virtual void OnMove(object sender, EventArgs e) {
if (Move != null) Move(this, e);
}
/// <summary> Called whenever the mouse cursor reenters the window <see cref="Bounds"/>. </summary>
protected virtual void OnMouseEnter(object sender, EventArgs e) {
if (MouseEnter != null) MouseEnter(this, e);
}
/// <summary> Called whenever the mouse cursor leaves the window <see cref="Bounds"/>. </summary>
protected virtual void OnMouseLeave(object sender, EventArgs e) {
if (MouseLeave != null) MouseLeave(this, e);
}
/// <summary> Called when the NativeWindow is resized. </summary>
/// <param name="e">Not used.</param>
@ -349,8 +333,6 @@ namespace OpenTK {
implementation.Disposed += OnDisposed;
implementation.FocusedChanged += OnFocusedChanged;
implementation.KeyPress += OnKeyPress;
implementation.MouseEnter += OnMouseEnter;
implementation.MouseLeave += OnMouseLeave;
implementation.Move += OnMove;
implementation.Resize += OnResize;
implementation.VisibleChanged += OnVisibleChanged;
@ -362,8 +344,6 @@ namespace OpenTK {
implementation.Disposed -= OnDisposed;
implementation.FocusedChanged -= OnFocusedChanged;
implementation.KeyPress -= OnKeyPress;
implementation.MouseEnter -= OnMouseEnter;
implementation.MouseLeave -= OnMouseLeave;
implementation.Move -= OnMove;
implementation.Resize -= OnResize;
implementation.VisibleChanged -= OnVisibleChanged;

View File

@ -55,7 +55,6 @@ namespace OpenTK.Platform.MacOS
WindowState windowState = WindowState.Normal;
internal static Dictionary<IntPtr, WeakReference> WindowRefs = new Dictionary<IntPtr, WeakReference>();
KeyPressEventArgs mKeyPressArgs = new KeyPressEventArgs();
bool mMouseIn = false;
bool mIsActive = false;
Icon mIcon;
@ -367,11 +366,6 @@ namespace OpenTK.Platform.MacOS
{
mousePosInClient.Y -= mTitlebarHeight;
}
// check for enter/leave events
IntPtr thisEventWindow;
API.GetEventWindowRef(inEvent, out thisEventWindow);
CheckEnterLeaveEvents(thisEventWindow, mousePosInClient);
switch ((MouseEventKind)evt.EventKind)
{
@ -444,27 +438,6 @@ namespace OpenTK.Platform.MacOS
}
}
private void CheckEnterLeaveEvents(IntPtr eventWindowRef, Point pt)
{
if (window == null)
return;
bool thisIn = eventWindowRef == window.WindowRef;
if (pt.Y < 0)
thisIn = false;
if (thisIn != mMouseIn)
{
mMouseIn = thisIn;
if (mMouseIn)
OnMouseEnter();
else
OnMouseLeave();
}
}
private static void GetCharCodes(IntPtr inEvent, out MacOSKeyCode code, out char charCode)
{
code = API.GetEventKeyboardKeyCode(inEvent);
@ -877,18 +850,6 @@ namespace OpenTK.Platform.MacOS
}
private void OnMouseLeave()
{
if (MouseLeave != null)
MouseLeave(this, EventArgs.Empty);
}
private void OnMouseEnter()
{
if (MouseEnter != null)
MouseEnter(this, EventArgs.Empty);
}
private void OnActivate()
{
mIsActive = true;
@ -916,8 +877,6 @@ namespace OpenTK.Platform.MacOS
public event EventHandler FocusedChanged;
public event EventHandler WindowStateChanged;
public event EventHandler<KeyPressEventArgs> KeyPress;
public event EventHandler MouseEnter;
public event EventHandler MouseLeave;
#endregion

View File

@ -676,8 +676,6 @@ namespace OpenTK.Platform.Windows
public event EventHandler FocusedChanged;
public event EventHandler WindowStateChanged;
public event EventHandler<KeyPressEventArgs> KeyPress;
public event EventHandler MouseEnter;
public event EventHandler MouseLeave;
MSG msg;
public void ProcessEvents() {

View File

@ -631,8 +631,6 @@ namespace OpenTK.Platform.X11 {
public event EventHandler FocusedChanged;
public event EventHandler WindowStateChanged;
public event EventHandler<KeyPressEventArgs> KeyPress;
public event EventHandler MouseEnter;
public event EventHandler MouseLeave;
public KeyboardDevice Keyboard {
get { return keyboard; }