public class

ShaderProgram

extends Object
implements ShaderProgramConstants
java.lang.Object
   ↳ org.andengine.opengl.shader.ShaderProgram
Known Direct Subclasses

Class Overview

(c) Zynga 2011

Summary

[Expand]
Inherited Constants
From interface org.andengine.opengl.shader.constants.ShaderProgramConstants
Fields
protected final HashMap<StringInteger> mAttributeLocations
protected boolean mCompiled
protected final IShaderSource mFragmentShaderSource
protected int mProgramID
protected final HashMap<StringInteger> mUniformLocations
protected final IShaderSource mVertexShaderSource
Public Constructors
ShaderProgram(String pVertexShaderSource, String pFragmentShaderSource)
ShaderProgram(IShaderSource pVertexShaderSource, IShaderSource pFragmentShaderSource)
Public Methods
void bind(GLState pGLState, VertexBufferObjectAttributes pVertexBufferObjectAttributes)
void delete(GLState pGLState)
int getAttributeLocation(String pAttributeName)
int getAttributeLocationOptional(String pAttributeName)
int getUniformLocation(String pUniformName)
int getUniformLocationOptional(String pUniformName)
boolean isCompiled()
void setCompiled(boolean pCompiled)
void setTexture(String pUniformName, int pTexture)
void setTextureOptional(String pUniformName, int pTexture)
void setUniform(String pUniformName, float pX, float pY)
void setUniform(String pUniformName, float pX)
void setUniform(String pUniformName, float pX, float pY, float pZ, float pW)
void setUniform(String pUniformName, float pX, float pY, float pZ)
void setUniform(String pUniformName, float[] pGLMatrix)
void setUniformOptional(String pUniformName, float pX, float pY, float pZ)
void setUniformOptional(String pUniformName, float pX, float pY)
void setUniformOptional(String pUniformName, float pX)
void setUniformOptional(String pUniformName, float pX, float pY, float pZ, float pW)
void setUniformOptional(String pUniformName, float[] pGLMatrix)
void unbind(GLState pGLState)
Protected Methods
void compile(GLState pGLState)
void link(GLState pGLState)
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected final HashMap<StringInteger> mAttributeLocations

protected boolean mCompiled

protected final IShaderSource mFragmentShaderSource

protected int mProgramID

protected final HashMap<StringInteger> mUniformLocations

protected final IShaderSource mVertexShaderSource

Public Constructors

public ShaderProgram (String pVertexShaderSource, String pFragmentShaderSource)

public ShaderProgram (IShaderSource pVertexShaderSource, IShaderSource pFragmentShaderSource)

Public Methods

public void bind (GLState pGLState, VertexBufferObjectAttributes pVertexBufferObjectAttributes)

public void delete (GLState pGLState)

public int getAttributeLocation (String pAttributeName)

public int getAttributeLocationOptional (String pAttributeName)

public int getUniformLocation (String pUniformName)

public int getUniformLocationOptional (String pUniformName)

public boolean isCompiled ()

public void setCompiled (boolean pCompiled)

public void setTexture (String pUniformName, int pTexture)

Parameters
pTexture the index of the Texture to use. Similar to GL_TEXTURE0, GL_TEXTURE1, ... except that it is 0 based.

public void setTextureOptional (String pUniformName, int pTexture)

Parameters
pTexture the index of the Texture to use. Similar to GL_TEXTURE0, GL_TEXTURE1, ... except that it is 0 based.

public void setUniform (String pUniformName, float pX, float pY)

public void setUniform (String pUniformName, float pX)

public void setUniform (String pUniformName, float pX, float pY, float pZ, float pW)

public void setUniform (String pUniformName, float pX, float pY, float pZ)

public void setUniform (String pUniformName, float[] pGLMatrix)

public void setUniformOptional (String pUniformName, float pX, float pY, float pZ)

public void setUniformOptional (String pUniformName, float pX, float pY)

public void setUniformOptional (String pUniformName, float pX)

public void setUniformOptional (String pUniformName, float pX, float pY, float pZ, float pW)

public void setUniformOptional (String pUniformName, float[] pGLMatrix)

public void unbind (GLState pGLState)

Protected Methods

protected void compile (GLState pGLState)

protected void link (GLState pGLState)