Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Somnath-Mishra
Copy link

Resolves #6126

Changes:

PR Checklist

  • [ x] npm run lint passes

@welcome
Copy link

welcome bot commented Oct 23, 2023

🎉 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!

Copy link
Contributor

@davepagurek davepagurek left a 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) {
Copy link
Contributor

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.

@Qianqianye Qianqianye added this to the 1.9.0 milestone Nov 23, 2023
@Qianqianye Qianqianye mentioned this pull request Nov 23, 2023
7 tasks
@Qianqianye Qianqianye modified the milestones: 1.9.0, 1.9.1 Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

textOutput() and gridOuput() are incomplete and inaccurate in WEBGL
3 participants