public class GLSLProgram extends Object
attachVertexShader()
and attachFragmentShader()
bindTextureRECT(gl)
Modifier and Type | Class and Description |
---|---|
static class |
GLSLProgram.GLSLWarnType |
static class |
GLSLProgram.Strictness
Control the behaviour of a GLSL program with errors (throwing exceptions, create warnings, etc)
|
Modifier and Type | Field and Description |
---|---|
static GLSLProgram.Strictness |
DEFAULT_STRICTNESS |
protected List<Integer> |
fragmentShaders_ |
protected Integer |
programId |
protected GLSLProgram.Strictness |
strictness |
protected List<Integer> |
vertexShaders_ |
static boolean |
WARN_SHOW_SHADER_SOURCE |
protected StringBuffer |
warnBuffer |
Constructor and Description |
---|
GLSLProgram() |
GLSLProgram(GLSLProgram.Strictness strictness) |
Modifier and Type | Method and Description |
---|---|
void |
bind(com.jogamp.opengl.GL2 gl) |
void |
bindTexture(com.jogamp.opengl.GL2 gl,
int target,
String texname,
int texid,
int texunit) |
void |
bindTexture2D(com.jogamp.opengl.GL2 gl,
String texname,
int texid,
int texunit) |
void |
bindTexture3D(com.jogamp.opengl.GL2 gl,
String texname,
int texid,
int texunit) |
void |
bindTextureRECT(com.jogamp.opengl.GL2 gl,
String texname,
int texid,
int texunit) |
protected void |
checkShaderLogInfo(com.jogamp.opengl.GL2 inGL,
int inShaderObjectID) |
void |
compileFragmentShader(com.jogamp.opengl.GL2 gl,
URL infoURL,
String content) |
void |
compileVertexShader(com.jogamp.opengl.GL2 gl,
URL infoURL,
String content) |
void |
destroy(com.jogamp.opengl.GL2 gl) |
Integer |
getProgramId() |
void |
link(com.jogamp.opengl.GL2 gl)
Create a program and attach previously loaded and compiled shaders.
|
void |
loadAndCompileFragmentShader(com.jogamp.opengl.GL2 gl,
InputStream stream) |
void |
loadAndCompileFragmentShader(com.jogamp.opengl.GL2 gl,
InputStream stream,
URL infoURL) |
void |
loadAndCompileFragmentShader(com.jogamp.opengl.GL2 gl,
URL fileURL) |
void |
loadAndCompileShaders(com.jogamp.opengl.GL2 gl,
ShaderFilePair files) |
void |
loadAndCompileVertexShader(com.jogamp.opengl.GL2 gl,
InputStream stream) |
void |
loadAndCompileVertexShader(com.jogamp.opengl.GL2 gl,
InputStream stream,
URL infoURL) |
void |
loadAndCompileVertexShader(com.jogamp.opengl.GL2 gl,
URL fileURL) |
String |
readErrors(com.jogamp.opengl.GL2 gl,
int iID) |
void |
setTextureUnit(com.jogamp.opengl.GL2 gl,
String texname,
int texunit) |
void |
setUniform(com.jogamp.opengl.GL2 gl,
String name,
float value) |
void |
setUniform(com.jogamp.opengl.GL2 gl,
String name,
float[] values,
int count) |
void |
unbind(com.jogamp.opengl.GL2 gl) |
void |
validateProgram(com.jogamp.opengl.GL2 gl) |
void |
verifyLinkStatus(com.jogamp.opengl.GL2 gl,
int programId) |
void |
verifyShaderCompiled(com.jogamp.opengl.GL2 gl,
URL fileURL,
int programId,
String content) |
protected void |
warn(String info,
GLSLProgram.GLSLWarnType type) |
protected void |
warnLink(com.jogamp.opengl.GL2 gl,
String error,
int linkStatus,
int logLength) |
protected void |
warnScript(com.jogamp.opengl.GL2 gl,
URL fileURL,
String error,
int compileStatus,
int logLength,
String content) |
public static GLSLProgram.Strictness DEFAULT_STRICTNESS
public static boolean WARN_SHOW_SHADER_SOURCE
protected Integer programId
protected StringBuffer warnBuffer
protected GLSLProgram.Strictness strictness
public GLSLProgram()
public GLSLProgram(GLSLProgram.Strictness strictness)
public void link(com.jogamp.opengl.GL2 gl)
public void bind(com.jogamp.opengl.GL2 gl)
public void unbind(com.jogamp.opengl.GL2 gl)
public void destroy(com.jogamp.opengl.GL2 gl)
public void setUniform(com.jogamp.opengl.GL2 gl, String name, float value)
public void setUniform(com.jogamp.opengl.GL2 gl, String name, float[] values, int count)
public void setTextureUnit(com.jogamp.opengl.GL2 gl, String texname, int texunit)
public void bindTexture(com.jogamp.opengl.GL2 gl, int target, String texname, int texid, int texunit)
public void bindTexture2D(com.jogamp.opengl.GL2 gl, String texname, int texid, int texunit)
public void bindTexture3D(com.jogamp.opengl.GL2 gl, String texname, int texid, int texunit)
public void bindTextureRECT(com.jogamp.opengl.GL2 gl, String texname, int texid, int texunit)
public void loadAndCompileShaders(com.jogamp.opengl.GL2 gl, ShaderFilePair files)
public void loadAndCompileVertexShader(com.jogamp.opengl.GL2 gl, URL fileURL)
public void loadAndCompileVertexShader(com.jogamp.opengl.GL2 gl, InputStream stream)
public void loadAndCompileVertexShader(com.jogamp.opengl.GL2 gl, InputStream stream, URL infoURL)
gl
- stream
- shader source code ressourceinfoURL
- only used as information for warnings if shader does not compile properlypublic void loadAndCompileFragmentShader(com.jogamp.opengl.GL2 gl, URL fileURL)
public void loadAndCompileFragmentShader(com.jogamp.opengl.GL2 gl, InputStream stream)
public void loadAndCompileFragmentShader(com.jogamp.opengl.GL2 gl, InputStream stream, URL infoURL)
public void compileVertexShader(com.jogamp.opengl.GL2 gl, URL infoURL, String content)
public void compileFragmentShader(com.jogamp.opengl.GL2 gl, URL infoURL, String content)
public void verifyShaderCompiled(com.jogamp.opengl.GL2 gl, URL fileURL, int programId, String content)
public void verifyLinkStatus(com.jogamp.opengl.GL2 gl, int programId)
public String readErrors(com.jogamp.opengl.GL2 gl, int iID)
public void validateProgram(com.jogamp.opengl.GL2 gl)
protected void checkShaderLogInfo(com.jogamp.opengl.GL2 inGL, int inShaderObjectID)
protected void warnScript(com.jogamp.opengl.GL2 gl, URL fileURL, String error, int compileStatus, int logLength, String content)
protected void warnLink(com.jogamp.opengl.GL2 gl, String error, int linkStatus, int logLength)
protected void warn(String info, GLSLProgram.GLSLWarnType type)
public Integer getProgramId()
Copyright © 2016. All rights reserved.