I am trying to create a separate thread for LWJGL's Display.update(), but the main thread is sleeping or is stopped while my second thread is running, how can I make both threads execute simultaneously?
public Window(int width, int height, String title){
}
@Override
public void run() {
try {
Display.setDisplayMode(new DisplayMode(800, 600));
Display.create();
} catch (LWJGLException e) {
e.printStackTrace();
}
while(!Display.isCloseRequested()){
Display.update();
Main.Render();
}
Display.destroy();
}
}
public static void main(String[] args) {
//To be moved
Window window = new Window(100, 100, "1");
Thread windowThread = new Thread(window);
windowThread.run();
System.out.print("I am workign, please show me!");
}
public static void Render(){
System.out.println("Hello There!");
}