Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@
this.currentRequest = window.requestAnimationFrame(() => {

if (this.requestRender) {
// make current for this canvas instance
GL.makeContextCurrent(this.glCtx);

this.requestRender();
}

Expand Down Expand Up @@ -178,12 +181,12 @@
throw `No <canvas> with id ${canvasOrCanvasId} was found`;
}

var ctx = SKSwapChainPanel.createWebGLContext(canvas);
if (!ctx || ctx < 0)
this.glCtx = SKSwapChainPanel.createWebGLContext(canvas);
if (!this.glCtx || this.glCtx < 0)
throw `Failed to create WebGL context: err ${ctx}`;

// make current
GL.makeContextCurrent(ctx);
GL.makeContextCurrent(this.glCtx);

// Starting from .NET 7 the GLctx is defined in an inaccessible scope
// when the current GL context changes. We need to pick it up from the
Expand All @@ -196,7 +199,7 @@
// read values
this.canvas = canvas;
return {
ctx: ctx,
ctx: this.glCtx,
fbo: currentGLctx.getParameter(currentGLctx.FRAMEBUFFER_BINDING),
stencil: currentGLctx.getParameter(currentGLctx.STENCIL_BITS),
sample: 0, // TODO: currentGLctx.getParameter(GLctx.SAMPLES)
Expand Down