aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS1
-rw-r--r--src/library_sdl.js17
2 files changed, 18 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
index 145e3812..7d587ac7 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -17,3 +17,4 @@ under the licensing terms detailed in LICENSE.
* Richard Assar <richard.assar@gmail.com>
* Nathan Hammond <emscripten@nathanhammond.com>
* Behdad Esfahbod <behdad@behdad.org>
+* David Benjamin <davidben@mit.edu>
diff --git a/src/library_sdl.js b/src/library_sdl.js
index 631de481..a6c5c559 100644
--- a/src/library_sdl.js
+++ b/src/library_sdl.js
@@ -84,6 +84,8 @@ mergeInto(LibraryManager.library, {
copyOnLock: true
},
+ version: null,
+
surfaces: {},
events: [],
audios: [null],
@@ -162,6 +164,11 @@ mergeInto(LibraryManager.library, {
['i32', 'size'],
['void*', 'callback'],
['void*', 'userdata']
+ ]),
+ version: Runtime.generateStructInfo([
+ ['i8', 'major'],
+ ['i8', 'minor'],
+ ['i8', 'patch']
])
},
@@ -369,6 +376,16 @@ mergeInto(LibraryManager.library, {
}
},
+ SDL_Linked_Version: function() {
+ if (SDL.version === null) {
+ SDL.version = _malloc(SDL.structs.version.__size__);
+ {{{ makeSetValue('SDL.version + SDL.structs.version.major', '0', '1', 'i8') }}}
+ {{{ makeSetValue('SDL.version + SDL.structs.version.minor', '0', '3', 'i8') }}}
+ {{{ makeSetValue('SDL.version + SDL.structs.version.patch', '0', '0', 'i8') }}}
+ }
+ return SDL.version;
+ },
+
SDL_Init__deps: ['$SDL'],
SDL_Init: function(what) {
SDL.startTime = Date.now();