#

API Docs for: 2.0.0
Show: Inherited Protected Private Deprecated

# WebGLSpriteBatch Class

Defined in: `src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:11`
Module: PIXI

## Constructor

### `WebGLSpriteBatch`

() private

Defined in `src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:11`

- Index
- Methods
- Properties

## Item Index

### Methods

- _CompileShader
- begin
- CompileFragmentShader
- compileProgram
- CompileVertexShader
- destroy
- end
- flush
- initDefaultShaders
- render
- renderBatch
- renderTilingSprite
- setContext
- start
- stop

### Properties

- blendModes
- currentBaseTexture
- currentBatchSize
- defaultShader
- dirty
- drawing
- indices
- lastIndexCount
- shaders
- size
- sprites
- textures
- vertices
- vertSize

## Methods

### `_CompileShader`

(

- `gl`
- `shaderSrc`
- `shaderType`

)
Any private

Defined in `src/pixi/renderers/webgl/utils/WebGLShaderUtils.js:35`

#### Parameters:

- `gl` WebGLContext

  the current WebGL drawing context

- `shaderSrc` Array
- `shaderType` Number

#### Returns:

Any:

### `begin`

(

- `renderSession`

)

Defined in `src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:164`

#### Parameters:

- `renderSession` Object

  The RenderSession object

### `CompileFragmentShader`

(

- `gl`
- `shaderSrc`

)
Any

Defined in `src/pixi/renderers/webgl/utils/WebGLShaderUtils.js:24`

#### Parameters:

- `gl` WebGLContext

  the current WebGL drawing context

- `shaderSrc` Array

#### Returns:

Any:

### `compileProgram`

(

- `gl`
- `vertexSrc`
- `fragmentSrc`

)
Any

Defined in `src/pixi/renderers/webgl/utils/WebGLShaderUtils.js:59`

#### Parameters:

- `gl` WebGLContext

  the current WebGL drawing context

- `vertexSrc` Array
- `fragmentSrc` Array

#### Returns:

Any:

### `CompileVertexShader`

(

- `gl`
- `shaderSrc`

)
Any

Defined in `src/pixi/renderers/webgl/utils/WebGLShaderUtils.js:13`

#### Parameters:

- `gl` WebGLContext

  the current WebGL drawing context

- `shaderSrc` Array

#### Returns:

Any:

### `destroy`

()

Defined in `src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:589`

Destroys the SpriteBatch.

### `end`

()

Defined in `src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:176`

### `flush`

()

Defined in `src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:418`

Renders the content and empties the current batch.

### `initDefaultShaders`

() private

Defined in `src/pixi/renderers/webgl/utils/WebGLShaderUtils.js:5`

### `render`

(

- `sprite`

)

Defined in `src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:184`

#### Parameters:

- `sprite` Sprite

  the sprite to render when using this spritebatch

### `renderBatch`

(

- `texture`
- `size`
- `startIndex`

)

Defined in `src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:542`

#### Parameters:

- `texture` Texture
- `size` Number
- `startIndex` Number

### `renderTilingSprite`

(

- `sprite`

)

Defined in `src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:297`

Renders a TilingSprite using the spriteBatch.

#### Parameters:

- `sprite` TilingSprite

  the tilingSprite to render

### `setContext`

(

- `gl`

)

Defined in `src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:132`

#### Parameters:

- `gl` WebGLContext

  the current WebGL drawing context

### `start`

()

Defined in `src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:581`

### `stop`

()

Defined in `src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:572`

## Properties

### `blendModes`

Array

Defined in `src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:99`

### `currentBaseTexture`

BaseTexture

Defined in `src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:81`

### `currentBatchSize`

Number

Defined in `src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:75`

### `defaultShader`

AbstractFilter

Defined in `src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:117`

### `dirty`

Boolean

Defined in `src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:87`

### `drawing`

Boolean

Defined in `src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:69`

### `indices`

Uint16Array

Defined in `src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:45`

Holds the indices

### `lastIndexCount`

Number

Defined in `src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:53`

### `shaders`

Array

Defined in `src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:105`

### `size`

Number

Defined in `src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:25`

The number of images in the SpriteBatch before it flushes

### `sprites`

Array

Defined in `src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:111`

### `textures`

Array

Defined in `src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:93`

### `vertices`

Float32Array

Defined in `src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:37`

Holds the vertices

### `vertSize`

Number

Defined in `src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:19`