#

API Docs for: 1.4.3
Show: Inherited Protected Private Deprecated

# WebGLRenderer Class

Defined in: `src/pixi/renderers/webgl/WebGLRenderer.js:7`
Module: PIXI

the WebGLRenderer draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers that support webGL. This Render works by automatically managing webGLBatch's. So no need for Sprite Batch's or Sprite Cloud's Dont forget to add the view to your DOM or you will not see anything :)

## Constructor

### `WebGLRenderer`

(

- `width=0`
- `height=0`
- `view`
- `transparent=false`
- `antialias=false`

)

Defined in `src/pixi/renderers/webgl/WebGLRenderer.js:7`

#### Parameters:

- `width=0` Number

  the width of the canvas view

- `height=0` Number

  the height of the canvas view

- `view` Canvas

  the canvas to use as a view, optional

- `transparent=false` Boolean

  If the render view is transparent, default false

- `antialias=false` Boolean

  sets antialias (only applicable in chrome at the moment)

- Index
- Methods

## Item Index

### Methods

- destroyTexture
- handleContextLost
- handleContextRestored
- render
- resize
- updateTextures static

## Methods

### `destroyTexture`

(

- `texture`

)
private

Defined in `src/pixi/renderers/webgl/WebGLRenderer.js:267`

Destroys a loaded webgl texture

#### Parameters:

- `texture` Texture

  The texture to update

### `handleContextLost`

(

- `event`

)
private

Defined in `src/pixi/renderers/webgl/WebGLRenderer.js:385`

Handles a lost webgl context

#### Parameters:

- `event` Event

### `handleContextRestored`

(

- `event`

)
private

Defined in `src/pixi/renderers/webgl/WebGLRenderer.js:398`

Handles a restored webgl context

#### Parameters:

- `event` Event

### `render`

(

- `stage`

)

Defined in `src/pixi/renderers/webgl/WebGLRenderer.js:134`

Renders the stage to its webGL view

#### Parameters:

- `stage` Stage

  the Stage element to be rendered

### `resize`

(

- `width`
- `height`

)

Defined in `src/pixi/renderers/webgl/WebGLRenderer.js:301`

resizes the webGL view to the specified width and height

#### Parameters:

- `width` Number

  the new width of the webGL view

- `height` Number

  the new height of the webGL view

### `updateTextures`

() private static

Defined in `src/pixi/renderers/webgl/WebGLRenderer.js:240`

Updates the textures loaded into this webgl renderer