KhronosGroup / KhronosGroup/WebGL
Specify API for drawing to multiple canvases from one context.
- Dominant language
- HTML
- Stars
- 2.9k
- Forks
- 703
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 4
Description
It is an often required usecase to be able to draw to multiple canvases. In order to do that it needs to be possible to:
- Create a standalone WebGL context
- Create/Size drawing buffers for attachment to a canvas
- Attach drawing buffers as the backing store to a canvas.
A simple API to achieve this could be:
``` javascript
var gl = new WebGLContext();
var canvas1 = document.createElement('canvas');
canvas1.drawingBuffer = gl.createDrawingBuffer({drawing buffer creation attributes})
var canvas2 = document.createElement('canvas');
canvas1.drawingBuffer = gl.createDrawingBuffer({drawing buffer creation attributes})
var draw = function(){
gl.bindDrawingBuffer(canvas1.drawingBuffer);
gl.draw...
gl.bindDrawingBuffer(canvas2.drawingBuffer);
gl.draw...
requestAnimationFrame(draw);
}
```
Contributor guide
Research direction
Start by reviewing the proposed WebGLContext, createDrawingBuffer, bindDrawingBuffer, canvas drawingBuffer, and requestAnimationFrame entry points in the issue. The work is done when the project has an agreed API specification for drawing to multiple canvases from one context.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api, frontend, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100