GlShader
final class GlShader
Extends: Shader
Package: dev.joid.base.opengl.render.shader · Module: base-opengl · Source: GlShader.java
Backends: LWJGL 2 LWJGL 3
A shader program of OpenGL, linked from the translation of the two stages of a JOID shader.
Description
Section titled “Description”A compilation or a link error prints the log of the driver and leaves the shader inactive, without throwing.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
GlShader | create(GlRenderBridge bridge, ShaderSource vertex, ShaderSource fragment, BlendState blend) factory | Creates the shader, translated to the dialect of the context with loose uniforms; GlRenderBridge.createShader calls it. |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
void | use(RenderState state, VertexBuffer buffer) | Makes the program current and uploads its built-in uniforms and its uniform values, for a draw with that state and those vertices. |
int | getLocation(String name) | Returns the location of a uniform, cached per name, or -1 when the program has none. |
int | getProgram() | Returns the OpenGL name of the program, 0 once deleted. |
boolean | isProgramActive() | If true, the program compiled and linked. |
Inherited from Shader (18)
bind · unbind · isActive · getLineShader · getSamplerMap · getBlend · getBridge · getVertex · getFragment · getBlock · getTranslation · isBound · isCompiled · getPreviousBlend · delete · uniform · sampler · builtins
Creation details
Section titled “Creation details”create
Section titled “create”GlShader create(GlRenderBridge bridge, ShaderSource vertex, ShaderSource fragment, BlendState blend) factory
Creates the shader, translated to the dialect of the context with loose uniforms; GlRenderBridge.createShader calls it.
Method details
Section titled “Method details”void use(RenderState state, VertexBuffer buffer)
Makes the program current and uploads its built-in uniforms and its uniform values, for a draw with that state and those vertices.
getLocation
Section titled “getLocation”int getLocation(String name)
Returns the location of a uniform, cached per name, or -1 when the program has none.
getProgram
Section titled “getProgram”int getProgram()
Returns the OpenGL name of the program, 0 once deleted.
isProgramActive
Section titled “isProgramActive”boolean isProgramActive()
If true, the program compiled and linked.
fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses
