You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dbg('Resizing canvas from '+canvas.width+'x'+canvas.height+' to '+width+'x'+height+'. Previous GL viewport size was '
2339
-
+prevViewport+', so autoResizeViewport='+autoResizeViewport);
2338
+
dbg(`Resizing canvas from ${canvas.width}x${canvas.height} to ${width}x${height}. Previous GL viewport size was ${prevViewport}, so autoResizeViewport=${autoResizeViewport}`);
2340
2339
#endif
2341
2340
}
2342
2341
canvas.width=width;
2343
2342
canvas.height=height;
2344
2343
if(autoResizeViewport){
2345
2344
#if GL_DEBUG
2346
-
dbg('Automatically resizing GL viewport to cover whole render target '+width+'x'+height);
2345
+
dbg(`Automatically resizing GL viewport to cover whole render target ${width}x${height}`);
2347
2346
#endif
2348
2347
// TODO: Add -sCANVAS_RESIZE_SETS_GL_VIEWPORT=0/1 option (default=1). This is commonly done and several graphics engines depend on this,
Copy file name to clipboardExpand all lines: src/library_html5_webgl.js
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -117,7 +117,7 @@ var LibraryHtml5WebGL = {
117
117
// then this can be avoided, since OffscreenCanvas enables explicit swap control.
118
118
#if GL_DEBUG
119
119
if(contextAttributes.proxyContextToMainThread==={{{cDefs.EMSCRIPTEN_WEBGL_CONTEXT_PROXY_ALWAYS}}})dbg('EMSCRIPTEN_WEBGL_CONTEXT_PROXY_ALWAYS enabled, proxying WebGL rendering from pthread to main thread.');
120
-
if(!canvas&&contextAttributes.proxyContextToMainThread==={{{cDefs.EMSCRIPTEN_WEBGL_CONTEXT_PROXY_FALLBACK}}})dbg('Specified canvas target "'+targetStr+'" is not an OffscreenCanvas in the current pthread, but EMSCRIPTEN_WEBGL_CONTEXT_PROXY_FALLBACK is set. Proxying WebGL rendering from pthread to main thread.');
120
+
if(!canvas&&contextAttributes.proxyContextToMainThread==={{{cDefs.EMSCRIPTEN_WEBGL_CONTEXT_PROXY_FALLBACK}}})dbg(`Specified canvas target "${targetStr}" is not an OffscreenCanvas in the current pthread, but EMSCRIPTEN_WEBGL_CONTEXT_PROXY_FALLBACK is set. Proxying WebGL rendering from pthread to main thread.`);
121
121
dbg('Performance warning: forcing renderViaOffscreenBackBuffer=true and preserveDrawingBuffer=true since proxying WebGL rendering.');
122
122
#endif
123
123
// We will be proxying - if OffscreenCanvas is supported, we can proxy a bit more efficiently by avoiding having to create an Offscreen FBO.
if(typeofOffscreenCanvas!='undefined'&&canvasinstanceofOffscreenCanvas)dbg('emscripten_webgl_create_context: Creating an OffscreenCanvas-based WebGL context on target "'+targetStr+'"');
145
-
elseif(typeofHTMLCanvasElement!='undefined'&&canvasinstanceofHTMLCanvasElement)dbg('emscripten_webgl_create_context: Creating an HTMLCanvasElement-based WebGL context on target "'+targetStr+'"');
144
+
if(typeofOffscreenCanvas!='undefined'&&canvasinstanceofOffscreenCanvas)dbg(`emscripten_webgl_create_context: Creating an OffscreenCanvas-based WebGL context on target "${targetStr}"`);
145
+
elseif(typeofHTMLCanvasElement!='undefined'&&canvasinstanceofHTMLCanvasElement)dbg(`emscripten_webgl_create_context: Creating an HTMLCanvasElement-based WebGL context on target "${targetStr}"`);
146
146
#endif
147
147
148
148
if(contextAttributes.explicitSwapControl){
@@ -166,7 +166,7 @@ var LibraryHtml5WebGL = {
166
166
167
167
if(canvas.transferControlToOffscreen){
168
168
#if GL_DEBUG
169
-
dbg('explicitSwapControl requested: canvas.transferControlToOffscreen() on canvas "'+targetStr+'" to get .commit() function and not rely on implicit WebGL swap');
169
+
dbg(`explicitSwapControl requested: canvas.transferControlToOffscreen() on canvas "${targetStr}" to get .commit() function and not rely on implicit WebGL swap`);
170
170
#endif
171
171
if(!canvas.controlTransferredOffscreen){
172
172
GL.offscreenCanvases[canvas.id]={
@@ -177,7 +177,7 @@ var LibraryHtml5WebGL = {
177
177
canvas.controlTransferredOffscreen=true;
178
178
}elseif(!GL.offscreenCanvases[canvas.id]){
179
179
#if GL_DEBUG
180
-
dbg('OffscreenCanvas is supported, and canvas "'+canvas.id+'" has already before been transferred offscreen, but there is no known OffscreenCanvas with that name!');
180
+
dbg(`OffscreenCanvas is supported, and canvas "${canvas.id}" has already before been transferred offscreen, but there is no known OffscreenCanvas with that name!`);
0 commit comments