diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-06-05 13:51:52 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-06-05 13:51:52 -0700 |
commit | 3b39fa49c53aa07f88d3c3be95464d8208619854 (patch) | |
tree | 355992312a59cb2de8ff22607ca57f66263e922d | |
parent | 947a504fe12417c7888a80d7313ca7ba4a0581c3 (diff) | |
parent | c19e66ece36a240d0c49d43f0d2de875a07fe3d8 (diff) |
Merge pull request #465 from juj/EGL
Egl
-rw-r--r-- | src/library_browser.js | 5 | ||||
-rw-r--r-- | src/library_egl.js | 6 | ||||
-rw-r--r-- | system/include/emscripten.h | 6 |
3 files changed, 17 insertions, 0 deletions
diff --git a/src/library_browser.js b/src/library_browser.js index 6a53dfd8..59d37336 100644 --- a/src/library_browser.js +++ b/src/library_browser.js @@ -244,6 +244,11 @@ mergeInto(LibraryManager.library, { styleSheet.insertRule('canvas.emscripten { border: 1px solid black; cursor: none; }', 0); }, + emscripten_set_canvas_size: function(width, height) { + Module['canvas'].width = width; + Module['canvas'].height = height; + }, + emscripten_get_now: function() { if (window['performance'] && window['performance']['now']) { return window['performance']['now'](); diff --git a/src/library_egl.js b/src/library_egl.js index f1558f80..635e00a7 100644 --- a/src/library_egl.js +++ b/src/library_egl.js @@ -12,6 +12,12 @@ var LibraryEGL = { return 1; }, + // EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value); + eglQuerySurface: function(display, surface, attribute, value) { return 0 }, + + // EGLAPI EGLint EGLAPIENTRY eglGetError(void); + eglGetError: function() { return 0x3000 /* EGL_SUCCESS */ }, + eglMakeCurrent: function(display, surface, surface_, context) { return 1 }, eglSwapBuffers: function() {}, }; diff --git a/system/include/emscripten.h b/system/include/emscripten.h index d0e6cc46..4da31ec3 100644 --- a/system/include/emscripten.h +++ b/system/include/emscripten.h @@ -65,6 +65,12 @@ void emscripten_async_call(void (*func)(), int millis) { void emscripten_hide_mouse(); /* + * Resizes the pixel width and height of the <canvas> element + * on the Emscripten web page. + */ +void emscripten_set_canvas_size(int width, int height); + +/* * Returns the highest-precision representation of the * current time that the browser provides. This uses either * Date.now or performance.now. The result is *not* an |