| 421 | } |
| 422 | |
| 423 | function clear (options) { |
| 424 | check( |
| 425 | typeof options === 'object' && options, |
| 426 | 'regl.clear() takes an object as input') |
| 427 | if ('framebuffer' in options) { |
| 428 | if (options.framebuffer && |
| 429 | options.framebuffer_reglType === 'framebufferCube') { |
| 430 | for (var i = 0; i < 6; ++i) { |
| 431 | setFBO(extend({ |
| 432 | framebuffer: options.framebuffer.faces[i] |
| 433 | }, options), clearImpl) |
| 434 | } |
| 435 | } else { |
| 436 | setFBO(options, clearImpl) |
| 437 | } |
| 438 | } else { |
| 439 | clearImpl(null, options) |
| 440 | } |
| 441 | } |
| 442 | |
| 443 | function frame (cb) { |
| 444 | check.type(cb, 'function', 'regl.frame() callback must be a function') |