Struct ContextValues
Assembly: OpenTK.Core.dll
Syntax
public struct ContextValues : IEquatable<ContextValues>
Constructors
ContextValues(ulong, int, int, int, int, int, int, bool, bool, ContextPixelFormat, ContextSwapMethod, int)
Declaration
public ContextValues(ulong id, int redBits, int greenBits, int blueBits, int alphaBits, int depthBits, int stencilBits, bool doubleBuffered, bool sRGBFramebuffer, ContextPixelFormat pixelFormat, ContextSwapMethod swapMethod, int samples)
Parameters
Fields
AlphaBits
Declaration
Field Value
BlueBits
Declaration
Field Value
DepthBits
Declaration
Field Value
DoubleBuffered
Declaration
public bool DoubleBuffered
Field Value
GreenBits
Declaration
Field Value
ID
Declaration
Field Value
PixelFormat
Declaration
public ContextPixelFormat PixelFormat
Field Value
RedBits
Declaration
Field Value
SRGBFramebuffer
Declaration
public bool SRGBFramebuffer
Field Value
Samples
Declaration
Field Value
StencilBits
Declaration
Field Value
SwapMethod
Declaration
public ContextSwapMethod SwapMethod
Field Value
Methods
DefaultValuesSelector(IReadOnlyList<ContextValues>, ContextValues, ILogger?)
Default context values selector. Prioritizes the requested values with a series of "relaxations" to find a close match.
The relaxations are done in the following order:
- If no exact match is found try find a format with a larger number of color, depth, or stencil bits.
- If SRGBFramebuffer == false is requested, SRGBFramebuffer == true formats will be accepted.
- If SwapMethod == Undefined, any swap method will be accepted.
- If SRGBFramebuffer == true, accept SRGBFramebuffer == false formats.
- Accept any PixelFormat.
- Decrement Samples by one at a time until 0 and see if any alternative sample counts are possible.
- Accept any SwapMethod.
- Allow one of color bits (RedBits, GreenBits, BlueBits, and AlphaBits), DepthBits, or StencilBits to be lower than requested.
- Allow two of color bits (RedBits, GreenBits, BlueBits, and AlphaBits), DepthBits, or StencilBits to be lower than requested.
- Relax all bit requirements.
- If all relaxations fail, select the first option in the list.
Declaration
public static int DefaultValuesSelector(IReadOnlyList<ContextValues> options, ContextValues requested, ILogger? logger)
Parameters
Returns
Type |
Description |
int |
The index of the selected "best match" context values.
|
Equals(ContextValues)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(ContextValues other)
Parameters
Type |
Name |
Description |
ContextValues |
other |
An object to compare with this object.
|
Returns
Type |
Description |
bool |
true if the current object is equal to the other parameter; otherwise, false.
|
Equals(object?)
Indicates whether this instance and a specified object are equal.
Declaration
public override bool Equals(object? obj)
Parameters
Type |
Name |
Description |
object |
obj |
The object to compare with the current instance.
|
Returns
Type |
Description |
bool |
true if obj and this instance are the same type and represent the same value; otherwise, false.
|
Overrides
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type |
Description |
int |
A 32-bit signed integer that is the hash code for this instance.
|
Overrides
HasEqualColorBits(ContextValues, ContextValues)
Declaration
public static bool HasEqualColorBits(ContextValues option, ContextValues requested)
Parameters
Returns
HasEqualDepthBits(ContextValues, ContextValues)
Declaration
public static bool HasEqualDepthBits(ContextValues option, ContextValues requested)
Parameters
Returns
HasEqualDoubleBuffer(ContextValues, ContextValues)
Declaration
public static bool HasEqualDoubleBuffer(ContextValues option, ContextValues requested)
Parameters
Returns
HasEqualMSAA(ContextValues, ContextValues)
Declaration
public static bool HasEqualMSAA(ContextValues option, ContextValues requested)
Parameters
Returns
HasEqualPixelFormat(ContextValues, ContextValues)
Declaration
public static bool HasEqualPixelFormat(ContextValues option, ContextValues requested)
Parameters
Returns
HasEqualSRGB(ContextValues, ContextValues)
Declaration
public static bool HasEqualSRGB(ContextValues option, ContextValues requested)
Parameters
Returns
HasEqualStencilBits(ContextValues, ContextValues)
Declaration
public static bool HasEqualStencilBits(ContextValues option, ContextValues requested)
Parameters
Returns
HasEqualSwapMethod(ContextValues, ContextValues)
Declaration
public static bool HasEqualSwapMethod(ContextValues option, ContextValues requested)
Parameters
Returns
HasGreaterOrEqualColorBits(ContextValues, ContextValues)
Declaration
public static bool HasGreaterOrEqualColorBits(ContextValues option, ContextValues requested)
Parameters
Returns
HasGreaterOrEqualDepthBits(ContextValues, ContextValues)
Declaration
public static bool HasGreaterOrEqualDepthBits(ContextValues option, ContextValues requested)
Parameters
Returns
HasGreaterOrEqualStencilBits(ContextValues, ContextValues)
Declaration
public static bool HasGreaterOrEqualStencilBits(ContextValues option, ContextValues requested)
Parameters
Returns
HasLessOrEqualColorBits(ContextValues, ContextValues)
Declaration
public static bool HasLessOrEqualColorBits(ContextValues option, ContextValues requested)
Parameters
Returns
HasLessOrEqualDepthBits(ContextValues, ContextValues)
Declaration
public static bool HasLessOrEqualDepthBits(ContextValues option, ContextValues requested)
Parameters
Returns
HasLessOrEqualStencilBits(ContextValues, ContextValues)
Declaration
public static bool HasLessOrEqualStencilBits(ContextValues option, ContextValues requested)
Parameters
Returns
IsEqualExcludingID(ContextValues, ContextValues)
Declaration
public static bool IsEqualExcludingID(ContextValues option, ContextValues requested)
Parameters
Returns
ToString()
Returns the fully qualified type name of this instance.
Declaration
public override readonly string ToString()
Returns
Type |
Description |
string |
The fully qualified type name.
|
Overrides
Operators
operator ==(ContextValues, ContextValues)
Declaration
public static bool operator ==(ContextValues left, ContextValues right)
Parameters
Returns
operator !=(ContextValues, ContextValues)
Declaration
public static bool operator !=(ContextValues left, ContextValues right)
Parameters
Returns
Implements