Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## de.rico.engine.effect.glslshader
Class GPUProgram

    java.lang.Object
      de.rico.engine.effect.glslshader.GPUProgram

    public class GPUProgram

extends java.lang.Object

This class can be used to read in and bind vertex and fragment shaders.

Author:
  Stefan Janacek (some additions and refactoring by Frank Bruns)

Constructor Summary
`GPUProgram(java.lang.String vertexProgramFile, java.lang.String fragmentProgramFile)` Creates a new GPU program.

Method Summary
`void` | `bind(javax.media.opengl.GL gl)` Binds the shader to the successive draw operations.
`boolean` | `init()` Initializes the shader.
`void` | `passUniform1f(javax.media.opengl.GL gl, java.lang.String name, float f)` Passes a float value to the shader program.
`void` | `passUniform1i(javax.media.opengl.GL gl, java.lang.String name, int i)` Passes a integer value to the shader program.
`void` | `passUniform3f(javax.media.opengl.GL gl, java.lang.String name, float f0, float f1, float f2)` Passes three float values to the shader program.
`void` | `passUniform4f(javax.media.opengl.GL gl, java.lang.String name, float f0, float f1, float f2, float f3)` Passes four float values to the shader program.
`void` | `release(javax.media.opengl.GL gl)` Releases the shader.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### GPUProgram

    public GPUProgram(java.lang.String vertexProgramFile,
                      java.lang.String fragmentProgramFile)

  Creates a new GPU program.

  Parameters:
    `vertexProgramFile` - vertex program file
    `fragmentProgramFile` - fragment program file

Method Detail

### init

    public boolean init()

  Initializes the shader.

### bind

    public void bind(javax.media.opengl.GL gl)

  Binds the shader to the successive draw operations.

  Parameters:
    `gl` -

### release

    public void release(javax.media.opengl.GL gl)

  Releases the shader.

  Parameters:
    `gl` -

### passUniform1i

    public void passUniform1i(javax.media.opengl.GL gl,
                              java.lang.String name,
                              int i)

  Passes a integer value to the shader program.

  Parameters:
    `name` - name of the variable to pass the value to
    `i` - value that gets passed to the shader

### passUniform1f

    public void passUniform1f(javax.media.opengl.GL gl,
                              java.lang.String name,
                              float f)

  Passes a float value to the shader program.

  Parameters:
    `name` - name of the variable to pass the value to
    `f` - value that gets passed to the shader

### passUniform3f

    public void passUniform3f(javax.media.opengl.GL gl,
                              java.lang.String name,
                              float f0,
                              float f1,
                              float f2)

  Passes three float values to the shader program.

  Parameters:
    `name` - name of the variable to pass the values to
    `f0` - first value that gets passed to the shader
    `f1` - second value that gets passed to the shader
    `f2` - third value that gets passed to the shader

### passUniform4f

    public void passUniform4f(javax.media.opengl.GL gl,
                              java.lang.String name,
                              float f0,
                              float f1,
                              float f2,
                              float f3)

  Passes four float values to the shader program.

  Parameters:
    `name` - name of the variable to pass the values to
    `f0` - first value that gets passed to the shader
    `f1` - second value that gets passed to the shader
    `f2` - third value that gets passed to the shader
    `f3` - fourth value that gets passed to the shader

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD