Package playn.core
Class GLProgram
java.lang.Object
playn.core.GLProgram
- All Implemented Interfaces:
AutoCloseable,Closeable
Encapsulates a GL vertex and fragment shader program pair.
-
Nested Class Summary
Nested classes/interfaces inherited from interface react.Closeable
Closeable.Set, Closeable.Util -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Binds this shader program, in preparation for rendering.voidclose()Frees this program and associated compiled shaders.intgetAttribLocation(String name) Returns the attribute location with the specifiedname.intgetUniformLocation(String name) Returns the uniform location with the specifiedname.
-
Field Details
-
id
public final int idThe GL id of this shader program.
-
-
Constructor Details
-
GLProgram
Compiles and links the shader program described byvertexSourceandfragmentSource.- Throws:
RuntimeException- if the program fails to compile or link.
-
-
Method Details
-
getUniformLocation
Returns the uniform location with the specifiedname. -
getAttribLocation
Returns the attribute location with the specifiedname. -
activate
public void activate()Binds this shader program, in preparation for rendering. -
close
public void close()Frees this program and associated compiled shaders. The program must not be used after closure.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-