Crazy OpenGL Issues

So I am thoroughly confused… I have been having the following issues:

Often when I call [icode]Display.destroy()[/icode] it throws an [icode]IllegalStateException[/icode]. Minor

My computer gets locked up once or twice per day on my coding days, and I have to restart (issue?) And I had the WEIRDEST issue! My computer locked up, then went blank, and then the resolution changed from 1600x900 to 900x900 for NO REASON. MAJOR

I had to log off and then it fixed itself.

Any ways to fix this? I don’t know how to reproduce it, so… yeah.

CopyableCougar4

Here’s what happens after [icode]Display.destroy()[/icode]


Exception in thread "Rendering" java.lang.IllegalStateException: Shutdown in progress
	at java.lang.ApplicationShutdownHooks.remove(Unknown Source)
	at java.lang.Runtime.removeShutdownHook(Unknown Source)
	at org.lwjgl.opengl.Display$3.run(Display.java:712)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.lwjgl.opengl.Display.removeShutdownHook(Display.java:710)
	at org.lwjgl.opengl.Display.access$800(Display.java:65)
	at org.lwjgl.opengl.Display$5.destroy(Display.java:839)
	at org.lwjgl.opengl.Display.destroy(Display.java:1095)
	at game.core.Renderer$1.run(Renderer.java:74)

CopyableCougar4

my guess is you’re shutting down too fast, maybe you need a gradeful shutdown.

one way to do it is a daemon thread just sleeping for a sec. added here : http://docs.oracle.com/javase/7/docs/api/java/lang/Runtime.html#addShutdownHook(java.lang.Thread)

one way to test if you’re shutting down is

public static boolean isShutdownSequence()
{
  try
  {
    Runtime.getRuntime().removeShutdownHook(null);
  }
  catch(IllegalStateException ex)
  {
    return true;
  }
  catch(NullPointerException ignored){}

  return false;
}

http://docs.oracle.com/javase/7/docs/api/java/lang/Runtime.html#exit(int)

[quote]Terminates the currently running Java virtual machine by initiating its shutdown sequence
[/quote]

I appreciate the help :slight_smile:

Does anybody know why my screen resolution got screwed?

CopyableCougar4

900 by 900, never seen that :o

[quote=“basil,post:3,topic:50952”]
i dont think that will actually help.

Maybe a hardware problem with your graphics card or motherboard or maybe with a certain driver? Beyond that its hard to tell without more information (such as knowing how to reproduce the issue).

Next time it happens make sure to note what you do the moment it occurs and try repeating that. If you are able to reproduce it multiple times using the same method, that should indicate where the issue is coming from.

When I said I don’t know how to reproduce it, I know up to a point.

Steps:

  • Run my opengl project
  • Opengl project locks up (possible cpu locking up?)
  • I click a couple times, get ready to do a hard reboot
  • … This is the part I don’t understand
  • Screen goes blank
  • Reappears with screwed up resolution
  • I log out
  • Resolution becomes normal