Skip to content

Commit 41de190

Browse files
authored
Remove redundant setting of Module.ctx. NFC (#22858)
The `Browser.createContext` function already sets `Module.ctx` when `setInModule` is used.
1 parent 94f4173 commit 41de190

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/library_glfw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,7 @@ var LibraryGLFW = {
11011101
// TODO: Make GLFW explicitly aware of whether it is being proxied or not, and set these to true only when proxying is being performed.
11021102
GL.enableOffscreenFramebufferAttributes(contextAttributes);
11031103
#endif
1104-
Module.ctx = Browser.createContext(Module['canvas'], true, true, contextAttributes);
1104+
Browser.createContext(Module['canvas'], /*useWebGL=*/true, /*setInModule=*/true, contextAttributes);
11051105
} else {
11061106
Browser.init();
11071107
}

src/library_glut.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,8 +566,9 @@ var LibraryGLUT = {
566566
// TODO: Make glutCreateWindow explicitly aware of whether it is being proxied or not, and set these to true only when proxying is being performed.
567567
GL.enableOffscreenFramebufferAttributes(contextAttributes);
568568
#endif
569-
Module.ctx = Browser.createContext(Module['canvas'], true, true, contextAttributes);
570-
return Module.ctx ? 1 /* a new GLUT window ID for the created context */ : 0 /* failure */;
569+
if (!Browser.createContext(Module['canvas'], /*useWebGL=*/true, /*setInModule=*/true, contextAttributes))
570+
return 0; // failure
571+
return 1; // a new GLUT window ID for the created context
571572
},
572573

573574
glutDestroyWindow__proxy: 'sync',

0 commit comments

Comments
 (0)