diff --git a/JavaApp/src/main/java/HelloWorld.java b/JavaApp/src/main/java/HelloWorld.java index 8a82f182..ce1a0724 100644 --- a/JavaApp/src/main/java/HelloWorld.java +++ b/JavaApp/src/main/java/HelloWorld.java @@ -15,6 +15,7 @@ public class HelloWorld { // The window handle private long window; + protected boolean noLoop = false; public void run() { System.out.println("Hello LWJGL " + Version.getVersion() + "!"); @@ -107,6 +108,7 @@ public class HelloWorld { // Run the rendering loop until the user has attempted to close // the window or has pressed the ESCAPE key. + if (noLoop) return; while ( !glfwWindowShouldClose(window) ) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // clear the framebuffer diff --git a/JavaApp/src/main/java/HelloWorldNoLoop.java b/JavaApp/src/main/java/HelloWorldNoLoop.java new file mode 100644 index 00000000..9f229960 --- /dev/null +++ b/JavaApp/src/main/java/HelloWorldNoLoop.java @@ -0,0 +1,11 @@ + +public class HelloWorldNoLoop extends HelloWorld { + public HelloWorldNoLoop() { + super(); + noLoop = true; + } + + public static void main(String[] args) { + new HelloWorldNoLoop().run(); + } +}