diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-03-31 18:07:38 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-03-31 18:07:38 -0700 |
commit | 3bb7818644872f82a59140a39e92303fdcf6bf23 (patch) | |
tree | b5a3a55311f9a864ef6475cec713ef4bb5b65d64 | |
parent | 0c82f426762ca376842c33965b983ace04bcbd0f (diff) |
library additions in preparation for glbook tests
-rw-r--r-- | src/library_gl.js | 40 | ||||
-rwxr-xr-x | tests/runner.py | 13 |
2 files changed, 45 insertions, 8 deletions
diff --git a/src/library_gl.js b/src/library_gl.js index 1ea7ec16..654e6eae 100644 --- a/src/library_gl.js +++ b/src/library_gl.js @@ -969,6 +969,46 @@ var LibraryGLUT = { glutPostRedisplay: function() {}, }; +var LibraryXlib = { + XOpenDisplay: function() { + return 1; // We support 1 display, the canvas + }, + + XCreateWindow: function(display, parent, x, y, width, height, border_width, depth, class_, visual, valuemask, attributes) { + // All we can do is set the width and height + Module['canvas'].width = width; + Module['canvas'].height = height; + return 2; + }, + + XChangeWindowAttributes: function(){}, + XSetWMHints: function(){}, + XMapWindow: function(){}, + XStoreName: function(){}, + XInternAtom: function(display, name_, hmm) { return 0 }, + XSendEvent: function(){}, + XPending: function(display) { return 0 }, +}; + +var LibraryEGL = { + eglGetDisplay: function(x_display) { return 3 }, + eglInitialize: function(display, majorVersion, minorVersion) { return 1 }, + eglGetConfigs: function(display, hmm1, hmm2, numConfigs) { return 1 }, + eglChooseConfig: function(display, attribList, config, hmm, numConfigs) { return 1 }, + eglCreateWindowSurface: function(display, config, hWnd, hmm) { return 4 }, + + eglCreateContext__deps: ['glutCreateWindow', '$GL'], + eglCreateContext: function(display, config, hmm, contextAttribs) { + _glutCreateWindow(); + return 1; + }, + + eglMakeCurrent: function(display, surface, surface, context) { return 1 }, + eglSwapBuffers: function() {}, +}; + mergeInto(LibraryManager.library, LibraryGL); mergeInto(LibraryManager.library, LibraryGLUT); +mergeInto(LibraryManager.library, LibraryXlib); +mergeInto(LibraryManager.library, LibraryEGL); diff --git a/tests/runner.py b/tests/runner.py index 09005a5f..8e61ef4c 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -6759,14 +6759,11 @@ elif 'browser' in str(sys.argv): self.run_browser('something.html', 'You should not see animating gears.', '/report_gl_result?false') def zzztest_glbook(self): - print self.get_library('glbook', os.path.join('objs', '.libs', 'libfreetype.a'), configure=None) - return - - open(os.path.join(self.get_dir(), 'sdl_audio.c'), 'w').write(self.with_report_result(open(path_from_root('tests', 'sdl_audio.c')).read())) - - # use closure to check for a possible bug with closure minifying away newer Audio() attributes - Popen(['python', EMCC, '-O2', '--minify', '0', os.path.join(self.get_dir(), 'sdl_audio.c'), '--preload-file', 'sound.ogg', '--preload-file', 'sound2.wav', '-o', 'page.html', '-s', 'EXPORTED_FUNCTIONS=["_main", "_play", "_play2"]']).communicate() - self.run_browser('page.html', '', '/report_result?1') + programs = self.get_library('glbook', [os.path.join('Chapter_2/Hello_Triangle/CH02_HelloTriangle.bc')], configure=None) + print programs + for program in programs: + Popen(['python', EMCC, program, '-o', 'program.html']).communicate() + self.run_browser('program.html', '', '/report_result?1') elif 'benchmark' in str(sys.argv): # Benchmarks. Run them with argument |benchmark|. To run a specific test, do |