cleaning
parent
dd775f6d9c
commit
4bf7a092aa
|
|
@ -2,6 +2,7 @@ package xyz.valnet.engine;
|
|||
|
||||
import static xyz.valnet.engine.util.Math.lerp;
|
||||
|
||||
import xyz.valnet.engine.graphics.Drawing;
|
||||
import xyz.valnet.engine.math.Matrix4f;
|
||||
import xyz.valnet.engine.math.Vector2i;
|
||||
import xyz.valnet.engine.scenegraph.IScene;
|
||||
|
|
@ -29,6 +30,7 @@ public abstract class Game {
|
|||
}
|
||||
|
||||
public void render() {
|
||||
Drawing.setLayer(0);
|
||||
scene.render();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ public class Shader {
|
|||
}
|
||||
|
||||
public int create(String vert, String frag) {
|
||||
int program = glCreateProgram();
|
||||
int program = glCreateProgram();
|
||||
int vertID = glCreateShader(GL_VERTEX_SHADER);
|
||||
int fragID = glCreateShader(GL_FRAGMENT_SHADER);
|
||||
glShaderSource(vertID, vert);
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ public class SimpleShader extends Shader {
|
|||
|
||||
public SimpleShader(String vertPath, String fragPath) {
|
||||
super(vertPath, fragPath);
|
||||
pushColor(Color.white);
|
||||
}
|
||||
|
||||
public void pushColor(Color color) {
|
||||
|
|
|
|||
|
|
@ -2,35 +2,24 @@ package xyz.valnet.hadean;
|
|||
|
||||
import xyz.valnet.engine.App;
|
||||
import xyz.valnet.engine.Game;
|
||||
import xyz.valnet.engine.graphics.Color;
|
||||
import xyz.valnet.engine.graphics.Drawing;
|
||||
import xyz.valnet.engine.math.Matrix4f;
|
||||
import xyz.valnet.hadean.scenes.GameScene;
|
||||
import xyz.valnet.hadean.util.Assets;
|
||||
|
||||
public class HadeanGame extends Game {
|
||||
public static final HadeanGame Hadean = new HadeanGame();
|
||||
public static final HadeanGame HADEAN_GAME = new HadeanGame();
|
||||
|
||||
public static boolean debugView = false;
|
||||
|
||||
public static void main(String[] args) {
|
||||
new App(Hadean).run();
|
||||
new App(HADEAN_GAME).run();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
Assets.flat.pushColor(Color.white);
|
||||
changeScene(new GameScene());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render() {
|
||||
Drawing.setLayer(0);
|
||||
super.render();
|
||||
|
||||
if(!debugView) return;
|
||||
}
|
||||
|
||||
// receive the updated matrix every frame for the actual window.
|
||||
@Override
|
||||
public void updateViewMatrix(Matrix4f matrix) {
|
||||
|
|
|
|||
|
|
@ -64,6 +64,8 @@ public class Assets {
|
|||
flat = new SimpleShader("res/shaders/base.vert", "res/shaders/flat.frag");
|
||||
depth = new SimpleShader("res/shaders/base.vert", "res/shaders/depth.frag");
|
||||
|
||||
flat.enable();
|
||||
|
||||
atlas = new Texture("res/textures.png");
|
||||
|
||||
whiteBox = new Sprite(atlas, 0, 88, 8, 8);
|
||||
|
|
|
|||
Loading…
Reference in New Issue