[Public WebGL] using the same context with multiple canvases

Florian Bösch [email protected]
Wed Dec 12 08:00:08 PST 2012

On Wed, Dec 12, 2012 at 4:45 PM, Vladimir Vukicevic <[email protected]>wrote:

> does that getContext conceptually create a Drawingbuffer and call
> setDrawingbuffer on the canvas, as well as call bindDrawingbuffer on the gl
> context?

> Is Drawingbuffer webgl-specific, or a general abstraction? (Bikeshed note:
> we need a better name than "Drawingbuffer" IMO...). However, we'd still
> need to determine the types of contexts that it can be used with if it's
> general.  Maybe something like:
We've iterated this already on this thread in October, Frontbuffer was
worse, framebuffer is easily confused with framebuffer object,
drawingbuffer is actually a pretty good description.

> gl = new WebGLRenderingContext();
> db1 = gl.createDrawingBuffer({ depth: false });
> canvas.displayDrawingBuffer(**db1);  // setDrawingBuffer on the canvas
> seems like a weird API name, as we're really choosing what buffer to
> display; what buffer is drawn to is selected by the context
How about canvas.setDisplayBuffer(db1) ?

> twodee = Canvas2DRenderingContext();
> db2 = twodee.createDrawingBuffer({ doubleBuffer: true });
> canvas.displayDrawingBuffer(**db2);  // is this legal; canvas originally
> displayed a webgl buffer?

It should be legal in my opinion to attach an entirely different drawing
buffer to the same canvas. The context specificity goes with the drawing

> db1 = new Drawingbuffer("webgl", { depth: false });
> db2 = new Drawingbuffer("2d", { doubleBuffer: true });

It's an interesting question, I might be wrong but people where arguing for
a context independent way to create drawing buffers (somewhere back in
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://khronos.org/pipermail/public_webgl_khronos.org/attachments/20121212/3e0e3a78/attachment.html>

More information about the public_webgl mailing list