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

## codeanticode.glgraphics
Class GLSLShader

    java.lang.Object
      codeanticode.glgraphics.GLSLShader

    public class GLSLShader

extends java.lang.Object

This class encapsulates a glsl shader. Based in the code by JohnG (http://www.hardcorepawn.com/)

Constructor Summary
`GLSLShader(processing.core.PApplet parent)` Creates an instance of GLSLShader.

Method Summary
`int` | `getAttribLocation(java.lang.String name)` Returns the ID location of the attribute parameter given its name.
`int` | `getUniformLocation(java.lang.String name)` Returns the ID location of the uniform parameter given its name.
`void` | `linkProgram()` Links the shader program and validates it.
`void` | `loadFragmentShader(java.lang.String file)` Loads and compiles the fragment shader contained in file.
`void` | `loadFragmentShader(java.net.URL url)` Loads and compiles the fragment shader contained in the URL.
`void` | `loadGeometryShader(java.lang.String file)` Loads and compiles the geometry shader contained in file.
`void` | `loadGeometryShader(java.net.URL url)` Loads and compiles the geometry shader contained in the URL
`void` | `loadVertexShader(java.lang.String file)` Loads and compiles the vertex shader contained in file.
`void` | `loadVertexShader(java.net.URL url)` Loads and compiles the vertex shader contained in the URL.
`void` | `setupGeometryShader(java.lang.String inGeoPrim, java.lang.String outGeoPrim, int maxNumOutVert)` Configures the geometry shader by setting the primitive types that it will take as input and return as output, and the maximum number of vertices that will generate.
`void` | `start()` Starts the execution of the shader program.
`void` | `stop()` Stops the execution of the shader program.

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

Constructor Detail

### GLSLShader

    public GLSLShader(processing.core.PApplet parent)

  Creates an instance of GLSLShader.

  Parameters:
    `parent` - PApplet

Method Detail

### loadVertexShader

    public void loadVertexShader(java.lang.String file)

  Loads and compiles the vertex shader contained in file.

  Parameters:
    `file` - String

### loadVertexShader

    public void loadVertexShader(java.net.URL url)

  Loads and compiles the vertex shader contained in the URL.

  Parameters:
    `file` - String

### loadGeometryShader

    public void loadGeometryShader(java.lang.String file)

  Loads and compiles the geometry shader contained in file.

  Parameters:
    `file` - String

### loadGeometryShader

    public void loadGeometryShader(java.net.URL url)

  Loads and compiles the geometry shader contained in the URL

  Parameters:
    `url` - URL

### loadFragmentShader

    public void loadFragmentShader(java.lang.String file)

  Loads and compiles the fragment shader contained in file.

  Parameters:
    `file` - String

### loadFragmentShader

    public void loadFragmentShader(java.net.URL url)

  Loads and compiles the fragment shader contained in the URL.

  Parameters:
    `url` - URL

### getAttribLocation

    public int getAttribLocation(java.lang.String name)

  Returns the ID location of the attribute parameter given its name.

  Parameters:
    `name` - String
  Returns:
    int

### getUniformLocation

    public int getUniformLocation(java.lang.String name)

  Returns the ID location of the uniform parameter given its name.

  Parameters:
    `name` - String
  Returns:
    int

### setupGeometryShader

    public void setupGeometryShader(java.lang.String inGeoPrim,
                                    java.lang.String outGeoPrim,
                                    int maxNumOutVert)

  Configures the geometry shader by setting the primitive types that it will take as input and return as output, and the maximum number of vertices that will generate. This method needs to be called after creating the geometry shader and before linking the program.

  Parameters:
    `inGeoPrim` - String
    `outGeoPrim` - String
    `maxNumOutVert` - int

### linkProgram

    public void linkProgram()

  Links the shader program and validates it.

### start

    public void start()

  Starts the execution of the shader program.

### stop

    public void stop()

  Stops the execution of the shader program.

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

processing library glgraphics by Andres Colubri. (c) 2008