maze-game/src/maze_game/graphics/GraphicsShader.java

35 lines
575 B
Java

package maze_game.graphics;
import org.lwjgl.opengl.GL33;
import maze_game.helpers.ResourceLoader;
public class GraphicsShader
{
public int program;
public GraphicsShader(String id) {
program = ResourceLoader.loadShader(id);
}
public void use() {
GL33.glUseProgram(program);
}
public void setInt(int v) {
GL33.glUniform1i(program, v);
}
public void setFloat(float v) {
GL33.glUniform1f(program, v);
}
public void setIntv(int[] v) {
GL33.glUniform1iv(program, v);
}
public void setFloatv(float[] v) {
GL33.glUniform1fv(program, v);
}
}