Struct Version
D struct that wraps SDL_version containing version information
Constructors
| Name | Description |
this
(sdlVersion)
|
Constructs a dsdl.Version from a vanilla SDL_version from bindbc-sdl
|
this
(major, minor, patch)
|
Constructs a dsdl.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 dsdl.Version
|
major[get]
|
inout(ubyte) | Proxy to the major version value of the dsdl.Version
|
minor[get]
|
inout(ubyte) | Proxy to the minor version value of the dsdl.Version
|
patch[get]
|
inout(ubyte) | Proxy to the patch version value of the dsdl.Version
|
Methods
| Name | Description |
format
()
|
Formats the dsdl.Version into string: "<major>.<minor>.<patch>"
|
opCmp
(other)
|
Compares two dsdl.Versions from chronology
|
toString
()
|
Formats the dsdl.Version into its construction representation: "dsdl.Version(<major>, <minor>, <patch>)"
|
Example
import std.stdio;
writeln("We're currently using SDL version ", dsdl.getVersion().format());
Example
auto minimumVersion = dsdl.Version(2, 0, 0);
auto ourVersion = dsdl.getVersion();
assert(ourVersion >= minimumVersion);
Example
assert(dsdl.Version(2, 0, 2) > dsdl.Version(2, 0, 0));
assert(dsdl.Version(2, 2, 0) >= dsdl.Version(2, 0, 2));
assert(dsdl.Version(3, 0, 0) >= dsdl.Version(2, 2, 0));