Flywheel/src/main/java/com/jozufozu/flywheel/backend/IShaderContext.java

25 lines
548 B
Java
Raw Normal View History

package com.jozufozu.flywheel.backend;
2021-06-08 03:12:46 +02:00
import java.util.function.Supplier;
import com.jozufozu.flywheel.backend.gl.shader.GlProgram;
import net.minecraft.util.ResourceLocation;
public interface IShaderContext<P extends GlProgram> {
2021-06-08 03:12:46 +02:00
default P getProgram(ResourceLocation loc) {
return this.getProgramSupplier(loc)
.get();
2021-06-08 03:12:46 +02:00
}
Supplier<P> getProgramSupplier(ResourceLocation loc);
/**
* Load all programs associated with this context. This might be just one, if the context is very specialized.
*/
void load();
void delete();
}