1
votes

When you try to close a display, generally I use

Mouse.destroy();

Keyboard.destroy();

AL.destroy();

Display.destroy();

System.exit(0);

But now I want to create a new one to replace it. I have a launcher program that has the start button. It runs off of lwjgl. When the user clicks start, it calls the destroy method, but first calls

Display.create()

Theoretically creating one display and closing the other. This instead crashes the Java Runtime Environment and prints an error. I was wondering if there was an already created method for doing this without crashing it, seeing as my method is not working. Here is the error:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x050328e0, pid=3580, tid=5100
#
1

1 Answers

1
votes

The Display class is static.

What you're trying to do is create a class that already exists. If you want a launcher to launch your application, you should make it a completely separate program that launches it or introduce state management to keep track of what menu you are on.