diff --git a/Cherno/src/com/thecherno/cherno/Main.java b/Cherno/src/com/thecherno/cherno/Main.java index 60ab95a..edc6ac0 100644 --- a/Cherno/src/com/thecherno/cherno/Main.java +++ b/Cherno/src/com/thecherno/cherno/Main.java @@ -6,6 +6,7 @@ import com.thecherno.cherno.engine.graphics.Color; import com.thecherno.cherno.engine.graphics.Texture; import com.thecherno.cherno.engine.input.Keyboard; +import com.thecherno.cherno.engine.utils.FileUtils; public class Main extends Cherno { @@ -21,6 +22,7 @@ protected void init() { createDisplay("Cherno 0.1a", 960, 540); setInput(KEYBOARD); start(); + } protected void update() { diff --git a/Cherno/src/com/thecherno/cherno/engine/Cherno.java b/Cherno/src/com/thecherno/cherno/engine/Cherno.java index f117f9e..0baf18e 100644 --- a/Cherno/src/com/thecherno/cherno/engine/Cherno.java +++ b/Cherno/src/com/thecherno/cherno/engine/Cherno.java @@ -39,6 +39,12 @@ protected void createDisplay(String name, int width, int height) { protected void setInput(byte device) { display.enable(device); } + + /** + * Updates Engine + *

+ * Main update loop for the whole engine + */ public void run() { long lastTime = System.nanoTime(); diff --git a/Cherno/src/com/thecherno/cherno/engine/graphics/Display.java b/Cherno/src/com/thecherno/cherno/engine/graphics/Display.java index b643bb8..38fe9d6 100644 --- a/Cherno/src/com/thecherno/cherno/engine/graphics/Display.java +++ b/Cherno/src/com/thecherno/cherno/engine/graphics/Display.java @@ -38,6 +38,12 @@ public void drawImage(BufferedImage image) { g = bs.getDrawGraphics(); g.drawImage(image, 0, 0, window.getWidth(), window.getHeight(), null); } + + /** + * Shows BufferStrategy + *

+ * Disposes of the Graphics and shows the BufferStrategy + */ public void show() { g.dispose(); diff --git a/Cherno/src/com/thecherno/cherno/engine/utils/FileUtils.java b/Cherno/src/com/thecherno/cherno/engine/utils/FileUtils.java index 7051bee..79eaeae 100644 --- a/Cherno/src/com/thecherno/cherno/engine/utils/FileUtils.java +++ b/Cherno/src/com/thecherno/cherno/engine/utils/FileUtils.java @@ -8,6 +8,12 @@ public class FileUtils { private FileUtils() { } + + /** + * Reads Text from a file + *

+ * Takes in text from and loads it in as a string. + */ public static String loadText(String path) { String result = ""; @@ -17,6 +23,7 @@ public static String loadText(String path) { while ((buffer = reader.readLine()) != null) { result += buffer + "\n"; } + reader.close(); } catch (IOException e) { e.printStackTrace(); }