IllegalStateException: Mouse must be created.

Started by emanon, March 24, 2008, 23:30:14

Previous topic - Next topic

emanon

Hi all.

When trying to create an lwjgl binding with the following line.
disp = new Display(new LWJGLBinding());

This line throws the title exception.  More completely:
SEVERE: Exception
java.lang.IllegalStateException: Mouse must be created.
   at org.lwjgl.input.Cursor.getMaxCursorSize(Cursor.java:137)
   at org.fenggui.render.lwjgl.LWJGLCursorFactory.<init>(Unknown Source)
   at org.fenggui.render.lwjgl.LWJGLBinding.<init>(Unknown Source)
   at org.fenggui.render.lwjgl.LWJGLBinding.<init>(Unknown Source)
   at myjme.Demo.FengGUIGameState.buildUI(FengGUIGameState.java:56)
   at myjme.Demo.FengGUIGameState.<init>(FengGUIGameState.java:48)
   at myjme.Demo.StationAlphaMain.simpleAppletSetup(StationAlphaMain.java:180)
   at myjme.Demo.DEBaseApplet$SimpleAppletCanvasImplementor.simpleSetup(DEBaseApplet.java:383)
   at com.jmex.awt.SimpleCanvasImpl.doSetup(Unknown Source)
   at com.jmex.awt.lwjgl.LWJGLCanvas.paintGL(Unknown Source)
   at org.lwjgl.opengl.AWTGLCanvas.paint(AWTGLCanvas.java:308)
   at org.lwjgl.opengl.AWTGLCanvas.update(AWTGLCanvas.java:339)
   at sun.awt.RepaintArea.updateComponent(Unknown Source)
   at sun.awt.RepaintArea.paint(Unknown Source)
   at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)


I tried the obvious call Mouse.create() before trying to create the display.
This throws an exception complaining about no display.

Any thoughts on how to solve this?

Thanks in advance.

emanon

I'm not there yet, but after much head spinning from similarly named classes I can contribute something that hopefully someone with more engine familiarity can suggest a workaround for.

I'm running inside an APPLET.
As a result of this, an AWTGLCanvas is created rather than a window.
It appears that LWJGL only registers the display system as being built if a window is created.  (lwjgl.Display.isCreated()  tests against the var window_created).

Thus, when trying to create the LWJGLBinding, everything fubars (since Display.create has not happened).


Cross posting to jme and fenggui.
Thanks for ideas.


Fool Running

Wrong forum, by the way. But I happen to know the answer to your question ;D:
You need to use the AWTGLCanvasBinding instead of the LWJGLBinding.
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

emanon