WIP refactor rerender render-v2

This commit is contained in:
Alejandro Alonso
2024-10-02 12:35:05 +02:00
parent 78fb938d16
commit 2184af6602
15 changed files with 31 additions and 30 deletions

View File

@@ -0,0 +1,20 @@
// Adds compile-time JS functions to augment Renderer interface.
(function (Renderer) {
console.log("preamble", Renderer);
Renderer.setCanvas = function setCanvas(canvas, attrs) {
console.log("GL", GL);
debugger
const context = GL.createContext(canvas, attrs);
if (!context) {
throw new Error('Could not create a new WebGL context')
}
GL.makeContextCurrent(context);
// Emscripten does not enable this by default and Skia needs this
// to handle certain GPU corner cases.
GL.currentContext.GLctx.getExtension('WEBGL_debug_renderer_info');
console.log("setCanvas", canvas, attrs);
const gr = this._MakeGrContext();
console.log("gr", gr);
};