Show / Hide Table of Contents

Struct ContextHandle

Represents a handle to an OpenGL or OpenAL context.

Implements
IComparable<ContextHandle>
IEquatable<ContextHandle>
Inherited Members
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetType()
Namespace: OpenTK
Assembly: OpenTK.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
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 readonly IntPtr Handle { get; }
Property Value
Type Description
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
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
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
Object obj

The System.Object to compare to.

Returns
Type Description
Boolean

True if obj is a ContextHandle that is equal to this instance; false otherwise.

Overrides
ValueType.Equals(Object)

GetHashCode()

Returns the hash code for this instance.

Declaration
public override int GetHashCode()
Returns
Type Description
Int32

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

Overrides
ValueType.GetHashCode()

ToString()

Converts this instance to its equivalent string representation.

Declaration
public override string ToString()
Returns
Type Description
String

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

Overrides
ValueType.ToString()

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
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
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
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
Boolean

True if left is not equal to right; false otherwise.

Implements

System.IComparable<T>
System.IEquatable<T>
In This Article
Back to top Generated by DocFX