Class ShaderProgram
java.lang.Object
lol.trq.helios.shader.ShaderProgram
- All Implemented Interfaces:
AutoCloseable
A linked program with a uniform location cache. A uniform the driver optimised away resolves to -1 once, is
cached as -1, and setting it does nothing, as in OpenGL.
Setters apply to the program currently in use; bind it first, through a
StateGuard.program(int).
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Deletes the program.intid()Returns the GL program id.intReturns a uniform location, from the cache after the first lookup.name()Returns the name this program was loaded under.voidSets afloatuniform.voidSets amat4uniform.voidSets avec2uniform.voidSets avec4uniform.voidSets anintor sampler uniform.
-
Method Details
-
id
-
name
-
location
Returns a uniform location, from the cache after the first lookup.- Parameters:
uniform- the uniform name- Returns:
- the location, or -1 if the program has no such active uniform
-
set
Sets anintor sampler uniform.- Parameters:
uniform- the namev- the value
-
set
Sets afloatuniform.- Parameters:
uniform- the namev- the value
-
set
Sets avec2uniform.- Parameters:
uniform- the namex- first componenty- second component
-
set
Sets amat4uniform.- Parameters:
uniform- the namem- the matrix, 16 floats column-major
-
set
Sets avec4uniform.- Parameters:
uniform- the namex- first componenty- second componentz- third componentw- fourth component
-
close
-