From 4ec718623a90bed679d609b78eeddfdc6d12a4e6 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Fri, 18 Jan 2008 14:15:23 +0000 Subject: [PATCH] Moved ContextHandle to its own class. --- Source/OpenTK/GLContext.cs | 62 +------------------------------------- 1 file changed, 1 insertion(+), 61 deletions(-) diff --git a/Source/OpenTK/GLContext.cs b/Source/OpenTK/GLContext.cs index 93a359a1..51fd4c7a 100644 --- a/Source/OpenTK/GLContext.cs +++ b/Source/OpenTK/GLContext.cs @@ -324,64 +324,4 @@ namespace OpenTK #endregion } -} - -internal class ContextHandle : /*System.Runtime.InteropServices.SafeHandle,*/ IComparable -{ - IntPtr handle; - public IntPtr Handle { get { return handle; } } - - public ContextHandle() /*: base(IntPtr.Zero, true)*/ { } - public ContextHandle(IntPtr h) { handle = h; } - - #region IComparable Members - - public int CompareTo(ContextHandle other) - { - unsafe { return (int)((int*)other.handle.ToPointer() - (int*)this.handle.ToPointer()); } - } - - #endregion - - public override string ToString() - { - return Handle.ToString(); - } - - public override bool Equals(object obj) - { - if (obj is ContextHandle) - return this.Handle == ((ContextHandle)obj).Handle; - return false; - } - - public override int GetHashCode() - { - return Handle.GetHashCode(); - } - - /* - public override bool IsInvalid - { - get { return handle == IntPtr.Zero; } - } - - protected override bool ReleaseHandle() - { - throw new NotImplementedException(); - } - */ - - public static implicit operator IntPtr(ContextHandle c) - { - return c.handle; - } - - public static implicit operator ContextHandle(IntPtr p) - { - return new ContextHandle(p); - } - - - -} +} \ No newline at end of file