Struct Version

D struct that wraps SDL_version containing version information

struct Version ;

Constructors

NameDescription
this (sdlVersion) Constructs a dsdl2.Version from a vanilla SDL_version from bindbc-sdl
this (major, minor, patch) Constructs a dsdl2.Version by feeding in major, minor, and patch version numbers

Fields

NameTypeDescription
sdlVersion bindbc.sdl.config.SDL_versionInternal SDL_version struct

Properties

NameTypeDescription
array[get] ubyte[3]Gets the static array representation of the dsdl2.Version
major[get] inout(ubyte)Proxy to the major version value of the dsdl2.Version
minor[get] inout(ubyte)Proxy to the minor version value of the dsdl2.Version
patch[get] inout(ubyte)Proxy to the patch version value of the dsdl2.Version

Methods

NameDescription
format () Formats the dsdl2.Version into string: "<major>.<minor>.<patch>"
opCmp (other) Compares two dsdl2.Versions from chronology
toString () Formats the dsdl2.Version into its construction representation: "dsdl2.Version(<major>, <minor>, <patch>)"

Example

import std.stdio;
writeln("We're currently using SDL version ", dsdl2.getVersion().format());

Example

auto minimumVersion = dsdl2.Version(2, 0, 0);
auto ourVersion = dsdl2.getVersion();
assert(ourVersion >= minimumVersion);

Example

assert(dsdl2.Version(2, 0, 2) > dsdl2.Version(2, 0, 0));
assert(dsdl2.Version(2, 2, 0) >= dsdl2.Version(2, 0, 2));
assert(dsdl2.Version(3, 0, 0) >= dsdl2.Version(2, 2, 0));