Struct Version
D struct that wraps SDL_version
containing version information
Constructors
Name | Description |
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
Name | Type | Description |
sdlVersion
|
bindbc.sdl.config.SDL_version | Internal SDL_version struct
|
Properties
Name | Type | Description |
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
Name | Description |
format
()
|
Formats the dsdl2.Version into string : "<major>.<minor>.<patch>"
|
opCmp
(other)
|
Compares two dsdl2.Version s 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));