Ginger3D/src/main/java/com/github/hydos/ginger/VulkanStarter.java

60 lines
1.3 KiB
Java

package com.github.hydos.ginger;
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.*;
/** @author hydos06
* the non ARR vulkan test example */
public class VulkanStarter
{
private static class HelloTriangleApplication {
private static final int WIDTH = 800;
private static final int HEIGHT = 600;
// ======= FIELDS ======= //
private long window;
// ======= METHODS ======= //
public void run() {
Window.create(WIDTH, HEIGHT, "V u l k a n", 60, RenderAPI.Vulkan);
initVulkan();
mainLoop();
cleanup();
}
private void initVulkan() {
new GingerVK().start("Vulkan demo");
}
private void mainLoop() {
while(!Window.closed()) {
if(Window.shouldRender()) {
Window.update();
}
}
}
private void cleanup() {
GLFW.glfwDestroyWindow(window);
GLFW.glfwTerminate();
}
}
public static void main(String[] args) {
HelloTriangleApplication app = new HelloTriangleApplication();
app.run();
}
}