-
Notifications
You must be signed in to change notification settings - Fork 0
/
version.js
37 lines (33 loc) · 903 Bytes
/
version.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const {
e,
Struct,
push_export
} = require('./api');
e.SDL_version = Struct({
major: 'Uint8',
minor: 'Uint8',
patch: 'Uint8'
});
e.SDL_MAJOR_VERSION = 2;
e.SDL_MINOR_VERSION = 26;
e.SDL_PATCHLEVEL = 4;
e.SDL_VERSION = function(x) {
x.major = e.SDL_MAJOR_VERSION;
x.minor = e.SDL_MINOR_VERSION;
x.patch = e.SDL_PATCHLEVEL;
return x;
}
e.SDL_VERSIONNUM = function(X, Y, Z) {
return X * 1000 + Y * 100 + Z;
}
e.SDL_COMPILEDVERSION = e.SDL_VERSIONNUM(e.SDL_MAJOR_VERSION, e.SDL_MINOR_VERSION, e.SDL_PATCHLEVEL);
e.SDL_VERSION_ATLEAST = function(X, Y, Z) {
return ((e.SDL_MAJOR_VERSION >= X) &&
(e.SDL_MAJOR_VERSION > X || e.SDL_MINOR_VERSION >= Y) &&
(e.SDL_MAJOR_VERSION > X || e.SDL_MINOR_VERSION > Y || e.SDL_PATCHLEVEL >= Z));
}
push_export({
'SDL_GetVersion': ['void', ['void*']],
'SDL_GetRevision': ['string', []],
// 'SDL_GetRevisionNumber': ['int', []]
});