From c3c458b6c17d86e3509cf620be9783a917b1a978 Mon Sep 17 00:00:00 2001 From: Somnath Mishra Date: Mon, 23 Oct 2023 18:02:47 +0000 Subject: [PATCH 1/2] Throwing error in webgl mode when using gridOutput() and textOutput() --- src/accessibility/gridOutput.js | 4 ++++ src/accessibility/textOutput.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/accessibility/gridOutput.js b/src/accessibility/gridOutput.js index e0a62ddbef..5e91133c6a 100644 --- a/src/accessibility/gridOutput.js +++ b/src/accessibility/gridOutput.js @@ -10,6 +10,10 @@ import p5 from '../core/main'; //updates gridOutput p5.prototype._updateGridOutput = function(idT) { + // Check if the current rendering mode is WEBGL + if (this._renderer && this._renderer.isWEBGL) { + throw new Error('gridOutput() is not supported in WEBGL mode.'); + } //if html structure is not there yet if (!this.dummyDOM.querySelector(`#${idT}_summary`)) { return; diff --git a/src/accessibility/textOutput.js b/src/accessibility/textOutput.js index 5e37fd5781..09f030fc3d 100644 --- a/src/accessibility/textOutput.js +++ b/src/accessibility/textOutput.js @@ -10,6 +10,10 @@ import p5 from '../core/main'; //updates textOutput p5.prototype._updateTextOutput = function(idT) { + // Check if the current rendering mode is WEBGL + if (this._renderer.isWEBGL) { + throw new Error('textOutput() is not supported in WEBGL mode.'); + } //if html structure is not there yet if (!this.dummyDOM.querySelector(`#${idT}_summary`)) { return; From 5f30455469467b57238c6c0923bf8bf50360742f Mon Sep 17 00:00:00 2001 From: Dave Pagurek Date: Tue, 14 Oct 2025 20:36:40 -0400 Subject: [PATCH 2/2] Update WebGL check --- src/accessibility/gridOutput.js | 8 ++++++-- src/accessibility/textOutput.js | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/accessibility/gridOutput.js b/src/accessibility/gridOutput.js index 95a0e47fd2..cbeb03ae50 100644 --- a/src/accessibility/gridOutput.js +++ b/src/accessibility/gridOutput.js @@ -11,8 +11,12 @@ import p5 from '../core/main'; //updates gridOutput p5.prototype._updateGridOutput = function(idT) { // Check if the current rendering mode is WEBGL - if (this._renderer && this._renderer.isWEBGL) { - throw new Error('gridOutput() is not supported in WEBGL mode.'); + if (this._renderer && this._renderer instanceof p5.RendererGL) { + if (!this._didOutputGridWebGLMessage) { + this._didOutputGridWebGLMessage = true; + console.error('gridOutput() does not yet work in WebGL mode.'); + } + return; } //if html structure is not there yet if (!this.dummyDOM.querySelector(`#${idT}_summary`)) { diff --git a/src/accessibility/textOutput.js b/src/accessibility/textOutput.js index 0b645e88e9..bc3a7b3134 100644 --- a/src/accessibility/textOutput.js +++ b/src/accessibility/textOutput.js @@ -11,8 +11,12 @@ import p5 from '../core/main'; //updates textOutput p5.prototype._updateTextOutput = function(idT) { // Check if the current rendering mode is WEBGL - if (this._renderer.isWEBGL) { - throw new Error('textOutput() is not supported in WEBGL mode.'); + if (this._renderer && this._renderer instanceof p5.RendererGL) { + if (!this._didOutputTextWebGLMessage) { + this._didOutputTextWebGLMessage = true; + console.error('textOutput() does not yet work in WebGL mode.'); + } + return; } //if html structure is not there yet if (!this.dummyDOM.querySelector(`#${idT}_summary`)) {