Skip to content

Commit 5f30455

Browse files
committed
Update WebGL check
1 parent 8e9554e commit 5f30455

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/accessibility/gridOutput.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ import p5 from '../core/main';
1111
//updates gridOutput
1212
p5.prototype._updateGridOutput = function(idT) {
1313
// Check if the current rendering mode is WEBGL
14-
if (this._renderer && this._renderer.isWEBGL) {
15-
throw new Error('gridOutput() is not supported in WEBGL mode.');
14+
if (this._renderer && this._renderer instanceof p5.RendererGL) {
15+
if (!this._didOutputGridWebGLMessage) {
16+
this._didOutputGridWebGLMessage = true;
17+
console.error('gridOutput() does not yet work in WebGL mode.');
18+
}
19+
return;
1620
}
1721
//if html structure is not there yet
1822
if (!this.dummyDOM.querySelector(`#${idT}_summary`)) {

src/accessibility/textOutput.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ import p5 from '../core/main';
1111
//updates textOutput
1212
p5.prototype._updateTextOutput = function(idT) {
1313
// Check if the current rendering mode is WEBGL
14-
if (this._renderer.isWEBGL) {
15-
throw new Error('textOutput() is not supported in WEBGL mode.');
14+
if (this._renderer && this._renderer instanceof p5.RendererGL) {
15+
if (!this._didOutputTextWebGLMessage) {
16+
this._didOutputTextWebGLMessage = true;
17+
console.error('textOutput() does not yet work in WebGL mode.');
18+
}
19+
return;
1620
}
1721
//if html structure is not there yet
1822
if (!this.dummyDOM.querySelector(`#${idT}_summary`)) {

0 commit comments

Comments
 (0)