Table of Contents

Struct GraphicsApiVersion

Namespace
NeoVeldrid
Assembly
NeoVeldrid.dll

Describes the version number of the underlying graphics API of a GraphicsBackend.

public readonly struct GraphicsApiVersion : IEquatable<GraphicsApiVersion>
Implements
Inherited Members

Constructors

GraphicsApiVersion(int, int, int, int)

public GraphicsApiVersion(int major, int minor, int subminor, int patch)

Parameters

major int
minor int
subminor int
patch int

Properties

IsKnown

Is the version number valid? Defined as: Major > 0, Minor ≥ 0, Subminor ≥ 0, Patch ≥ 0.

public bool IsKnown { get; }

Property Value

bool

Major

The major version component (e.g. the 4 in OpenGL 4.6).

public int Major { get; }

Property Value

int

Minor

The minor version component (e.g. the 6 in OpenGL 4.6).

public int Minor { get; }

Property Value

int

Patch

The patch or release version component (e.g. the release number in an OpenGL version string, or a Vulkan patch level).

public int Patch { get; }

Property Value

int

Subminor

The sub-minor version component, between Minor and Patch. Only a four-part version (such as a Vulkan conformance version) populates it, so it is typically 0.

public int Subminor { get; }

Property Value

int

Unknown

An unknown or invalid version number. Defined as: 0.0.0.0.

public static GraphicsApiVersion Unknown { get; }

Property Value

GraphicsApiVersion

Methods

Equals(GraphicsApiVersion)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(GraphicsApiVersion other)

Parameters

other GraphicsApiVersion

An object to compare with this object.

Returns

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.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

TryParseGLVersion(string, out GraphicsApiVersion)

Attempts to parse an OpenGL or OpenGL ES version string, extracting the version number and ignoring any surrounding vendor or API text.

public static bool TryParseGLVersion(string versionString, out GraphicsApiVersion version)

Parameters

versionString string

The version string to parse (e.g. "4.6.0 NVIDIA 551.23").

version GraphicsApiVersion

The parsed version, or Unknown if parsing fails.

Returns

bool

true if the string was parsed successfully; otherwise false.

Operators

operator ==(GraphicsApiVersion, GraphicsApiVersion)

public static bool operator ==(GraphicsApiVersion version1, GraphicsApiVersion version2)

Parameters

version1 GraphicsApiVersion
version2 GraphicsApiVersion

Returns

bool

operator !=(GraphicsApiVersion, GraphicsApiVersion)

public static bool operator !=(GraphicsApiVersion version1, GraphicsApiVersion version2)

Parameters

version1 GraphicsApiVersion
version2 GraphicsApiVersion

Returns

bool