Platform collision works
This commit is contained in:
parent
814f49fd4b
commit
5fd4389d1b
14 changed files with 1003 additions and 833 deletions
|
@ -1,25 +1,37 @@
|
|||
package com.gnarwhal.ld46.engine.shaders;
|
||||
|
||||
import org.joml.Vector2f;
|
||||
import org.joml.Vector3f;
|
||||
|
||||
import static org.lwjgl.opengl.GL20.glGetUniformLocation;
|
||||
import static org.lwjgl.opengl.GL20.glUniform4f;
|
||||
import static org.lwjgl.opengl.GL20.*;
|
||||
|
||||
public class Shader2t extends Shader {
|
||||
public class Shader2e extends Shader {
|
||||
|
||||
private int subtextureLoc;
|
||||
private int colorLoc;
|
||||
private int timeLoc;
|
||||
|
||||
public Shader2t() {
|
||||
super("res/shaders/s2t/vert.gls", "res/shaders/s2t/frag.gls");
|
||||
public Shader2e() {
|
||||
super("res/shaders/s2e/vert.gls", "res/shaders/s2e/frag.gls");
|
||||
getUniforms();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void getUniforms() {
|
||||
subtextureLoc = glGetUniformLocation(program, "subtexture");
|
||||
colorLoc = glGetUniformLocation(program, "iColor");
|
||||
timeLoc = glGetUniformLocation(program, "time");
|
||||
}
|
||||
|
||||
public void setSubtexture(Vector2f position, Vector2f dimensions) {
|
||||
glUniform4f(subtextureLoc, position.x, position.y, dimensions.x, dimensions.y);
|
||||
}
|
||||
|
||||
public void setColor(Vector3f color) {
|
||||
glUniform3f(colorLoc, color.x, color.y, color.z);
|
||||
}
|
||||
|
||||
public void setTime(float time) {
|
||||
glUniform1f(timeLoc, time);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue