Fullscreen switch: Could not create context

Started by DoubleG, February 18, 2010, 17:16:30

Previous topic - Next topic

DoubleG

Randomly while switching to fullscreen or windowed mode, I've got an LWGJLException inside the Display.create (with LWJGL 2.2.1):
Exception in thread "GL-Thread" org.lwjgl.LWJGLException: Could not create context
at org.lwjgl.opengl.WindowsContextImplementation.nCreate(WindowsContextImplementation.java)
at org.lwjgl.opengl.WindowsContextImplementation.create(WindowsContextImplementation.java:50)
at org.lwjgl.opengl.Context.<init>(Context.java:120)
at org.lwjgl.opengl.Display.create(Display.java:845)
at org.lwjgl.opengl.Display.create(Display.java:771)
at app.WorldView.createDisplay(WorldView.scala:404)
at app.WorldView.createWindowedDisplay(WorldView.scala:354)
at app.WorldView.run(WorldView.scala:171)


The code for switching to fullscreen and in windowed mode is:
Display.destroy();
if (fullscreen) {
  Display.setDisplayModeAndFullscreen(Display.getDesktopDisplayMode());
}
else {
  Display.setFullscreen(false);
  Display.setDisplayMode(Display.getDesktopDisplayMode());
  Display.setParent(canvas);
}
Display.create(new PixelFormat());


I can't find any reference to this bug on this forum (or the web). Did I do something wrong ?

Thanks,

Jérôme