Skip to content

Fix background(img) handling in WEBGL mode in RendererGL #7963

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Helenbeyorn
Copy link

This PR adds support for using background(p5.Image) in WEBGL mode, addressing issue #7917.
What was done:

Modified p5.RendererGL.js to check if the argument is an instance of p5.Image and render it using image().

Confirmed that image background renders properly in WEBGL when served via a local server (python3 -m http.server 5500).

Notes:

The image does not show up when using VS Code Live Server, but this seems to be an environment-specific issue.

Feedback is welcome if there are better integration points for this in the renderer.

Copy link

welcome bot commented Jul 10, 2025

🎉 Thanks for opening this pull request! For guidance on contributing, check out our contributor guidelines and other resources for contributors!
🤔 Please ensure that your PR links to an issue, which has been approved for work by a maintainer; otherwise, there might already be someone working on it, or still ongoing discussion about implementation. You are welcome to join the discussion in an Issue if you're not sure!
🌸 Once your PR is merged, be sure to add yourself to the list of contributors on the readme page !

Thank You!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant