Class ProgramBuilder.Abstract<GL extends OGLGraphics>
java.lang.Object
com.blackrook.gloop.opengl.util.ProgramBuilder.Abstract<GL>
- Type Parameters:
GL- the graphics implementation that this executes on.
- All Implemented Interfaces:
ProgramBuilder
- Enclosing interface:
ProgramBuilder
public abstract static class ProgramBuilder.Abstract<GL extends OGLGraphics>
extends Object
implements ProgramBuilder
Shader builder utility class.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ProgramBuilder
ProgramBuilder.Abstract<GL>, ProgramBuilder.Listener -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ProgramBuilder.Listenerprotected FeedbackBufferTypeprotected String[]protected GLprotected Map<ShaderType, Supplier<String>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionattributeLocation(String attributeName, int locationId) Binds an attribute name to a specific location index.protected final voidfireShaderLog(ShaderType type, String log) Fires a log event to the listener, if attached.fragmentDataLocation(String attributeName, int index) Binds a fragment output attribute name to a specific output color index.setListener(ProgramBuilder.Listener listener) Sets a log listener to listen for builder events.setShader(ShaderType type, File file) Sets a shader program and a shader source.setShader(ShaderType type, File file, Charset encoding) Sets a shader program and a shader source.setShader(ShaderType type, InputStream in) Sets a shader program and a shader source.setShader(ShaderType type, InputStream in, Charset encoding) Sets a shader program and a shader source.setShader(ShaderType type, Reader reader) Sets a shader program and a shader source.setShader(ShaderType type, String source) Sets a shader program and a shader source.setShader(ShaderType type, Supplier<String> source) Sets a shader program and a shader source.transformFeedbackVaryingNames(FeedbackBufferType type, String... variableNames) Sets the transform feedback varying variables for the bound shader program, assuming that what is being built is a "transform feedback"-viable shader program, which entails a vertex shaderMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ProgramBuilder
create
-
Field Details
-
gl
-
attributeLocationBindings
-
fragmentDataBindings
-
feedbackBufferType
-
feedbackVaryingNames
-
shaderPrograms
-
builderListener
-
-
Constructor Details
-
Abstract
Creates a new Shader Builder with defaults set.- Parameters:
gl- the graphics implementation that created this (and will execute this).
-
-
Method Details
-
attributeLocation
Description copied from interface:ProgramBuilderBinds an attribute name to a specific location index.- Specified by:
attributeLocationin interfaceProgramBuilder- Parameters:
attributeName- the attribute name.locationId- the location id.- Returns:
- this builder.
-
fragmentDataLocation
Description copied from interface:ProgramBuilderBinds a fragment output attribute name to a specific output color index.- Specified by:
fragmentDataLocationin interfaceProgramBuilder- Parameters:
attributeName- the attribute name.index- the index.- Returns:
- this builder.
-
transformFeedbackVaryingNames
public ProgramBuilder transformFeedbackVaryingNames(FeedbackBufferType type, String... variableNames) Description copied from interface:ProgramBuilderSets the transform feedback varying variables for the bound shader program, assuming that what is being built is a "transform feedback"-viable shader program, which entails a vertex shader- Specified by:
transformFeedbackVaryingNamesin interfaceProgramBuilder- Parameters:
type- the feedback output type.variableNames- the names of the varying variables.- Returns:
- this builder.
-
setShader
Description copied from interface:ProgramBuilderSets a shader program and a shader source.- Specified by:
setShaderin interfaceProgramBuilder- Parameters:
type- the shader type.file- the source file.- Returns:
- this builder.
-
setShader
Description copied from interface:ProgramBuilderSets a shader program and a shader source.- Specified by:
setShaderin interfaceProgramBuilder- Parameters:
type- the shader type.file- the source file.encoding- the file encoding type.- Returns:
- this builder.
-
setShader
Description copied from interface:ProgramBuilderSets a shader program and a shader source.- Specified by:
setShaderin interfaceProgramBuilder- Parameters:
type- the shader type.in- the input stream to read from.- Returns:
- this builder.
-
setShader
Description copied from interface:ProgramBuilderSets a shader program and a shader source.- Specified by:
setShaderin interfaceProgramBuilder- Parameters:
type- the shader type.in- the input stream to read from.encoding- the file encoding type.- Returns:
- this builder.
-
setShader
Description copied from interface:ProgramBuilderSets a shader program and a shader source.- Specified by:
setShaderin interfaceProgramBuilder- Parameters:
type- the shader type.reader- the reader to read from.- Returns:
- this builder.
-
setShader
Description copied from interface:ProgramBuilderSets a shader program and a shader source.- Specified by:
setShaderin interfaceProgramBuilder- Parameters:
type- the shader type.source- the string that contains the source code.- Returns:
- this builder.
-
setShader
Description copied from interface:ProgramBuilderSets a shader program and a shader source.- Specified by:
setShaderin interfaceProgramBuilder- Parameters:
type- the shader type.source- the source code supplier.- Returns:
- this builder.
-
setListener
Description copied from interface:ProgramBuilderSets a log listener to listen for builder events.- Specified by:
setListenerin interfaceProgramBuilder- Parameters:
listener- the listener to set.- Returns:
- this builder.
-
fireShaderLog
Fires a log event to the listener, if attached.- Parameters:
type- the shader type.log- the shader log.
-