2021-06-07 00:46:16 +02:00
|
|
|
package com.jozufozu.flywheel.backend;
|
|
|
|
|
2021-06-08 03:12:46 +02:00
|
|
|
import java.util.function.Supplier;
|
|
|
|
|
2021-06-07 00:46:16 +02:00
|
|
|
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) {
|
2021-06-30 21:43:54 +02:00
|
|
|
return this.getProgramSupplier(loc)
|
|
|
|
.get();
|
2021-06-08 03:12:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
Supplier<P> getProgramSupplier(ResourceLocation loc);
|
2021-06-07 00:46:16 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Load all programs associated with this context. This might be just one, if the context is very specialized.
|
|
|
|
*/
|
|
|
|
void load();
|
|
|
|
|
|
|
|
void delete();
|
|
|
|
}
|