Version

D struct that wraps SDL_version containing version information

Constructors

this
this()
Undocumented in source.
this
this(SDL_version sdlVersion)

Constructs a dsdl2.Version from a vanilla SDL_version from bindbc-sdl

this
this(ubyte major, ubyte minor, ubyte patch)

Constructs a dsdl2.Version by feeding in major, minor, and patch version numbers

Members

Functions

array
ubyte[3] array()

Gets the static array representation of the dsdl2.Version

format
string format()

Formats the dsdl2.Version into string: "<major>.<minor>.<patch>"

major
inout(ubyte) major()

Proxy to the major version value of the dsdl2.Version

minor
inout(ubyte) minor()

Proxy to the minor version value of the dsdl2.Version

opCmp
int opCmp(Version other)

Compares two dsdl2.Versions from chronology

patch
inout(ubyte) patch()

Proxy to the patch version value of the dsdl2.Version

toString
string toString()

Formats the dsdl2.Version into its construction representation: "dsdl2.Version(<major>, <minor>, <patch>)"

Variables

sdlVersion
SDL_version sdlVersion;

Internal SDL_version struct

Examples

import std.stdio;
writeln("We're currently using SDL version ", dsdl2.getVersion().format());
auto minimumVersion = dsdl2.Version(2, 0, 0);
auto ourVersion = dsdl2.getVersion();
assert(ourVersion >= minimumVersion);
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));

Meta