diff --git a/.classpath b/.classpath index a93fc90..6c19c79 100644 --- a/.classpath +++ b/.classpath @@ -1,6 +1,6 @@ - + @@ -16,18 +16,11 @@ - + - - - - - - - diff --git a/src/main/java/com/github/halotroop/litecraft/Litecraft.java b/src/main/java/com/github/halotroop/litecraft/Litecraft.java index 79e002c..3aa1d67 100644 --- a/src/main/java/com/github/halotroop/litecraft/Litecraft.java +++ b/src/main/java/com/github/halotroop/litecraft/Litecraft.java @@ -21,7 +21,8 @@ import com.github.hydos.ginger.engine.opengl.api.*; import com.github.hydos.ginger.engine.opengl.postprocessing.PostProcessing; import com.github.hydos.ginger.engine.opengl.render.MasterRenderer; import com.github.hydos.ginger.engine.opengl.render.models.GLTexturedModel; -import com.github.hydos.ginger.engine.opengl.utils.GLLoader; +import com.github.hydos.ginger.engine.opengl.utils.*; + import tk.valoeghese.gateways.client.io.*; public class Litecraft extends Game @@ -36,15 +37,19 @@ public class Litecraft extends Game public Vector4i dbgStats = new Vector4i(); private long frameTimer; - public Litecraft() + public Litecraft(int windowWidth, int windowHeight, float frameLimit) { Litecraft.INSTANCE = this; // set constants this.setupConstants(); - this.setupGinger(1280, 720, 60); - Blocks.init(); // make sure blocks are initialised + this.setupGinger(windowWidth, windowHeight, frameLimit); + // make sure blocks are initialised ??? (Currently does nothing) + Blocks.init(); this.frameTimer = System.currentTimeMillis(); - setupKeybinds(); // setup keybinds + // setup keybinds + setupKeybinds(); + // Open the title screen if nothing is already open. + if (GingerRegister.getInstance().currentScreen == null && world == null) ((GingerGL)engine).openScreen(new TitleScreen()); // start the game loop this.engine.startGameLoop(); } @@ -78,9 +83,9 @@ public class Litecraft extends Game // Render shadows GingerRegister.getInstance().masterRenderer.renderShadowMap(data.entities, data.lights.get(0)); // If there's a world, render it! - if (this.world != null) renderWorld(this); + if (this.world != null) renderWorld(); // Render any overlays (GUIs, HUDs) - this.engine.renderOverlays(this); + this.engine.renderOverlays(); // Put what's stored in the inactive framebuffer on the screen Window.swapBuffers(); } @@ -95,15 +100,17 @@ public class Litecraft extends Game this.frameTimer += 1000; } - public void renderWorld(Game game) + public void renderWorld() { - GameData data = game.data; - GingerUtils.preRenderScene(((GingerGL)engine).getRegistry().masterRenderer); - ((GingerGL)engine).contrastFbo.bindFBO(); - ((GingerGL)engine).getRegistry().masterRenderer.renderScene(data.entities, data.normalMapEntities, data.lights, data.camera, data.clippingPlane); - ((GingerGL)engine).contrastFbo.unbindFBO(); - PostProcessing.doPostProcessing(((GingerGL)engine).contrastFbo.colorTexture); - if (data.handleGuis) ((GingerGL)engine).renderOverlays(game); + GameData data = GingerRegister.getInstance().game.data; + if (Window.renderAPI == RenderAPI.OpenGL) + { + GLUtils.preRenderScene(((GingerGL)engine).getRegistry().masterRenderer); + ((GingerGL)engine).contrastFbo.bindFBO(); + ((GingerGL)engine).getRegistry().masterRenderer.renderScene(data.entities, data.normalMapEntities, data.lights, data.camera, data.clippingPlane); + ((GingerGL)engine).contrastFbo.unbindFBO(); + PostProcessing.doPostProcessing(((GingerGL)engine).contrastFbo.colorTexture); + } } public void update() @@ -129,7 +136,7 @@ public class Litecraft extends Game KeyCallbackHandler.trackWindow(Window.getWindow()); MouseCallbackHandler.trackWindow(Window.getWindow()); // set up ginger utilities - GingerUtils.init(); + GLUtils.init(); switch (Window.renderAPI) { @@ -180,15 +187,12 @@ public class Litecraft extends Game @Override public void tick() { - tps += 1; - // Open the title screen if it's not already open. - if (GingerRegister.getInstance().currentScreen == null && world == null) ((GingerGL)engine).openScreen(new TitleScreen()); - + tps += 1; if (this.player instanceof PlayerEntity && camera != null) { Input.invokeAllListeners(); ((PlayerEntity) this.player).updateMovement(); - data.camera.updateMovement(); + camera.updateMovement(); } } diff --git a/src/main/java/com/github/halotroop/litecraft/StarterGL.java b/src/main/java/com/github/halotroop/litecraft/StarterGL.java index 5266289..3b3a30b 100644 --- a/src/main/java/com/github/halotroop/litecraft/StarterGL.java +++ b/src/main/java/com/github/halotroop/litecraft/StarterGL.java @@ -11,6 +11,7 @@ public class StarterGL System.out.println("GLFW version: " + GLFW.glfwGetVersionString()); System.out.println("LWJGL version: " + Version.getVersion()); // Put SoundSystem version here - new Litecraft(); + // TODO: Put a commandline reader here to check for desired width, height, and frame limit! + new Litecraft(1280, 720, 60); } } diff --git a/src/main/java/com/github/halotroop/litecraft/world/World.java b/src/main/java/com/github/halotroop/litecraft/world/World.java index d907db5..e0afe89 100644 --- a/src/main/java/com/github/halotroop/litecraft/world/World.java +++ b/src/main/java/com/github/halotroop/litecraft/world/World.java @@ -178,14 +178,11 @@ public class World implements BlockAccess, WorldGenConstants public void render(BlockRenderer blockRenderer) { blockRenderer.prepareModel(this.dummy.getModel()); - try + this.chunks.forEach((pos, c) -> { - this.chunks.forEach((pos, c) -> c.render(blockRenderer)); - } - catch (NullPointerException e) - { - System.out.println("Null chunk - we should look into fixing this"); - } + if (c != null && c.isFullyGenerated()) + c.render(blockRenderer); + }); blockRenderer.unbindModel(); } diff --git a/src/main/java/com/github/hydos/ginger/VulkanStarter.java b/src/main/java/com/github/hydos/ginger/VulkanStarter.java index dd08e7a..f5b6734 100644 --- a/src/main/java/com/github/hydos/ginger/VulkanStarter.java +++ b/src/main/java/com/github/hydos/ginger/VulkanStarter.java @@ -4,7 +4,7 @@ import org.lwjgl.glfw.GLFW; import com.github.hydos.ginger.engine.common.info.RenderAPI; import com.github.hydos.ginger.engine.common.io.Window; -import com.github.hydos.ginger.engine.vulkan.api.GingerVK; +import com.github.hydos.ginger.engine.vulkan.api.*; /** @author hydos06 * the non ARR vulkan test example */ diff --git a/src/main/java/com/github/hydos/ginger/engine/common/api/GingerEngine.java b/src/main/java/com/github/hydos/ginger/engine/common/api/GingerEngine.java index 59d4b56..88fec91 100644 --- a/src/main/java/com/github/hydos/ginger/engine/common/api/GingerEngine.java +++ b/src/main/java/com/github/hydos/ginger/engine/common/api/GingerEngine.java @@ -1,11 +1,10 @@ package com.github.hydos.ginger.engine.common.api; -import com.github.hydos.ginger.engine.common.api.game.Game; import com.github.hydos.ginger.engine.common.io.Window; import com.github.hydos.ginger.engine.common.screen.Screen; import com.github.hydos.ginger.engine.common.util.Timer; import com.github.hydos.ginger.engine.common.util.Timer.TickListener; -import com.github.hydos.ginger.engine.opengl.api.GingerUtils; +import com.github.hydos.ginger.engine.opengl.utils.GLUtils; public abstract class GingerEngine { @@ -42,7 +41,7 @@ public abstract class GingerEngine // Things that should be run as often as possible, without limits public void update() { - GingerUtils.update(); + GLUtils.update(); Window.update(); } @@ -50,5 +49,5 @@ public abstract class GingerEngine public abstract void openScreen(Screen screen); - public abstract void renderOverlays(Game game); + public abstract void renderOverlays(); } diff --git a/src/main/java/com/github/hydos/ginger/engine/common/api/GingerRegister.java b/src/main/java/com/github/hydos/ginger/engine/common/api/GingerRegister.java index 1b3b3c3..66abd75 100644 --- a/src/main/java/com/github/hydos/ginger/engine/common/api/GingerRegister.java +++ b/src/main/java/com/github/hydos/ginger/engine/common/api/GingerRegister.java @@ -6,7 +6,7 @@ import com.github.hydos.ginger.engine.common.api.game.Game; import com.github.hydos.ginger.engine.common.elements.buttons.TextureButton; import com.github.hydos.ginger.engine.common.font.GUIText; import com.github.hydos.ginger.engine.common.screen.Screen; -import com.github.hydos.ginger.engine.opengl.postprocessing.Fbo; +import com.github.hydos.ginger.engine.opengl.postprocessing.FrameBufferObject; import com.github.hydos.ginger.engine.opengl.render.MasterRenderer; /** Used if a game wants to access engine variables safely */ @@ -20,7 +20,7 @@ public class GingerRegister public List texts; public List guiButtons; - public List fbos; + public List frameBufferObjects; public Game game; public Screen currentScreen; public boolean wireframe = false; diff --git a/src/main/java/com/github/hydos/ginger/engine/common/cameras/Camera.java b/src/main/java/com/github/hydos/ginger/engine/common/cameras/Camera.java index 4f7074e..e85cbbc 100644 --- a/src/main/java/com/github/hydos/ginger/engine/common/cameras/Camera.java +++ b/src/main/java/com/github/hydos/ginger/engine/common/cameras/Camera.java @@ -1,92 +1,20 @@ package com.github.hydos.ginger.engine.common.cameras; import org.joml.Vector3f; -import org.lwjgl.glfw.*; import com.github.hydos.ginger.engine.common.elements.objects.RenderObject; -import com.github.hydos.ginger.engine.common.io.Window; -public class Camera +public abstract class Camera { - private float distanceFromPlayer = 5; - private float angleAroundPlayer = 0; - private Vector3f position = new Vector3f(0, 0, 0); - private float pitch, yaw; - private float roll; public RenderObject player; - - public Camera(RenderObject playerEntity) - { this.player = playerEntity; } - - public Camera(Vector3f vector3f, RenderObject player) - { - this.position = vector3f; - this.player = player; - } - - private void calculateAngleAroundPlayer() - { - if (Window.isMouseDown(1)) - { - float angleChange = (float) (Window.dx * 0.3f); - angleAroundPlayer -= angleChange; - } - } - - private void calculateCameraPosition(float horizDistance, float verticDistance) - { - float theta = player.getRotY() + angleAroundPlayer; - float offsetX = (float) (horizDistance * Math.sin(Math.toRadians(theta))); - float offsetZ = (float) (horizDistance * Math.cos(Math.toRadians(theta))); - position.x = player.getPosition().x - offsetX; - position.z = player.getPosition().z - offsetZ; - position.y = player.getPosition().y + verticDistance; - } - - private float calculateHorizontalDistance() - { - float hD = (float) (distanceFromPlayer * Math.cos(Math.toRadians(pitch))); - if (hD < 0) - hD = 0; - return hD; - } - - private void calculatePitch() - { - if (Window.isMouseDown(1)) - { - float pitchChange = (float) (Window.dy * 0.2f); - pitch += pitchChange; - if (pitch < 0) - { - pitch = 0; - } - else if (pitch > 90) - { pitch = 90; } - } - } - - private float calculateVerticalDistance() - { return (float) (distanceFromPlayer * Math.sin(Math.toRadians(pitch + 4))); } - - private void calculateZoom() - { - GLFW.glfwSetScrollCallback(Window.getWindow(), new GLFWScrollCallback() - { - @Override - public void invoke(long win, double dx, double dy) - { - float zoomLevel = (float) dy * 0.1f; - distanceFromPlayer -= zoomLevel; - } - }); - } - - public float getPitch() - { return pitch; } + private float pitch, yaw, roll; + private Vector3f position = new Vector3f(0, 0, 0); public Vector3f getPosition() { return position; } + + public float getPitch() + { return pitch; } public float getRoll() { return roll; } @@ -97,17 +25,6 @@ public class Camera public void invertPitch() { this.pitch = -pitch; } - public void updateMovement() - { - calculateZoom(); - calculatePitch(); - calculateAngleAroundPlayer(); - float horizontalDistance = calculateHorizontalDistance(); - float verticalDistance = calculateVerticalDistance(); - calculateCameraPosition(horizontalDistance, verticalDistance); - this.yaw = 180 - (player.getRotY() + angleAroundPlayer); - } - public void setPitch(float pitch) { this.pitch = pitch; } @@ -116,4 +33,6 @@ public class Camera public void setRoll(float roll) { this.roll = roll; } + + public abstract void updateMovement(); } diff --git a/src/main/java/com/github/hydos/ginger/engine/common/cameras/FirstPersonCamera.java b/src/main/java/com/github/hydos/ginger/engine/common/cameras/FirstPersonCamera.java index 90127e2..a3b7535 100644 --- a/src/main/java/com/github/hydos/ginger/engine/common/cameras/FirstPersonCamera.java +++ b/src/main/java/com/github/hydos/ginger/engine/common/cameras/FirstPersonCamera.java @@ -13,27 +13,22 @@ public class FirstPersonCamera extends Camera public FirstPersonCamera(RenderObject playerEntity) { - super(playerEntity); + this.player = playerEntity; playerEntity.setVisible(false); } - @Override public float getPitch() { return pitch; } - @Override public Vector3f getPosition() { return position; } - @Override public float getRoll() { return roll; } - @Override public float getYaw() { return yaw; } - @Override public void updateMovement() { position.x = player.getPosition().x; diff --git a/src/main/java/com/github/hydos/ginger/engine/common/cameras/ThirdPersonCamera.java b/src/main/java/com/github/hydos/ginger/engine/common/cameras/ThirdPersonCamera.java new file mode 100644 index 0000000..66f7576 --- /dev/null +++ b/src/main/java/com/github/hydos/ginger/engine/common/cameras/ThirdPersonCamera.java @@ -0,0 +1,85 @@ +package com.github.hydos.ginger.engine.common.cameras; + +import org.lwjgl.glfw.*; + +import com.github.hydos.ginger.engine.common.elements.objects.RenderObject; +import com.github.hydos.ginger.engine.common.io.Window; + +public class ThirdPersonCamera extends Camera +{ + public ThirdPersonCamera(RenderObject playerEntity) + { + this.player = playerEntity; + } + + private float distanceFromPlayer = 5; + private float angleAroundPlayer = 0; + private void calculatePitch() + { + if (Window.isMouseDown(1)) + { + float pitchChange = (float) (Window.dy * 0.2f); + setPitch(getPitch() + pitchChange); + if (getPitch() < 0) + { + setPitch(0); + } + else if (getPitch() > 90) + { setPitch(90); } + } + } + + public void updateMovement() + { + calculateZoom(); + calculatePitch(); + calculateAngleAroundPlayer(); + float horizontalDistance = calculateHorizontalDistance(); + float verticalDistance = calculateVerticalDistance(); + calculateCameraPosition(horizontalDistance, verticalDistance); + this.setYaw(180 - (player.getRotY() + angleAroundPlayer)); + } + + private float calculateHorizontalDistance() + { + float hD = (float) (distanceFromPlayer * Math.cos(Math.toRadians(getPitch()))); + if (hD < 0) + hD = 0; + return hD; + } + + private float calculateVerticalDistance() + { return (float) (distanceFromPlayer * Math.sin(Math.toRadians(getPitch() + 4))); } + + private void calculateZoom() + { + GLFW.glfwSetScrollCallback(Window.getWindow(), new GLFWScrollCallback() + { + @Override + public void invoke(long win, double dx, double dy) + { + float zoomLevel = (float) dy * 0.1f; + distanceFromPlayer -= zoomLevel; + } + }); + } + + private void calculateAngleAroundPlayer() + { + if (Window.isMouseDown(1)) + { + float angleChange = (float) (Window.dx * 0.3f); + angleAroundPlayer -= angleChange; + } + } + + private void calculateCameraPosition(float horizDistance, float verticDistance) + { + float theta = player.getRotY() + angleAroundPlayer; + float offsetX = (float) (horizDistance * Math.sin(Math.toRadians(theta))); + float offsetZ = (float) (horizDistance * Math.cos(Math.toRadians(theta))); + getPosition().x = player.getPosition().x - offsetX; + getPosition().z = player.getPosition().z - offsetZ; + getPosition().y = player.getPosition().y + verticDistance; + } +} diff --git a/src/main/java/com/github/hydos/ginger/engine/common/fbo/FboCallbackHandler.java b/src/main/java/com/github/hydos/ginger/engine/common/fbo/FBOCallbackHandler.java similarity index 78% rename from src/main/java/com/github/hydos/ginger/engine/common/fbo/FboCallbackHandler.java rename to src/main/java/com/github/hydos/ginger/engine/common/fbo/FBOCallbackHandler.java index 8281895..d6bd767 100644 --- a/src/main/java/com/github/hydos/ginger/engine/common/fbo/FboCallbackHandler.java +++ b/src/main/java/com/github/hydos/ginger/engine/common/fbo/FBOCallbackHandler.java @@ -1,6 +1,6 @@ package com.github.hydos.ginger.engine.common.fbo; -public abstract class FboCallbackHandler +public abstract class FBOCallbackHandler { public void cleanUp() {} diff --git a/src/main/java/com/github/hydos/ginger/engine/common/io/Window.java b/src/main/java/com/github/hydos/ginger/engine/common/io/Window.java index 0883a2f..c6d54bb 100644 --- a/src/main/java/com/github/hydos/ginger/engine/common/io/Window.java +++ b/src/main/java/com/github/hydos/ginger/engine/common/io/Window.java @@ -48,7 +48,7 @@ public class Window static double newY = 0; public static GLCapabilities glContext; public static int actualWidth, actualHeight; - //temp stuff to test out fbo fixes + // FIXME: temp stuff to test out FBO fixes private static int oldWindowWidth = Window.getWidth(); private static int oldWindowHeight = Window.getHeight(); diff --git a/src/main/java/com/github/hydos/ginger/engine/common/obj/shapes/StaticCube.java b/src/main/java/com/github/hydos/ginger/engine/common/obj/shapes/StaticCube.java index c04afff..b9ff4b3 100644 --- a/src/main/java/com/github/hydos/ginger/engine/common/obj/shapes/StaticCube.java +++ b/src/main/java/com/github/hydos/ginger/engine/common/obj/shapes/StaticCube.java @@ -83,8 +83,7 @@ public class StaticCube public static Mesh getCube() { - if (mesh == null) - { mesh = new Mesh(vertices, textureCoords, new float[vertices.length], indices, vertices.length); } + if (mesh == null) mesh = new Mesh(vertices, textureCoords, new float[vertices.length], indices, vertices.length); return mesh; } } diff --git a/src/main/java/com/github/hydos/ginger/engine/opengl/api/GingerGL.java b/src/main/java/com/github/hydos/ginger/engine/opengl/api/GingerGL.java index 89fd60b..51d17c9 100644 --- a/src/main/java/com/github/hydos/ginger/engine/opengl/api/GingerGL.java +++ b/src/main/java/com/github/hydos/ginger/engine/opengl/api/GingerGL.java @@ -19,7 +19,7 @@ public class GingerGL extends GingerEngine { public MousePicker picker; public FontType globalFont; - public Fbo contrastFbo; + public FrameBufferObject contrastFbo; public void cleanup() { @@ -60,9 +60,9 @@ public class GingerGL extends GingerEngine return text; } - public void renderOverlays(Game game) + public void renderOverlays() { - getRegistry().masterRenderer.renderGuis(game.data.guis); + getRegistry().masterRenderer.renderGuis(getRegistry().game.data.guis); if (getRegistry().currentScreen != null) getRegistry().masterRenderer.renderGuis(getRegistry().currentScreen.elements); TextMaster.render(); } @@ -77,7 +77,7 @@ public class GingerGL extends GingerEngine getRegistry().registerGame(game); timer = new Timer(game.data.tickSpeed); timer.addTickListener(gameTickListener); - contrastFbo = new Fbo(new ContrastChanger()); + contrastFbo = new FrameBufferObject(new ContrastChanger()); getRegistry().masterRenderer = masterRenderer; picker = new MousePicker(game.data.camera, masterRenderer.getProjectionMatrix()); PostProcessing.init(); diff --git a/src/main/java/com/github/hydos/ginger/engine/opengl/postprocessing/ContrastChanger.java b/src/main/java/com/github/hydos/ginger/engine/opengl/postprocessing/ContrastChanger.java index 1e8b5bd..e6b4abd 100644 --- a/src/main/java/com/github/hydos/ginger/engine/opengl/postprocessing/ContrastChanger.java +++ b/src/main/java/com/github/hydos/ginger/engine/opengl/postprocessing/ContrastChanger.java @@ -2,9 +2,9 @@ package com.github.hydos.ginger.engine.opengl.postprocessing; import org.lwjgl.opengl.*; -import com.github.hydos.ginger.engine.common.fbo.FboCallbackHandler; +import com.github.hydos.ginger.engine.common.fbo.FBOCallbackHandler; -public class ContrastChanger extends FboCallbackHandler +public class ContrastChanger extends FBOCallbackHandler { private ImageRenderer renderer; private ContrastShader shader; diff --git a/src/main/java/com/github/hydos/ginger/engine/opengl/postprocessing/Fbo.java b/src/main/java/com/github/hydos/ginger/engine/opengl/postprocessing/FrameBufferObject.java similarity index 95% rename from src/main/java/com/github/hydos/ginger/engine/opengl/postprocessing/Fbo.java rename to src/main/java/com/github/hydos/ginger/engine/opengl/postprocessing/FrameBufferObject.java index 38bd3de..69bd897 100644 --- a/src/main/java/com/github/hydos/ginger/engine/opengl/postprocessing/Fbo.java +++ b/src/main/java/com/github/hydos/ginger/engine/opengl/postprocessing/FrameBufferObject.java @@ -8,10 +8,10 @@ import java.nio.ByteBuffer; import org.lwjgl.glfw.*; import org.lwjgl.system.Callback; -import com.github.hydos.ginger.engine.common.fbo.FboCallbackHandler; +import com.github.hydos.ginger.engine.common.fbo.FBOCallbackHandler; import com.github.hydos.ginger.engine.common.io.Window; -public class Fbo +public class FrameBufferObject { long window; int width = 1024; @@ -20,7 +20,7 @@ public class Fbo boolean destroyed; Object lock = new Object(); /* cool ginger feature which handles fbos once they need to be rendered */ - public FboCallbackHandler handler; + public FBOCallbackHandler handler; /* Multisampled FBO objects */ public int multisampledColorRenderBuffer; int multisampledDepthRenderBuffer; @@ -34,7 +34,7 @@ public class Fbo GLFWFramebufferSizeCallback fbCallback; Callback debugProc; - public Fbo(FboCallbackHandler handler) + public FrameBufferObject(FBOCallbackHandler handler) { this.handler = handler; this.window = Window.getWindow(); diff --git a/src/main/java/com/github/hydos/ginger/engine/opengl/postprocessing/ImageRenderer.java b/src/main/java/com/github/hydos/ginger/engine/opengl/postprocessing/ImageRenderer.java index d4cf3c0..2459452 100644 --- a/src/main/java/com/github/hydos/ginger/engine/opengl/postprocessing/ImageRenderer.java +++ b/src/main/java/com/github/hydos/ginger/engine/opengl/postprocessing/ImageRenderer.java @@ -4,27 +4,27 @@ import org.lwjgl.opengl.GL11; public class ImageRenderer { - private Fbo fbo; + private FrameBufferObject frameBufferObject; protected ImageRenderer() {} protected ImageRenderer(int width, int height) - { this.fbo = new Fbo(new ContrastChanger()); } + { this.frameBufferObject = new FrameBufferObject(new ContrastChanger()); } protected void cleanUp() {} protected int getOutputTexture() - { return fbo.colorTexture; } + { return frameBufferObject.colorTexture; } protected void renderQuad() { - if (fbo != null) - { fbo.bindFBO(); } + if (frameBufferObject != null) + { frameBufferObject.bindFBO(); } GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); GL11.glDrawArrays(GL11.GL_TRIANGLE_STRIP, 0, 4); - if (fbo != null) - { fbo.unbindFBO(); } + if (frameBufferObject != null) + { frameBufferObject.unbindFBO(); } } } diff --git a/src/main/java/com/github/hydos/ginger/engine/opengl/api/GingerUtils.java b/src/main/java/com/github/hydos/ginger/engine/opengl/utils/GLUtils.java similarity index 93% rename from src/main/java/com/github/hydos/ginger/engine/opengl/api/GingerUtils.java rename to src/main/java/com/github/hydos/ginger/engine/opengl/utils/GLUtils.java index 460c4ec..bf04320 100644 --- a/src/main/java/com/github/hydos/ginger/engine/opengl/api/GingerUtils.java +++ b/src/main/java/com/github/hydos/ginger/engine/opengl/utils/GLUtils.java @@ -1,4 +1,4 @@ -package com.github.hydos.ginger.engine.opengl.api; +package com.github.hydos.ginger.engine.opengl.utils; import com.github.hydos.ginger.engine.common.font.TextMaster; import com.github.hydos.ginger.engine.common.obj.ModelLoader; @@ -7,7 +7,7 @@ import com.github.hydos.ginger.engine.opengl.render.MasterRenderer; import com.github.hydos.ginger.engine.opengl.render.models.*; import com.github.hydos.ginger.engine.opengl.render.texture.ModelTexture; -public class GingerUtils +public class GLUtils { public static GLTexturedModel createTexturedModel(String texturePath, String modelPath) { diff --git a/src/main/java/com/github/hydos/ginger/engine/vulkan/api/GingerVK.java b/src/main/java/com/github/hydos/ginger/engine/vulkan/api/GingerVK.java index aedc41f..0ed1cde 100644 --- a/src/main/java/com/github/hydos/ginger/engine/vulkan/api/GingerVK.java +++ b/src/main/java/com/github/hydos/ginger/engine/vulkan/api/GingerVK.java @@ -1,18 +1,17 @@ package com.github.hydos.ginger.engine.vulkan.api; -import com.github.hydos.ginger.engine.vulkan.io.VkWindow; + +import com.github.hydos.ginger.engine.vulkan.io.VKWindow; import com.github.hydos.ginger.engine.vulkan.utils.VKUtils; public class GingerVK { - - public void start(String gameName) { + public void start(String gameName) + { System.out.println("Game " + gameName + " successfuly started in Vulkan mode."); VKUtils.createInstance(); - VkWindow.createSurface(); + VKWindow.createSurface(); VKUtils.createPhysicalDevice(); VKUtils.createLogicalDevice(); } - - } diff --git a/src/main/java/com/github/hydos/ginger/engine/vulkan/io/VkWindow.java b/src/main/java/com/github/hydos/ginger/engine/vulkan/io/VKWindow.java similarity index 91% rename from src/main/java/com/github/hydos/ginger/engine/vulkan/io/VkWindow.java rename to src/main/java/com/github/hydos/ginger/engine/vulkan/io/VKWindow.java index f8155ee..202d35e 100644 --- a/src/main/java/com/github/hydos/ginger/engine/vulkan/io/VkWindow.java +++ b/src/main/java/com/github/hydos/ginger/engine/vulkan/io/VKWindow.java @@ -8,14 +8,13 @@ import org.lwjgl.vulkan.VK12; import com.github.hydos.ginger.engine.common.io.Window; import com.github.hydos.ginger.engine.vulkan.VKConstants; -import com.github.hydos.ginger.engine.vulkan.utils.VKUtils; +import com.github.hydos.ginger.engine.vulkan.utils.*; /** * used for window related vulkan only things * @author hydos - * */ -public class VkWindow +public class VKWindow { public static void createSurface() {