Skip to content

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.

ReturnsSignatureSummary
voiddelete() abstractReleases the program and its line variant.
voidbind() abstractMakes the shader and its blend state the current ones of the render state.
voidunbind() abstractRemoves the shader from the render state when it is current, and puts the previous blend state back.
booleanisBound() abstractIf true, the shader is bound.
booleanisActive() abstractIf true, the shader compiled and can draw; the first call compiles it.
thisgetLineShader() fluent abstractReturns the variant of the shader that draws wide lines as triangles, with the same uniforms and samplers.
thisuniform(String name, boolean value) fluent abstractSets a bool uniform, sent at the next draw.
thisuniform(String name, int… values) fluent abstractSets an integer uniform or array, sent at the next draw.
thisuniform(String name, float… values) fluent abstractSets a float uniform, vector, matrix or array, sent at the next draw.
thissampler(String name, ITexture texture, TextureFilter filter, TextureWrap wrap) fluent abstractSets the texture of a sampler, with its filter and wrap.

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. 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

Report a problem with this page