OpenTK.ContextHandle Struct Reference

Represents a handle to an OpenGL or OpenAL context. More...

List of all members.

Public Member Functions

 ContextHandle (IntPtr h)
 Constructs a new instance with the specified handle.
override string ToString ()
 Converts this instance to its equivalent string representation.
override bool Equals (object obj)
 Compares this instance to the specified object.
override int GetHashCode ()
 Returns the hash code for this instance.
int CompareTo (ContextHandle other)
 Compares the numerical value of this instance to the specified ContextHandle and returns a value indicating their relative order.
bool Equals (ContextHandle other)
 Compares this instance to the specified ContextHandle for equality.

Static Public Member Functions

static operator IntPtr (ContextHandle c)
 Converts the specified ContextHandle to the equivalent IntPtr.
static operator ContextHandle (IntPtr p)
 Converts the specified IntPtr to the equivalent ContextHandle.
static bool operator== (ContextHandle left, ContextHandle right)
 Compares two ContextHandles for equality.
static bool operator!= (ContextHandle left, ContextHandle right)
 Compares two ContextHandles for inequality.

Public Attributes

IntPtr handle

Static Public Attributes

static readonly ContextHandle Zero = new ContextHandle(IntPtr.Zero)
 A read-only field that represents a handle that has been initialized to zero.

Properties

IntPtr Handle [get]
 Gets a System.IntPtr that represents the handle of this ContextHandle.

Detailed Description

Represents a handle to an OpenGL or OpenAL context.

Definition at line 18 of file ContextHandle.cs.


Constructor & Destructor Documentation

OpenTK.ContextHandle.ContextHandle ( IntPtr  h  ) 

Constructs a new instance with the specified handle.

Parameters:
h A System.IntPtr containing the value for this instance.

Definition at line 40 of file ContextHandle.cs.

00040 { handle = h; }


Member Function Documentation

int OpenTK.ContextHandle.CompareTo ( ContextHandle  other  ) 

Compares the numerical value of this instance to the specified ContextHandle and returns a value indicating their relative order.

Parameters:
other The ContextHandle to compare to.
Returns:
Less than 0, if this instance is less than other; 0 if both are equal; Greater than 0 if other is greater than this instance.

Definition at line 156 of file ContextHandle.cs.

00157         {
00158             unsafe { return (int)((int*)other.handle.ToPointer() - (int*)this.handle.ToPointer()); }
00159         }

bool OpenTK.ContextHandle.Equals ( ContextHandle  other  ) 

Compares this instance to the specified ContextHandle for equality.

Parameters:
other The ContextHandle to compare to.
Returns:
True if this instance is equal to other; false otherwise.

Definition at line 170 of file ContextHandle.cs.

00171         {
00172             return Handle == other.Handle;
00173         }

override bool OpenTK.ContextHandle.Equals ( object  obj  ) 

Compares this instance to the specified object.

Parameters:
obj The System.Object to compare to.
Returns:
True if obj is a ContextHandle that is equal to this instance; false otherwise.

Definition at line 66 of file ContextHandle.cs.

00067         {
00068             if (obj is ContextHandle)
00069                 return this.Equals((ContextHandle)obj);
00070             return false;
00071         }

override int OpenTK.ContextHandle.GetHashCode (  ) 

Returns the hash code for this instance.

Returns:
A System.Int32 with the hash code of this instance.

Definition at line 81 of file ContextHandle.cs.

00082         {
00083             return Handle.GetHashCode();
00084         }

static OpenTK.ContextHandle.operator ContextHandle ( IntPtr  p  )  [explicit, static]

Converts the specified IntPtr to the equivalent ContextHandle.

Parameters:
p The System.IntPtr to convert.
Returns:
A ContextHandle equivalent to the specified IntPtr.

Definition at line 109 of file ContextHandle.cs.

00110         {
00111             return new ContextHandle(p);
00112         }

static OpenTK.ContextHandle.operator IntPtr ( ContextHandle  c  )  [explicit, static]

Converts the specified ContextHandle to the equivalent IntPtr.

Parameters:
c The ContextHandle to convert.
Returns:
A System.IntPtr equivalent to the specified ContextHandle.

Definition at line 95 of file ContextHandle.cs.

00096         {
00097             return c != ContextHandle.Zero ? c.handle : IntPtr.Zero;
00098         }

static bool OpenTK.ContextHandle.operator!= ( ContextHandle  left,
ContextHandle  right 
) [static]

Compares two ContextHandles for inequality.

Parameters:
left The ContextHandle to compare.
right The ContextHandle to compare to.
Returns:
True if left is not equal to right; false otherwise.

Definition at line 139 of file ContextHandle.cs.

00140         {
00141             return !left.Equals(right);
00142         }

static bool OpenTK.ContextHandle.operator== ( ContextHandle  left,
ContextHandle  right 
) [static]

Compares two ContextHandles for equality.

Parameters:
left The ContextHandle to compare.
right The ContextHandle to compare to.
Returns:
True if left is equal to right; false otherwise.

Definition at line 124 of file ContextHandle.cs.

00125         {
00126             return left.Equals(right);
00127         }

override string OpenTK.ContextHandle.ToString (  ) 

Converts this instance to its equivalent string representation.

Returns:
A System.String that contains the string representation of this instance.

Definition at line 52 of file ContextHandle.cs.

00053         {
00054             return Handle.ToString();
00055         }


Member Data Documentation

readonly ContextHandle OpenTK.ContextHandle.Zero = new ContextHandle(IntPtr.Zero) [static]

A read-only field that represents a handle that has been initialized to zero.

Definition at line 30 of file ContextHandle.cs.


Property Documentation

IntPtr OpenTK.ContextHandle.Handle [get]

Gets a System.IntPtr that represents the handle of this ContextHandle.

Definition at line 27 of file ContextHandle.cs.

 All Classes Functions Variables Enumerations Properties Events

Generated on Tue Mar 9 14:59:12 2010 for The Open Toolkit library by  doxygen 1.6.1