Struct ContextHandle
Represents a handle to an OpenGL or OpenAL context.
Inherited Members
Namespace: OpenTK
Assembly: cs.temp.dll.dll
Syntax
public struct ContextHandle : IComparable<ContextHandle>, IEquatable<ContextHandle>
Constructors
ContextHandle(IntPtr)
Constructs a new instance with the specified handle.
Declaration
public ContextHandle(IntPtr h)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | h | A System.IntPtr containing the value for this instance. |
Fields
Zero
A read-only field that represents a handle that has been initialized to zero.
Declaration
public static readonly ContextHandle Zero
Field Value
Type | Description |
---|---|
ContextHandle |
Properties
Handle
Gets a System.IntPtr that represents the handle of this ContextHandle.
Declaration
public IntPtr Handle { get; }
Property Value
Type | Description |
---|---|
System.IntPtr |
Methods
CompareTo(ContextHandle)
Compares the numerical value of this instance to the specified ContextHandle and returns a value indicating their relative order.
Declaration
public int CompareTo(ContextHandle other)
Parameters
Type | Name | Description |
---|---|---|
ContextHandle | other | The ContextHandle to compare to. |
Returns
Type | Description |
---|---|
System.Int32 | 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. |
Equals(ContextHandle)
Compares this instance to the specified ContextHandle for equality.
Declaration
public bool Equals(ContextHandle other)
Parameters
Type | Name | Description |
---|---|---|
ContextHandle | other | The ContextHandle to compare to. |
Returns
Type | Description |
---|---|
System.Boolean | True if this instance is equal to other; false otherwise. |
Equals(Object)
Compares this instance to the specified object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The System.Object to compare to. |
Returns
Type | Description |
---|---|
System.Boolean | True if obj is a ContextHandle that is equal to this instance; false otherwise. |
Overrides
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A System.Int32 with the hash code of this instance. |
Overrides
ToString()
Converts this instance to its equivalent string representation.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A System.String that contains the string representation of this instance. |
Overrides
Operators
Equality(ContextHandle, ContextHandle)
Compares two ContextHandles for equality.
Declaration
public static bool operator ==(ContextHandle left, ContextHandle right)
Parameters
Type | Name | Description |
---|---|---|
ContextHandle | left | The ContextHandle to compare. |
ContextHandle | right | The ContextHandle to compare to. |
Returns
Type | Description |
---|---|
System.Boolean | True if left is equal to right; false otherwise. |
Explicit(ContextHandle to IntPtr)
Converts the specified ContextHandle to the equivalent IntPtr.
Declaration
public static explicit operator IntPtr(ContextHandle c)
Parameters
Type | Name | Description |
---|---|---|
ContextHandle | c | The ContextHandle to convert. |
Returns
Type | Description |
---|---|
System.IntPtr | A System.IntPtr equivalent to the specified ContextHandle. |
Explicit(IntPtr to ContextHandle)
Converts the specified IntPtr to the equivalent ContextHandle.
Declaration
public static explicit operator ContextHandle(IntPtr p)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | p | The System.IntPtr to convert. |
Returns
Type | Description |
---|---|
ContextHandle | A ContextHandle equivalent to the specified IntPtr. |
Inequality(ContextHandle, ContextHandle)
Compares two ContextHandles for inequality.
Declaration
public static bool operator !=(ContextHandle left, ContextHandle right)
Parameters
Type | Name | Description |
---|---|---|
ContextHandle | left | The ContextHandle to compare. |
ContextHandle | right | The ContextHandle to compare to. |
Returns
Type | Description |
---|---|
System.Boolean | True if left is not equal to right; false otherwise. |