@Environment(value=CLIENT) public class JsonGlProgram extends Object implements GlProgram, AutoCloseable
Modifier and Type | Field and Description |
---|---|
private static JsonGlProgram |
activeProgram |
private static int |
activeProgramRef |
private List<Integer> |
attribLocs |
private List<String> |
attribNames |
private GlBlendState |
blendState |
private static Uniform |
dummyUniform |
private GlShader |
fragmentShader |
private static Logger |
LOGGER |
private String |
name |
private int |
programRef |
private Map<String,IntSupplier> |
samplerBinds |
private List<String> |
samplerNames |
private List<Integer> |
samplerShaderLocs |
private Map<String,GlUniform> |
uniformByName |
private List<GlUniform> |
uniformData |
private List<Integer> |
uniformLocs |
private boolean |
uniformStateDirty |
private GlShader |
vertexShader |
Constructor and Description |
---|
JsonGlProgram(ResourceManager resource,
String name) |
Modifier and Type | Method and Description |
---|---|
private void |
addSampler(JsonElement jsonElement) |
private void |
addUniform(JsonElement jsonElement) |
void |
bindSampler(String samplerName,
IntSupplier intSupplier) |
void |
close() |
static GlBlendState |
deserializeBlendState(JsonObject json) |
void |
disable() |
void |
enable() |
private void |
finalizeUniformsAndSamplers() |
GlShader |
getFragmentShader() |
int |
getProgramRef() |
static GlShader |
getShader(ResourceManager resourceManager,
GlShader.Type type,
String name) |
GlUniform |
getUniformByName(String name) |
Uniform |
getUniformByNameOrDummy(String name) |
GlShader |
getVertexShader() |
void |
markUniformsDirty() |
private static final Logger LOGGER
private static final Uniform dummyUniform
private static JsonGlProgram activeProgram
private static int activeProgramRef
private final Map<String,IntSupplier> samplerBinds
private final int programRef
private final String name
private boolean uniformStateDirty
private final GlBlendState blendState
private final GlShader vertexShader
private final GlShader fragmentShader
public JsonGlProgram(ResourceManager resource, String name) throws IOException
IOException
public static GlShader getShader(ResourceManager resourceManager, GlShader.Type type, String name) throws IOException
IOException
public static GlBlendState deserializeBlendState(JsonObject json)
public void close()
close
in interface AutoCloseable
public void disable()
public void enable()
public void markUniformsDirty()
markUniformsDirty
in interface GlProgram
private void finalizeUniformsAndSamplers()
private void addSampler(JsonElement jsonElement)
public void bindSampler(String samplerName, IntSupplier intSupplier)
private void addUniform(JsonElement jsonElement) throws ShaderParseException
ShaderParseException
public GlShader getVertexShader()
getVertexShader
in interface GlProgram
public GlShader getFragmentShader()
getFragmentShader
in interface GlProgram
public int getProgramRef()
getProgramRef
in interface GlProgram