summaryrefslogtreecommitdiff
path: root/src/main/java/net/tylermurphy/Minecraft/Render/Shaders/QuadShader.java
blob: 0424cc3bf812285cf722f86a2e4f981459578940 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package net.tylermurphy.Minecraft.Render.Shaders;

import org.joml.Matrix4f;
import org.joml.Vector4f;

import net.tylermurphy.Minecraft.Render.Util.ShaderProgram;

public class QuadShader extends ShaderProgram{

	private static final String VERTEX_FILE = "Quad_VS.glsl";
	private static final String FRAGMENT_FILE = "Quad_FS.glsl";
	
	private int location_transformationMatrix;
	private int location_color;

	public QuadShader() {
		super(VERTEX_FILE, FRAGMENT_FILE);
	}
	
	public void loadTransformation(Matrix4f matrix){
		super.loadMatrix(location_transformationMatrix, matrix);
	}

	protected void getAllUniformLocations() {
		location_transformationMatrix = super.getUniformLocation("transformationMatrix");
		location_color = super.getUniformLocation("color");
	}

	protected void bindAttributes() {
		super.bindAttribute(0, "position");
	}
	
	public void loadColor(Vector4f color) {
		super.loadVector(location_color, color);
	}

}