aboutsummaryrefslogtreecommitdiff
path: root/src/library_egl.js
diff options
context:
space:
mode:
authorJukka Jylänki <jujjyl@gmail.com>2013-01-31 21:26:47 +0200
committerJukka Jylänki <jujjyl@gmail.com>2013-01-31 21:26:47 +0200
commit40ca8f65b04a7b8128a82e90c2f3cef0c60a0656 (patch)
tree6c291a0e7c3b3e9c5b43c7dbcf6e8e55865be624 /src/library_egl.js
parent7b129450d48a3552dc8189d96ef695db8cc9c15b (diff)
Implemented eglTerminate and eglDestroyContext.
Diffstat (limited to 'src/library_egl.js')
-rw-r--r--src/library_egl.js31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/library_egl.js b/src/library_egl.js
index 1c35ddf4..a9eb37dd 100644
--- a/src/library_egl.js
+++ b/src/library_egl.js
@@ -71,6 +71,17 @@ var LibraryEGL = {
return 0;
}
},
+
+ // EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy);
+ eglTerminate: function(display) {
+ if (display != 62000 /* Magic ID for Emscripten 'default display' */) {
+ EGL.setErrorCode(0x3008 /* EGL_BAD_DISPLAY */);
+ return 0;
+ }
+ // TODO: Tear down EGL here. Currently a no-op since we don't need to actually do anything here for the browser.
+ EGL.setErrorCode(0x3000 /* EGL_SUCCESS */);
+ return 1;
+ },
// EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
eglGetConfigs: function(display, configs, config_size, numConfigs) {
@@ -228,6 +239,22 @@ var LibraryEGL = {
return 62004; // Magic ID for Emscripten EGLContext
},
+ // EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx);
+ eglDestroyContext: function(display, context) {
+ if (display != 62000 /* Magic ID for Emscripten 'default display' */) {
+ EGL.setErrorCode(0x3008 /* EGL_BAD_DISPLAY */);
+ return 0;
+ }
+
+ if (context != 62004 /* Magic ID for Emscripten EGLContext */) {
+ EGL.setErrorCode(0x3006 /* EGL_BAD_CONTEXT */);
+ return 0;
+ }
+
+ EGL.setErrorCode(0x3000 /* EGL_SUCCESS */);
+ return 1;
+ },
+
// EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
eglQuerySurface: function(display, surface, attribute, value) {
if (display != 62000 /* Magic ID for Emscripten 'default display' */) {
@@ -336,6 +363,7 @@ var LibraryEGL = {
return EGL.eglErrorCode;
},
+ // EGLAPI const char * EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name);
eglQueryString: function(display, name) {
if (display != 62000 /* Magic ID for Emscripten 'default display' */) {
EGL.setErrorCode(0x3008 /* EGL_BAD_DISPLAY */);
@@ -412,7 +440,8 @@ var LibraryEGL = {
EGL.setErrorCode(0x3000 /* EGL_SUCCESS */);
return 1;
},
-
+
+ // EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface);
eglSwapBuffers: function() {
EGL.setErrorCode(0x3000 /* EGL_SUCCESS */);
},