"In order to emulate events on the original WebGL canvas, you may put
a transparent DIV on top of flash player with a higher z-index and use
that div to communicate events between flash player and javascript. In
other words, when a developer wants to add a mouse down or mouse move
events, adding event actions must be directed to this transparent DIV
under the hood. The events will be passed to flash player as they
fired on this DIV again under the hood." (
http://code.google.com/p/
cwebgl/issues/detail?id=4#c6)
That's exactly right. There are a few other caveats, however. First is
that a native WebGL context can be generated and used immediately.
Flash, however, needs time to load. So, client code will need to be
changed so that it doesn't depend on the context being ready
immediately. We need to provide a way to pass a callback. Something
like:
function WebGLStart() {
//draw commands
}
window.onload = function() {
gl = canvas.getContext('webgl');
gl.onReady(WebGLStart);
}
Secondly, since Stage3D is not very GL-like, it's going to need to
depend on the software GL layer more than I had anticipated, which is
going to require restructuring by removing the rendering layer from
the GL layer completely.
Finally, compatibility is probably not going to be 100%. An example is
the fact that AGAL does not seem to support any output from the
fragment shaders other than color. This means no writing depth value,
for example. This probably isn't a deal-breaker for the majority of
cases, but it is something to keep in mind.