mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 12:43:26 +00:00
WebGLSnapshot: Support custom rendering contexts
This commit is contained in:
parent
368b37b916
commit
6108414b75
2 changed files with 5 additions and 5 deletions
|
@ -17,12 +17,12 @@ var GetFastValue = require('../../utils/object/GetFastValue');
|
|||
* @function Phaser.Renderer.Snapshot.WebGL
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {HTMLCanvasElement} sourceCanvas - The canvas to take a snapshot of.
|
||||
* @param {WebGLRenderingContext} sourceContext - The WebGL context to take a snapshot of.
|
||||
* @param {Phaser.Types.Renderer.Snapshot.SnapshotState} config - The snapshot configuration object.
|
||||
*/
|
||||
var WebGLSnapshot = function (sourceCanvas, config)
|
||||
var WebGLSnapshot = function (sourceContext, config)
|
||||
{
|
||||
var gl = sourceCanvas.getContext('experimental-webgl');
|
||||
var gl = sourceContext;
|
||||
|
||||
var callback = GetFastValue(config, 'callback');
|
||||
var type = GetFastValue(config, 'type', 'image/png');
|
||||
|
|
|
@ -2654,7 +2654,7 @@ var WebGLRenderer = new Class({
|
|||
|
||||
if (state.callback)
|
||||
{
|
||||
WebGLSnapshot(this.canvas, state);
|
||||
WebGLSnapshot(this.gl, state);
|
||||
|
||||
state.callback = null;
|
||||
}
|
||||
|
@ -2814,7 +2814,7 @@ var WebGLRenderer = new Class({
|
|||
|
||||
this.setFramebuffer(framebuffer);
|
||||
|
||||
WebGLSnapshot(this.canvas, state);
|
||||
WebGLSnapshot(this.gl, state);
|
||||
|
||||
this.setFramebuffer(currentFramebuffer);
|
||||
|
||||
|
|
Loading…
Reference in a new issue