Class OGLProgram
java.lang.Object
com.blackrook.gloop.opengl.OGLObject
com.blackrook.gloop.opengl.gl2.OGLProgram
A linked-together shader program pipeline class.
- Author:
- Matthew Tropiano
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAttribute for a shader.static classUniform for a shader. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static int[]List of OpenGL object ids that were not deleted properly.protected static intAmount of OpenGL object ids that were not deleted properly. -
Method Summary
Modifier and TypeMethodDescriptionstatic intDestroys undeleted programs abandoned from destroyed Java objects.voidfinalize()protected voidfree()Destroys this object (deallocates it on OpenAL).getAttribute(int locationId) Gets anOGLProgram.Attributeby its location id.getAttribute(String name) Gets aOGLProgram.Attributeby attribute name.intGets the number of attributes on this program.getLog()Gets the program log after the last attempted link.getUniform(int locationId) Gets aOGLProgram.Uniformby its location id.getUniform(String name) Gets aOGLProgram.Uniformby uniform name.intGets the number of uniforms on this program.booleanisLinked()Gets if this program has been linked yet.Methods inherited from class OGLObject
equals, equals, expand, expand, getLongName, getName, hashCode, isAllocated, setLongName, setName, toString
-
Field Details
-
UNDELETED_IDS
protected static int[] UNDELETED_IDSList of OpenGL object ids that were not deleted properly. -
UNDELETED_LENGTH
protected static int UNDELETED_LENGTHAmount of OpenGL object ids that were not deleted properly.
-
-
Method Details
-
free
-
isLinked
public boolean isLinked()Gets if this program has been linked yet. Some functions can only happen if the program has not been linked yet, for instance, vertex attrib location binding and fragment data location binding.- Returns:
- true if so, false if not.
-
getLog
Gets the program log after the last attempted link.- Returns:
- the log from this program's linking, or null if not linked yet.
-
getUniformCount
public int getUniformCount()Gets the number of uniforms on this program. Only available after linking.- Returns:
- the number of uniforms on this program.
-
getUniform
Gets aOGLProgram.Uniformby its location id. Only available after linking.- Parameters:
locationId- the location id.- Returns:
- the corresponding uniform or null if not found.
-
getUniform
Gets aOGLProgram.Uniformby uniform name. Only available after linking.- Parameters:
name- the uniform name.- Returns:
- the corresponding uniform or null if not found.
-
getAttributeCount
public int getAttributeCount()Gets the number of attributes on this program. Only available after linking.- Returns:
- the number of attributes on this program.
-
getAttribute
Gets anOGLProgram.Attributeby its location id.- Parameters:
locationId- the location id.- Returns:
- the corresponding attribute or null if not found.
-
getAttribute
Gets aOGLProgram.Attributeby attribute name.- Parameters:
name- the attribute name.- Returns:
- the corresponding uniform or null if not found.
-
destroyUndeleted
public static int destroyUndeleted()Destroys undeleted programs abandoned from destroyed Java objects.This is automatically called by OGLSystem after every frame and should NEVER be called manually!
- Returns:
- the amount of objects deleted.
-
finalize
-