Skip to content

Commit

Permalink
Antialiasing now an option for renderer (off by default)
Browse files Browse the repository at this point in the history
  • Loading branch information
GoodBoyDigital committed Aug 15, 2013
1 parent 6085657 commit 06176be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/pixi/renderers/webgl/WebGLRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ PIXI.gl;
* @param height=0 {Number} the height of the canvas view
* @param view {Canvas} the canvas to use as a view, optional
* @param transparent=false {Boolean} the transparency of the render view, default false
* @param antialias=false {Boolean} sets antialias (only applicable in chrome at the moment)
*
*/
PIXI.WebGLRenderer = function(width, height, view, transparent)
PIXI.WebGLRenderer = function(width, height, view, transparent, antialias)
{
// do a catch.. only 1 webGL renderer..

Expand All @@ -46,7 +47,7 @@ PIXI.WebGLRenderer = function(width, height, view, transparent)
{
PIXI.gl = this.gl = this.view.getContext("experimental-webgl", {
alpha: this.transparent,
antialias:true, // SPEED UP??
antialias:!!antialias, // SPEED UP??
premultipliedAlpha:false,
stencil:true
});
Expand Down
7 changes: 5 additions & 2 deletions src/pixi/utils/Detector.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
* @param height {Number} the height of the renderers view
* @param view {Canvas} the canvas to use as a view, optional
* @param transparent=false {Boolean} the transparency of the render view, default false
* @param antialias=false {Boolean} sets antialias (only applicable in webGL chrome at the moment)
*
* antialias
*/
PIXI.autoDetectRenderer = function(width, height, view, transparent)
PIXI.autoDetectRenderer = function(width, height, view, transparent, antialias)
{
if(!width)width = 800;
if(!height)height = 600;
Expand All @@ -25,7 +28,7 @@ PIXI.autoDetectRenderer = function(width, height, view, transparent)
//console.log(webgl);
if( webgl )
{
return new PIXI.WebGLRenderer(width, height, view, transparent);
return new PIXI.WebGLRenderer(width, height, view, transparent, antialias);
}

return new PIXI.CanvasRenderer(width, height, view, transparent);
Expand Down

0 comments on commit 06176be

Please sign in to comment.