diff options
author | Alon Zakai <azakai@mozilla.com> | 2010-12-21 22:41:24 -0800 |
---|---|---|
committer | Alon Zakai <azakai@mozilla.com> | 2010-12-21 22:41:24 -0800 |
commit | 60cdfa59ed4eeefdfbe150933df67c21406e1247 (patch) | |
tree | a640b7e062545f5505c1894eaa8652d307023b29 /src | |
parent | c244ee875744ad62774c75548461325492799990 (diff) |
initial skeleton for gl tests
Diffstat (limited to 'src')
-rw-r--r-- | src/library.js | 1 | ||||
-rw-r--r-- | src/library_gl.js | 5 | ||||
-rw-r--r-- | src/library_sdl.js | 8 | ||||
-rw-r--r-- | src/postamble.js | 2 |
4 files changed, 14 insertions, 2 deletions
diff --git a/src/library.js b/src/library.js index 0fb73611..ddb90675 100644 --- a/src/library.js +++ b/src/library.js @@ -736,4 +736,5 @@ var Library = { }; load('library_sdl.js'); +load('library_gl.js'); diff --git a/src/library_gl.js b/src/library_gl.js new file mode 100644 index 00000000..ad0134eb --- /dev/null +++ b/src/library_gl.js @@ -0,0 +1,5 @@ +mergeInto(Library, { + glGetString: function() { + }, +}); + diff --git a/src/library_sdl.js b/src/library_sdl.js index 533e69aa..5f1a415f 100644 --- a/src/library_sdl.js +++ b/src/library_sdl.js @@ -5,7 +5,7 @@ mergeInto(Library, { height: 240 }; SDL_SURFACES = {}; - return 1; + return 0; // success }, SDL_GetVideoInfo: function() { @@ -30,7 +30,7 @@ mergeInto(Library, { SDL_SetVideoMode: function(width, height, depth, flags, canvas) { // ^^^^^^ a 'canvas' parameter is added here; supply a canvas from JS there // or, define __CANVAS__. - canvas = canvas || __CANVAS__; + canvas = canvas || Module.__CANVAS__; var surf = _malloc(14*QUANTUM_SIZE); // SDL_Surface has 14 fields of quantum size SDL_SURFACES[surf] = { width: width, @@ -96,6 +96,10 @@ mergeInto(Library, { SDL_ShowCursor: function(toggle) { // TODO + }, + + SDL_GetError: function() { + return Pointer_make(intArrayFromString("SDL is cool"), null); } }); diff --git a/src/postamble.js b/src/postamble.js index 8f1f6cb8..ba295ea7 100644 --- a/src/postamble.js +++ b/src/postamble.js @@ -32,6 +32,8 @@ function run(args) { } Module['run'] = run; +// {{PRE_RUN_ADDITIONS}} + #if INVOKE_RUN run(args); #endif |