LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: coinklepto on November 18, 2021, 01:06:36

Title: Program hangs at glfwCreateWindow
Post by: coinklepto on November 18, 2021, 01:06:36
Hello, I'm trying to write a program that can run on macOS however when it is run it will hang at the call to glfwCreateWindow. I've searched for a solution to this problem and what I saw was to use the -XstartOnFirstThread JVM argument. When I use this it doesn't seem to solve the problem. l'm running the program through a virtual machine, maybe that's causing issues? I'm at a loss for what to do.

import static org.lwjgl.glfw.GLFW.*;
import static org.lwjgl.opengl.GL11.*;
import static org.lwjgl.system.MemoryUtil.NULL;

public class WindowTest {
   
    public static void main(String[] args) {
   
    p("Starting window test!");
   
    if(glfwInit()) {
    p("GLFW initialized successfully!");
    } else {
    p("GLFW initialized unsuccessfully!");
    return;
    }
   
    long window = glfwCreateWindow(640, 480, "WindowTest", NULL, NULL);
   
    if(window == NULL) {
    p("Window is null!");
    } else {
    p("Window created successfully!");
    }
    }
   
    protected static final void p(String str) {
    System.out.println(str);
    }
}