[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] using the same context with multiple canvases






On Sat, Nov 17, 2012 at 8:23 AM, Ian Hickson <ian@hixie.ch> wrote:
   var path = new Path();
   for (var i = 0; i < 1000; ++i) {
     path.moveTo(...);
     path.lineTo(...);
   }

   c1.setContext(ctx);
   ctx.stroke(path);
   c2.setContext(ctx);
   ctx.stroke(path);
   c3.setContext(ctx);
   ctx.stroke(path);
This concept already exists for WebGL. It's called Array Buffer Object. Not all state is objects of course, but at least textures, vertices and shaders are.