diff --git a/bin/bz/bronze/latte/engine/io/Window.class b/bin/bz/bronze/latte/engine/io/Window.class index 9b497ad..a32f83e 100644 Binary files a/bin/bz/bronze/latte/engine/io/Window.class and b/bin/bz/bronze/latte/engine/io/Window.class differ diff --git a/bin/bz/bronze/latte/main/Game.class b/bin/bz/bronze/latte/main/Game.class index bfba1b8..57bb2d0 100644 Binary files a/bin/bz/bronze/latte/main/Game.class and b/bin/bz/bronze/latte/main/Game.class differ diff --git a/bin/bz/bronze/latte/main/Main.class b/bin/bz/bronze/latte/main/Main.class index d5b846d..6abf324 100644 Binary files a/bin/bz/bronze/latte/main/Main.class and b/bin/bz/bronze/latte/main/Main.class differ diff --git a/src/bz/bronze/latte/engine/io/Window.java b/src/bz/bronze/latte/engine/io/Window.java index a95c47a..2b7a040 100644 --- a/src/bz/bronze/latte/engine/io/Window.java +++ b/src/bz/bronze/latte/engine/io/Window.java @@ -15,8 +15,6 @@ public class Window { private static float backgroundR, backgroundG, backgroundB; - private static boolean isInitialized; - public void setBackgroundColor(float r, float g, float b) { backgroundR = r; backgroundG = g; @@ -32,10 +30,8 @@ public class Window { } public static void update() { - if (isInitialized) { - GL11.glClearColor(backgroundR, backgroundG, backgroundB, 1.0f); - GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); - } + GL11.glClearColor(backgroundR, backgroundG, backgroundB, 1.0f); + GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); GLFW.glfwPollEvents(); @@ -84,8 +80,6 @@ public class Window { GLFW.glfwSwapInterval(2); Window.time = System.currentTimeMillis(); - - isInitialized = true; } public Window(int width, int height, String title) { diff --git a/src/bz/bronze/latte/main/Game.java b/src/bz/bronze/latte/main/Game.java index 2cbbfbb..c24ee51 100644 --- a/src/bz/bronze/latte/main/Game.java +++ b/src/bz/bronze/latte/main/Game.java @@ -6,6 +6,11 @@ import bz.bronze.latte.engine.io.Input; import bz.bronze.latte.engine.io.Window; public class Game implements Runnable { + public static Window window; + + public static final int width = 800, height = 600; + public static final String title = "latte | v0.01"; + private void update() { Window.update(); @@ -17,6 +22,11 @@ public class Game implements Runnable { } public void run() { + window = new Window(width, height, title); + + window.create(); + window.setBackgroundColor(1.0f, 0, 0); + while (!Window.shouldClose()) { update(); render(); diff --git a/src/bz/bronze/latte/main/Main.java b/src/bz/bronze/latte/main/Main.java index 81b697f..ebba449 100644 --- a/src/bz/bronze/latte/main/Main.java +++ b/src/bz/bronze/latte/main/Main.java @@ -1,23 +1,11 @@ package bz.bronze.latte.main; -import bz.bronze.latte.engine.io.Window; - public class Main { public static Thread game; - public static Window window; - - public static final int width = 800, height = 600; - public static final String title = "latte | v0.01"; - public static void init() { game = new Thread(new Game(), "game"); - window = new Window(width, height, title); - game.start(); - window.create(); - - window.setBackgroundColor(1.0f, 0, 0); } public static void main(String[] args) {