diff options
author | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2012-02-13 21:27:33 -0500 |
---|---|---|
committer | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2012-03-28 11:01:22 -0700 |
commit | afe92a7af9836d53fd9729e392201cb33ac4cb94 (patch) | |
tree | 8b0d9e8e347dc8868fca05d374823fb5f89b3fe2 | |
parent | c25bca910025fb8c6d8b01a06314fea6cb37055a (diff) |
Implement SDL_WasInit
-rw-r--r-- | src/library_sdl.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js index 199af7c4..06e10339 100644 --- a/src/library_sdl.js +++ b/src/library_sdl.js @@ -90,6 +90,7 @@ mergeInto(LibraryManager.library, { fonts: [null], keyboardState: null, + startTime: null, mouseX: 0, mouseY: 0, @@ -98,6 +99,7 @@ mergeInto(LibraryManager.library, { 40: 1105, // down arrow 37: 1104, // left arrow 39: 1103, // right arrow + 17: 305, // control (right, or left) 18: 308, // alt 109: 45, // minus @@ -369,7 +371,13 @@ mergeInto(LibraryManager.library, { return 0; // success }, - SDL_WasInit: function() { return 0 }, // TODO + SDL_WasInit__deps: ['SDL_Init'], + SDL_WasInit: function() { + if (SDL.startTime === null) { + _SDL_Init(); + } + return 1; + }, SDL_GetVideoInfo: function() { // %struct.SDL_VideoInfo = type { i32, i32, %struct.SDL_PixelFormat*, i32, i32 } - 5 fields of quantum size |