mirror of
https://github.com/photonstorm/phaser
synced 2025-02-17 06:28:30 +00:00
Testing Particle renderer.
This commit is contained in:
parent
54dd3f1e8c
commit
08d1d8b677
2 changed files with 22 additions and 4 deletions
|
@ -8,7 +8,7 @@ var CONST = require('../const');
|
|||
var CanvasPool = require('../dom/CanvasPool');
|
||||
var Features = require('../device/Features');
|
||||
var CanvasRenderer = require('../renderer/canvas/CanvasRenderer');
|
||||
var WebGLRenderer = require('../renderer/webgl/WebGLRenderer');
|
||||
var WebGLRenderer = require('../renderer/webgl/renderers/ParticleRenderer');
|
||||
|
||||
/**
|
||||
* Checks if the device is capable of using the requested renderer and sets it up or an alternative if not.
|
||||
|
|
|
@ -8,8 +8,9 @@ var IndexBuffer = require('../utils/IndexBuffer');
|
|||
var VertexArray = require('../utils/VertexArray');
|
||||
var CONST = require('../../const');
|
||||
|
||||
var ParticleRenderer = function ()
|
||||
var ParticleRenderer = function (game)
|
||||
{
|
||||
this.game = game;
|
||||
this.glContext = null;
|
||||
this.maxParticles = null;
|
||||
this.vertShader = null;
|
||||
|
@ -27,6 +28,23 @@ var ParticleRenderer = function ()
|
|||
this.resolution = game.config.resolution;
|
||||
this.width = game.config.width * game.config.resolution;
|
||||
this.height = game.config.height * game.config.resolution;
|
||||
|
||||
// All of these settings will be able to be controlled via the Game Config
|
||||
this.config = {
|
||||
clearBeforeRender: true,
|
||||
transparent: false,
|
||||
autoResize: false,
|
||||
preserveDrawingBuffer: false,
|
||||
|
||||
WebGLContextOptions: {
|
||||
alpha: true,
|
||||
antialias: true,
|
||||
premultipliedAlpha: true,
|
||||
stencil: true,
|
||||
preserveDrawingBuffer: false
|
||||
}
|
||||
};
|
||||
|
||||
this.init();
|
||||
};
|
||||
|
||||
|
@ -228,8 +246,8 @@ ParticleRenderer.prototype.resize = function (width, height)
|
|||
viewMatrixLocation,
|
||||
false,
|
||||
new Float32Array([
|
||||
2 / view.width, 0, 0, 0,
|
||||
0, -2 / view.height, 0, 0,
|
||||
2 / this.view.width, 0, 0, 0,
|
||||
0, -2 / this.view.height, 0, 0,
|
||||
0, 0, 1, 1,
|
||||
-1, 1, 0, 0
|
||||
])
|
||||
|
|
Loading…
Add table
Reference in a new issue