IShader
interface IShader
Known subtypes: Shader
Package: dev.joid.lib.bridge.render.shader · Module: core · Source: IShader.java
A shader program of the render bridge, with its uniforms and samplers, bound through the render state.
Learn more
Section titled “Learn more”Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
void | delete() abstract | Releases the program and its line variant. |
void | bind() abstract | Makes the shader and its blend state the current ones of the render state. |
void | unbind() abstract | Removes the shader from the render state when it is current, and puts the previous blend state back. |
boolean | isBound() abstract | If true, the shader is bound. |
boolean | isActive() abstract | If true, the shader compiled and can draw; the first call compiles it. |
this | getLineShader() fluent abstract | Returns the variant of the shader that draws wide lines as triangles, with the same uniforms and samplers. |
this | uniform(String name, boolean value) fluent abstract | Sets a bool uniform, sent at the next draw. |
this | uniform(String name, int… values) fluent abstract | Sets an integer uniform or array, sent at the next draw. |
this | uniform(String name, float… values) fluent abstract | Sets a float uniform, vector, matrix or array, sent at the next draw. |
this | sampler(String name, ITexture texture, TextureFilter filter, TextureWrap wrap) fluent abstract | Sets the texture of a sampler, with its filter and wrap. |
Method details
Section titled “Method details”delete
Section titled “delete”void delete() abstract
Releases the program and its line variant.
void bind() abstract
Makes the shader and its blend state the current ones of the render state.
unbind
Section titled “unbind”void unbind() abstract
Removes the shader from the render state when it is current, and puts the previous blend state back.
isBound
Section titled “isBound”boolean isBound() abstract
If true, the shader is bound.
isActive
Section titled “isActive”boolean isActive() abstract
If true, the shader compiled and can draw; the first call compiles it.
getLineShader
Section titled “getLineShader”this getLineShader() fluent abstract
Returns the variant of the shader that draws wide lines as triangles, with the same uniforms and samplers.
uniform
Section titled “uniform”this uniform(String name, boolean value) fluent abstract
Sets a bool uniform, sent at the next draw.
this uniform(String name, int... values) fluent abstract
Sets an integer uniform or array, sent at the next draw.
this uniform(String name, float... values) fluent abstract
Sets a float uniform, vector, matrix or array, sent at the next draw.
sampler
Section titled “sampler”this sampler(String name, ITexture texture, TextureFilter filter, TextureWrap wrap) fluent abstract
Sets the texture of a sampler, with its filter and wrap.
Throws an IllegalArgumentException that lists the samplers when the shader declares no sampler of that name.
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
