com.annahid.libs.artenus.graphics.rendering
ShaderProgram
Interface for all shader programs. A shader program is a rendering component that instructs the
graphics hardware on how to draw elements on the screen.
public interface ShaderProgram
Method Summary
Modifier and Type | Method and Description |
---|---|
public void | activate() Activates the shader program. |
public void | cleanup() Removes any unused state created by this shader program from the rendering context. |
public void | compile() Compiles this shader program. |
public void | destroy() Destroys the shader program and frees all allocated resources. |
public void | feed(float[] mat) Feeds a transformation matrix to this shader program. |
public void | feed(FloatBuffer buffer) Feeds a vertex strip for the element to be drawn on the screen. |
public void | feed(float r, float g, float b, float a) Feeds a color component to this shader program. |
Method Detail
activate |
---|
public void activate() Activates the shader program. This method is normally called for each renderable, or when
the shader program is switched to. See Also:
|
cleanup |
---|
public void cleanup() Removes any unused state created by this shader program from the rendering context. This
method is normally called when the shader program is no longer needed for the current frame.
Note that the program may be needed for the next frame, so it should not deallocate its
global resources. |
compile |
---|
public void compile() Compiles this shader program. |
destroy |
---|
public void destroy() Destroys the shader program and frees all allocated resources. The shader will not be used
after this method, unless the compile() method is called again. |
feed | ||
---|---|---|
public void feed( float[] mat ) Feeds a transformation matrix to this shader program. This matrix is also multiplied by the
projection matrix and can be directly used to draw elements. Parameters:
|
feed | ||
---|---|---|
public void feed( FloatBuffer buffer ) Feeds a vertex strip for the element to be drawn on the screen. Parameters:
|
feed | ||||||||
---|---|---|---|---|---|---|---|---|
public void feed( float r, float g, float b, float a ) Feeds a color component to this shader program. All shader programs in this framework are
expected to accept one color component. But how they use this component is not defined. Parameters:
|