A Program represents a pair of a fragment- and vertex-shader.

This class is a convenient replacement for Stage3Ds "Program3D" class. Its main advantage is that it survives a context loss; furthermore, it makes it simple to create a program from AGAL source without having to deal with the assembler.

It is recommended to store programs in Starling's "Painter" instance via the methods `registerProgram` and `getProgram`. That way, your programs may be shared among different display objects or even Starling instances.

@see Painter

### Hierarchy

- Program

## Index

### Constructors

- constructor

### Methods

- activate
- dispose
- fromSource

## Constructors

### constructor

- new Program(vertexShader: ByteArray, fragmentShader: ByteArray): Program

- - Defined in lib/starling/rendering/Program.d.ts:22

  Creates a program from the given AGAL (Adobe Graphics Assembly Language) bytecode.

  #### Parameters

  - ##### vertexShader: ByteArray

  - ##### fragmentShader: ByteArray

  #### Returns Program

## Methods

### activate

- activate(context?: Context3D): void

- - Defined in lib/starling/rendering/Program.d.ts:35

  Activates the program on the given context. If you don't pass a context, the current Starling context will be used.

  #### Parameters

  - ##### Optional context: Context3D

  #### Returns void

### dispose

- dispose(): void

- - Defined in lib/starling/rendering/Program.d.ts:27

  Disposes the internal Program3D instance.

  #### Returns void

### Static fromSource

- fromSource(vertexShader: string, fragmentShader: string, agalVersion?: number): Program

- - Defined in lib/starling/rendering/Program.d.ts:30

  Creates a new Program instance from AGAL assembly language.

  #### Parameters

  - ##### vertexShader: string

  - ##### fragmentShader: string

  - ##### Optional agalVersion: number

  #### Returns Program

Generated using TypeDoc