Mac bug? Or just his machine?

Started by elias4444, January 08, 2005, 15:47:14

Previous topic - Next topic

elias4444

Here's the output that gregorypierce was kind enough to send me. I'm not quite sure how to handle this one. It could be happening because I call the object from a Swing-based menu (the menu is where I let them setup their display options and the like). It works fine on Windows and Linux however.

Java Web Start 1.4.2_05 Console, started Tue Jan 18 22:20:37 EST 2005
Java 2 Runtime Environment: Version 1.4.2_05 by Apple Computer, Inc.
Java Web Start 1.4.2_05 Console, started Tue Jan 18 22:20:48 EST 2005
Java 2 Runtime Environment: Version 1.4.2_05 by Apple Computer, Inc.
apple.awt.EventQueueExceptionHandler Caught Throwable : java.lang.Error: Cannot call invokeAndWait from the event dispatcher thread
java.lang.Error: Cannot call invokeAndWait from the event dispatcher thread
at java.awt.EventQueue.invokeAndWait(EventQueue.java:817)
at org.lwjgl.opengl.MacOSXFrame.invokeAWT(MacOSXFrame.java:249)
at org.lwjgl.opengl.MacOSXFrame.syncReshape(MacOSXFrame.java:258)
at org.lwjgl.opengl.MacOSXFrame.<init>(MacOSXFrame.java:87)
at org.lwjgl.opengl.MacOSXDisplay.createWindow(MacOSXDisplay.java:79)
at org.lwjgl.opengl.Display.createWindow(Display.java:206)
at org.lwjgl.opengl.Display.create(Display.java:525)
at org.lwjgl.opengl.Display.create(Display.java:499)
at tools.ScreenManager.<init>(ScreenManager.java:101)
at twister2.Twister2.begin(Twister2.java:145)
at mainmenu.MainMenu.actionPerformed(MainMenu.java:229)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1819)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1872)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:247)
at java.awt.Component.processMouseEvent(Component.java:5166)
at java.awt.Component.processEvent(Component.java:4963)
at java.awt.Container.processEvent(Container.java:1613)
at java.awt.Component.dispatchEventImpl(Component.java:3681)
at java.awt.Container.dispatchEventImpl(Container.java:1671)
at java.awt.Component.dispatchEvent(Component.java:3543)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3527)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3242)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3172)
at java.awt.Container.dispatchEventImpl(Container.java:1657)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3543)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:178)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:170)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

elias

Fixed (as stated in gregorys thread). Be careful with calling GL from the AWT thread.

- elias

elias


elias4444

QuoteBe careful with calling GL from the AWT thread.

It seems to make sense for creating a "pre-launch" window however (it's much easier on a system to set the resolution, vsync, etc, before the OpenGL window is created). It gets a little tricky when trying to do it "in-game" (you have to reload all your textures for the new resolution when they switch, and destroy/recreate the OpenGL window on the fly). Is there a better way you would recommend?

In the meantime however, THANK YOU for the fix!!!!  :)
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

elias

You don't have to reload textures, just use Display.setFullscreen() and Display.setDisplayMode() (keep the bit depth though).

- elias

elias4444

If you switch the displaymode (via setDisplayMode) will it automatically switch for you?

Also, if I understand you correctly, one shouldn't switch the color mode then?
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

elias4444

BTW, I tried that download link for the updates, but it comes up empty.
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

elias


elias4444

I've installed the new libraries... now, on all platforms (Mac, Windows, Linux), the OpenGL window just flashes open and then immediately closes.
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

elias

And then what? Exceptions? Native crashes? Or does the program really just continue with no window open?

- elias

elias4444

I've been trying to find out what's going on... I'm not getting any console messages. The java process just sits there as if it's waiting for something.

Maybe I should be a good little programmer and do my menu in-game.  :?:
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

elias

Try sending it a QUIT signal to get it to dump the current threads. It sounds like a deadlock.

Under linux you send it by pressing ctrl-\ in the console)

- elias

elias

There are some minor API changes in the new build, so did you re-compile your game with the new lib too or did you just try an existing version with replaced libs?

- elias

elias4444

I just swapped out the files actually. Are these going to be changes for the next version official as well? Because it looks like it's the keyboard.enablebuffer call.

Here's the output from the QUIT:

Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: org.lwjgl.in put.Keyboard.enableBuffer()V
        at tools.ScreenManager.<init>(ScreenManager.java:137)
        at twister2.Twister2.begin(Twister2.java:146)
        at mainmenu.MainMenu.actionPerformed(MainMenu.java:229)
        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour ce)
        at java.awt.Component.processMouseEvent(Unknown Source)
        at javax.swing.JComponent.processMouseEvent(Unknown Source)
        at java.awt.Component.processEvent(Unknown Source)
        at java.awt.Container.processEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(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)


P.S. I love how I had to use Linux to get the info for you.  :P
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

elias

Yes. Just remove that call, since it's done automatically for you. Same with the Keyboard.enableTranslation() call (if you use that). To be sure, recompile the whole game against the new lib.

- elias