Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/library_egl.js
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ var LibraryEGL = {
eglGetCurrentDisplay: () => EGL.currentContext ? {{{ eglDefaultDisplay }}} : 0,

// EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface);
eglSwapBuffers__deps: ['$GLctx'],
eglSwapBuffers__proxy: 'sync',
eglSwapBuffers: (dpy, surface) => {
#if PROXY_TO_WORKER
Expand All @@ -642,9 +643,9 @@ var LibraryEGL = {

if (!EGL.defaultDisplayInitialized) {
EGL.setErrorCode(0x3001 /* EGL_NOT_INITIALIZED */);
} else if (!Module.ctx) {
} else if (!GLctx) {
EGL.setErrorCode(0x3002 /* EGL_BAD_ACCESS */);
} else if (Module.ctx.isContextLost()) {
} else if (GLctx.isContextLost()) {
EGL.setErrorCode(0x300E /* EGL_CONTEXT_LOST */);
} else {
// According to documentation this does an implicit flush.
Expand Down
8 changes: 4 additions & 4 deletions src/library_glut.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,13 +399,13 @@ var LibraryGLUT = {
var now = Date.now();
return now - GLUT.initTime;
case 0x0069: /* GLUT_WINDOW_STENCIL_SIZE */
return Module.ctx.getContextAttributes().stencil ? 8 : 0;
return GLctx.getContextAttributes().stencil ? 8 : 0;
case 0x006A: /* GLUT_WINDOW_DEPTH_SIZE */
return Module.ctx.getContextAttributes().depth ? 8 : 0;
return GLctx.getContextAttributes().depth ? 8 : 0;
case 0x006E: /* GLUT_WINDOW_ALPHA_SIZE */
return Module.ctx.getContextAttributes().alpha ? 8 : 0;
return GLctx.getContextAttributes().alpha ? 8 : 0;
case 0x0078: /* GLUT_WINDOW_NUM_SAMPLES */
return Module.ctx.getContextAttributes().antialias ? 1 : 0;
return GLctx.getContextAttributes().antialias ? 1 : 0;

default:
throw "glutGet(" + type + ") not implemented yet";
Expand Down
Loading