Artenus 2D Framework
Artenus Reference
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 TypeMethod and Description
public voidactivate()
Activates the shader program.
public voidcleanup()
Removes any unused state created by this shader program from the rendering context.
public voidcompile()
Compiles this shader program.
public voiddestroy()
Destroys the shader program and frees all allocated resources.
public voidfeed(float[] mat)
Feeds a transformation matrix to this shader program.
public voidfeed(FloatBuffer buffer)
Feeds a vertex strip for the element to be drawn on the screen.
public voidfeed(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:
matThe matrix
feed
public void feed(
    FloatBuffer buffer
)
Feeds a vertex strip for the element to be drawn on the screen.
Parameters:
bufferThe vertex buffer for the element
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:
rThe red component of the color
gThe green component of the color
bThe blue component of the color
aThe alpha component of the color