-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Throwing friendly error in webgl mode when using gridOutput() and textOutput() #6491
base: main
Are you sure you want to change the base?
Conversation
🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already. And be sure to add yourself to the list of contributors on the readme page! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making this! I think the current check needs to be updated in order to properly test for WebGL.
After making the changes, it would be great to either add a unit test or make a test sketch in the p5 editor to verify that it throws an error when using this in WebGL mode. Let me know if you need any help doing either of those!
@@ -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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now we don't have this property on renderers (although #5844 is open for it, it hasn't yet been merged.) For now I think maybe you can check if this._renderer instanceof p5.RendererGL
to achieve the same thing.
Resolves #6126
Changes:
PR Checklist
npm run lint
passes