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

calling from_webgl2_context multiple times doesn't return the same context #285

Open
vizigr0u opened this issue Feb 28, 2024 · 1 comment

Comments

@vizigr0u
Copy link

vizigr0u commented Feb 28, 2024

observed behaviour

Calling glow::Context::from_webgl2_context multiple times seems to return a different context.

expected behaviour

Calling glow::Context::from_webgl2_context multiple times returns the same context every time.

This is consistent with the behaviour of the javascript getContext and with the behaviour observed in web-sys.

Repro

see this gist of drawing a triangle comparing web-sys and glow : https://gist.github.com/vizigr0u/952637d4f9b1b3bd9a6eb8e7a872a3a0

The methods render_glow and render_web_sys grab a context from an existing canvas and call draw_glow or draw_web_sys

the constant SHOWCASE_BUG will affect whether the draw methods are passed a new context or a reference.

observe that when SHOWCASE_BUG is true, draw_glow will not be displaying while draw_web_sys will work either way.

@vizigr0u vizigr0u changed the title glow::Context::from_webgl2_context doesn't return the same context calling from_webgl2_context multiple times doesn't return the same context Mar 4, 2024
@grovesNL
Copy link
Owner

Hi! This isn't supported right now because of the WebGL context is currently wrapped to track/copy WebGL handles.

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

No branches or pull requests

2 participants