Skip to content

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.

A compilation or a link error prints the log of the driver and leaves the shader inactive, without throwing.

ReturnsSignatureSummary
GlShadercreate(GlRenderBridge bridge, ShaderSource vertex, ShaderSource fragment, BlendState blend) factoryCreates the shader, translated to the dialect of the context with loose uniforms; GlRenderBridge.createShader calls it.

ReturnsSignatureSummary
voiduse(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.
intgetLocation(String name)Returns the location of a uniform, cached per name, or -1 when the program has none.
intgetProgram()Returns the OpenGL name of the program, 0 once deleted.
booleanisProgramActive()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

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.

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.


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

Report a problem with this page