com.neovisionaries.android.opengl
Class FragmentShader

java.lang.Object
  extended by com.neovisionaries.android.opengl.Shader<FragmentShader>
      extended by com.neovisionaries.android.opengl.FragmentShader

public class FragmentShader
extends Shader<FragmentShader>

OpenGL ES fragment shader.

Author:
Takahiko Kawasaki

Constructor Summary
FragmentShader()
          A constructor.
FragmentShader(File file)
          A constructor with a shader source file.
FragmentShader(InputStream in)
          A constructor with an input stream that feeds a shader source code.
FragmentShader(InputStream in, boolean close)
          A constructor with an input stream that feeds a shader source code.
FragmentShader(String source)
          A constructor with a shader source.
 
Method Summary
 
Methods inherited from class com.neovisionaries.android.opengl.Shader
compile, delete, getId, getState, isAutoDeleted, releaseCompiler, setAutoDeleted, setSource, setSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FragmentShader

public FragmentShader()
               throws GLESException
A constructor. super(ShaderType.FRAGMENT) is called. After this constructor returns, the state of this instance is ShaderState.CREATED.

Throws:
GLESException - glCreateShader() failed.
See Also:
Shader.Shader(ShaderType), glCreateShader

FragmentShader

public FragmentShader(String source)
               throws GLESException
A constructor with a shader source. super(ShaderType.FRAGMENT, source) is called. After this constructor returns, the state of this instance is ShaderState.SOURCE_SET.

Parameters:
source - A shader source code.
Throws:
IllegalArgumentException - The argument is null.
GLESException - glCreateShader() failed.
See Also:
Shader.Shader(ShaderType, String), glCreateShader, glShaderSource

FragmentShader

public FragmentShader(File file)
               throws IOException,
                      GLESException
A constructor with a shader source file. super(ShaderType.FRAGMENT, file) is called. After this constructor returns, the state of this instance is ShaderState.SOURCE_SET.

Parameters:
file - A file whose content is a shader source code.
Throws:
IllegalArgumentException - The argument is null.
IOException - Failed to read the content of the given file.
GLESException - glCreateShader() failed.
See Also:
Shader.Shader(ShaderType, File), glCreateShader, glShaderSource

FragmentShader

public FragmentShader(InputStream in)
               throws IOException,
                      GLESException
A constructor with an input stream that feeds a shader source code. super(ShaderType.FRAGMENT, in) is called. After this constructor returns, the state of this instance is ShaderState.SOURCE_SET.

Parameters:
in - An input stream that feeds a shader source code.
Throws:
IllegalArgumentException - The argument is null.
IOException - Failed to read the content of the input stream.
GLESException - glCreateShader() failed.
See Also:
Shader.Shader(ShaderType, InputStream), glCreateShader, glShaderSource

FragmentShader

public FragmentShader(InputStream in,
                      boolean close)
               throws IOException,
                      GLESException
A constructor with an input stream that feeds a shader source code. super(ShaderType.FRAGMENT, in, close) is called. After this constructor returns, the state of this instance is ShaderState.SOURCE_SET.

Parameters:
in - An input stream that feeds a shader source code.
close - If true is given, the input stream is closed before this method returns.
Throws:
IllegalArgumentException - The argument is null.
IOException - Failed to read the content of the input stream.
GLESException - glCreateShader() failed.
See Also:
Shader.Shader(ShaderType, InputStream, boolean), glCreateShader, glShaderSource