Open vizigr0u opened 8 months ago
Calling glow::Context::from_webgl2_context multiple times seems to return a different context.
glow::Context::from_webgl2_context
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.
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
render_glow
render_web_sys
draw_glow
draw_web_sys
the constant SHOWCASE_BUG will affect whether the draw methods are passed a new context or a reference.
SHOWCASE_BUG
observe that when SHOWCASE_BUG is true, draw_glow will not be displaying while draw_web_sys will work either way.
true
Hi! This isn't supported right now because of the WebGL context is currently wrapped to track/copy WebGL handles.
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
andrender_web_sys
grab a context from an existing canvas and calldraw_glow
ordraw_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
istrue
,draw_glow
will not be displaying whiledraw_web_sys
will work either way.