Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Implement SDL_Linked_Version #335

Merged
merged 1 commit into from

2 participants

@davidben

New version of #333

@kripken kripken merged commit 34ddf41 into kripken:incoming
@kripken
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 31, 2012
  1. @davidben

    Implement SDL_Linked_Version

    davidben authored
This page is out of date. Refresh to see the latest.
Showing with 18 additions and 0 deletions.
  1. +1 −0  AUTHORS
  2. +17 −0 src/library_sdl.js
View
1  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>
View
17 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();
Something went wrong with that request. Please try again.