Skip to content

Commit e086e91

Browse files
committed
Skip text/gridOutput with a warning in WebGL in 2.0
1 parent db17645 commit e086e91

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/accessibility/gridOutput.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ function gridOutput(p5, fn){
1010

1111
//updates gridOutput
1212
fn._updateGridOutput = function(idT) {
13+
if (this._renderer && this._renderer instanceof p5.RendererGL) {
14+
if (!this._didOutputGridWebGLMessage) {
15+
this._didOutputGridWebGLMessage = true;
16+
console.error('gridOutput() does not yet work in WebGL mode.');
17+
}
18+
return;
19+
}
1320
//if html structure is not there yet
1421
if (!this.dummyDOM.querySelector(`#${idT}_summary`)) {
1522
return;

src/accessibility/textOutput.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ function textOutput(p5, fn){
1010

1111
//updates textOutput
1212
fn._updateTextOutput = function(idT) {
13+
if (this._renderer && this._renderer instanceof p5.RendererGL) {
14+
if (!this._didOutputTextWebGLMessage) {
15+
this._didOutputTextWebGLMessage = true;
16+
console.error('textOutput() does not yet work in WebGL mode.');
17+
}
18+
return;
19+
}
1320
//if html structure is not there yet
1421
if (!this.dummyDOM.querySelector(`#${idT}_summary`)) {
1522
return;

0 commit comments

Comments
 (0)