-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jme3test.app.TestApplication hangs with LWJGL3 #1193
Comments
Observed similar behaviour on Linux. |
I get the same result here on Linux. Curiosity struck so here's an analysis. TLDR: It seems to me the test is incompatible with the way the LWJGL3 context class works (LwjglWindow.java). LWJGL2 creates a separate thread for rendering loop, 3 uses the current That's probably all that's needed, but here's my original verbose version: This test expects the current thread to be allowed to continue after calling start() (which eventually calls context.create()). That's fine for LWJGL2, which looks like this (see: LwjglDisplay.java):
But with LWJGL3 this is what it does (see: LwjglWindow.java):
That run() never lets the current thread continue on (rendering loop), so the test gets stuck. Closing the window I guess kills the context or something, and apparently breaks it out of the loop in run(). Fullscreen there's no window to close, so it gets "stuck". So I think due to the way the context classes work, I would say this test is just fundamentally incompatible with LWJGL3. If the test can be made specific to an LWJGL version, I would say this should be a test for 2 only. |
Just to see what happens I tried having the LWJGL3 class create a new thread like 2 does, it passes the test and seems to work fine (Linux). I see the "required for Mac" comment... wouldn't be hard to do an OS-specific if so that it behaves the same with other OSes. But just to make the test pass, I'm going to assume that's not worth doing. But I guess that Mac hack is really why the test fails. |
This is a manifestation of yet another problem with LWJGL3. You even need some weird jvm launch argument for mac os, so I guess even with that hack the test would fail. |
Found something riccardobl@0763be5 |
Transitioning the Engine to LWJGL3 should be one of the goals of the 3.3.0 release. I'm not convinced LWJGL3 needs its own milestone; perhaps a GitHub label would make more sense. A GitHub issue or pull request can only have at most one milestone, but it can have many labels. |
Yeah there's definitely some work before v3 compatibility is on par wth v2. That settings dialog patch may work fine for pre-Java 9 but I have strong doubts it'd be future proof, since it uses stuff like sun.awt.SunToolkit, all that Sun stuff is supposed to be private API. It's a shame there doesn't seem to be much interest in introducing a JavaFX dependency and dropping Swing, it might be a fun mini-project to rebuild the whole dialog with JFX, and try to knock that kind of issue out at the same time. Edit: Just in case it matters at some point, just realized there's also LwjglWindowVR.java which also will hijack the test thread like LWJGL3 does. |
I believe this is related to #1048 |
Just confirmed that the issue is still present in v3.4.0-beta4. |
LWJGL3-JME library would block the current thread when executing LWJGL3. Instead of calling run() that is blocking, made it work like LWJGL2-JME library when they start it as a thread so run gets called. I commented out the run() function and replaced it with Thread.start().
LWJGL3-JME projects was doing a call that is blocking the current thread. I changed it to match how LWJGL2-JME project launches the Context Window.
LWJGL3-JME projects was doing a call that is blocking the current thread. I changed it to match how LWJGL2-JME project launches the Context Window.
LWJGL3-JME projects was doing a call that is blocking the current thread. I changed it to match how LWJGL2-JME project launches the Context Window.
* This is a very simple addition. It allows a person to set 3 variables in AppSettings. ‘CenterWindow’, ‘WindowXPosition’ and ‘WindowYPosition’ variables. This way these variable will be saved in the profile when the profile is saved, and be reloaded. I added ‘CenterWindow’ to be added with a ‘true’ value for the default value so it will run just like it did before. But if you set ‘CenterWindow’ to ‘false’ then inside LwjglWindow.java (lwjgl3 code) it will look at these new values, it will determine to center the window or use the position values to place the window back at the location the user last moved it to. Of course, these values are only updated if the “program” updates this value. So if you want to save screen position, you can save them on closing to and on restart put the window back into the same location. * formatting and comments changes. * jme3test.app.TestApplication hangs with LWJGL3 #1193 LWJGL3-JME library would block the current thread when executing LWJGL3. Instead of calling run() that is blocking, made it work like LWJGL2-JME library when they start it as a thread so run gets called. I commented out the run() function and replaced it with Thread.start(). * removing unwanted changes, since you can't do multiple pull requests at once. * formatting issues. * changed parameter naming to be more consistency with other items. * jme3test.app.TestApplication hangs with LWJGL3 #1193 LWJGL3-JME projects was doing a call that is blocking the current thread. I changed it to match how LWJGL2-JME project launches the Context Window. * jme3test.app.TestApplication hangs with LWJGL3 #1193 (#3) LWJGL3-JME projects was doing a call that is blocking the current thread. I changed it to match how LWJGL2-JME project launches the Context Window. * removing unwanted changes. * AppSettings: enhance the new javadoc * AppSettings: capitalize Window{X/Y}Position consistent w/other settings * LwjglWindow: convert tabs to spaces * AppSettings: re-arrange @see tags in javadoc Co-authored-by: Stephen Gold <sgold@sonic.net>
…TestApplication hangs with LWJGL3 jMonkeyEngine#1193 Made LWJGL3-JME to launch in the same way the LWJGL2-JME launches. This always Windows and Linux to run, still needs testing on Max OS X
…estApplication hangs with LWJGL3 jMonkeyEngine#1193 Made LWJGL3-JME to launch in the same way the LWJGL2-JME launches. This always Windows and Linux to run, still needs testing on Max OS X
* This is a very simple addition. It allows a person to set 3 variables in AppSettings. ‘CenterWindow’, ‘WindowXPosition’ and ‘WindowYPosition’ variables. This way these variable will be saved in the profile when the profile is saved, and be reloaded. I added ‘CenterWindow’ to be added with a ‘true’ value for the default value so it will run just like it did before. But if you set ‘CenterWindow’ to ‘false’ then inside LwjglWindow.java (lwjgl3 code) it will look at these new values, it will determine to center the window or use the position values to place the window back at the location the user last moved it to. Of course, these values are only updated if the “program” updates this value. So if you want to save screen position, you can save them on closing to and on restart put the window back into the same location. * formatting and comments changes. * jme3test.app.TestApplication hangs with LWJGL3 #1193 LWJGL3-JME library would block the current thread when executing LWJGL3. Instead of calling run() that is blocking, made it work like LWJGL2-JME library when they start it as a thread so run gets called. I commented out the run() function and replaced it with Thread.start(). * removing unwanted changes, since you can't do multiple pull requests at once. * formatting issues. * changed parameter naming to be more consistency with other items. * jme3test.app.TestApplication hangs with LWJGL3 #1193 LWJGL3-JME projects was doing a call that is blocking the current thread. I changed it to match how LWJGL2-JME project launches the Context Window. * jme3test.app.TestApplication hangs with LWJGL3 #1193 (#3) LWJGL3-JME projects was doing a call that is blocking the current thread. I changed it to match how LWJGL2-JME project launches the Context Window. * removing unwanted changes. * AppSettings: enhance the new javadoc * AppSettings: capitalize Window{X/Y}Position consistent w/other settings * LwjglWindow: convert tabs to spaces * AppSettings: re-arrange @see tags in javadoc * TestAWTPanels hangs with LWJGL v3 #1558 / jme3test.app.TestApplication hangs with LWJGL3 #1193 Made LWJGL3-JME to launch in the same way the LWJGL2-JME launches. This always Windows and Linux to run, still needs testing on Max OS X * TestAWTPanels hangs with LWJGL v3 #1558 / jme3test.app.TestApplication hangs with LWJGL3 #1193 Made LWJGL3-JME to launch in the same way the LWJGL2-JME launches. This always Windows and Linux to run, still needs testing on Max OS X * Removed the string compare to determine if it is a Mac OS. Using LWJLG3 class that determines this instead. * Making changes for Mac os. The AWT examples will not work under Mac but the Linux and Windows version will start to work. * added braces that are need for formatting. * LwjglWindow: copyright year, log message, correct indents and braces Co-authored-by: Stephen Gold <sgold@sonic.net>
I verified the fix on Windows 10 and on Linux, with LWJGL 3.3.0, both from the test chooser and executing
|
…1657 (#1696) * This is a very simple addition. It allows a person to set 3 variables in AppSettings. ‘CenterWindow’, ‘WindowXPosition’ and ‘WindowYPosition’ variables. This way these variable will be saved in the profile when the profile is saved, and be reloaded. I added ‘CenterWindow’ to be added with a ‘true’ value for the default value so it will run just like it did before. But if you set ‘CenterWindow’ to ‘false’ then inside LwjglWindow.java (lwjgl3 code) it will look at these new values, it will determine to center the window or use the position values to place the window back at the location the user last moved it to. Of course, these values are only updated if the “program” updates this value. So if you want to save screen position, you can save them on closing to and on restart put the window back into the same location. * formatting and comments changes. * jme3test.app.TestApplication hangs with LWJGL3 #1193 LWJGL3-JME library would block the current thread when executing LWJGL3. Instead of calling run() that is blocking, made it work like LWJGL2-JME library when they start it as a thread so run gets called. I commented out the run() function and replaced it with Thread.start(). * removing unwanted changes, since you can't do multiple pull requests at once. * formatting issues. * changed parameter naming to be more consistency with other items. * jme3test.app.TestApplication hangs with LWJGL3 #1193 LWJGL3-JME projects was doing a call that is blocking the current thread. I changed it to match how LWJGL2-JME project launches the Context Window. * jme3test.app.TestApplication hangs with LWJGL3 #1193 (#3) LWJGL3-JME projects was doing a call that is blocking the current thread. I changed it to match how LWJGL2-JME project launches the Context Window. * removing unwanted changes. * AppSettings: enhance the new javadoc * AppSettings: capitalize Window{X/Y}Position consistent w/other settings * LwjglWindow: convert tabs to spaces * AppSettings: re-arrange @see tags in javadoc * using deprecated FrameBuffer methods in jme3-core and jme3-desktop #1657 Updating all references to setDepthTexture and setColorTexture from old system to the new system. * Removing unused imports. * missed an unused import. * FrameBuffer: improve formatting of the added sourcecode * tweak the whitespace Co-authored-by: Stephen Gold <sgold@sonic.net>
* This is a very simple addition. It allows a person to set 3 variables in AppSettings. ‘CenterWindow’, ‘WindowXPosition’ and ‘WindowYPosition’ variables. This way these variable will be saved in the profile when the profile is saved, and be reloaded. I added ‘CenterWindow’ to be added with a ‘true’ value for the default value so it will run just like it did before. But if you set ‘CenterWindow’ to ‘false’ then inside LwjglWindow.java (lwjgl3 code) it will look at these new values, it will determine to center the window or use the position values to place the window back at the location the user last moved it to. Of course, these values are only updated if the “program” updates this value. So if you want to save screen position, you can save them on closing to and on restart put the window back into the same location. * formatting and comments changes. * jme3test.app.TestApplication hangs with LWJGL3 #1193 LWJGL3-JME library would block the current thread when executing LWJGL3. Instead of calling run() that is blocking, made it work like LWJGL2-JME library when they start it as a thread so run gets called. I commented out the run() function and replaced it with Thread.start(). * removing unwanted changes, since you can't do multiple pull requests at once. * formatting issues. * changed parameter naming to be more consistency with other items. * jme3test.app.TestApplication hangs with LWJGL3 #1193 LWJGL3-JME projects was doing a call that is blocking the current thread. I changed it to match how LWJGL2-JME project launches the Context Window. * jme3test.app.TestApplication hangs with LWJGL3 #1193 (#3) LWJGL3-JME projects was doing a call that is blocking the current thread. I changed it to match how LWJGL2-JME project launches the Context Window. * removing unwanted changes. * AppSettings: enhance the new javadoc * AppSettings: capitalize Window{X/Y}Position consistent w/other settings * LwjglWindow: convert tabs to spaces * AppSettings: re-arrange @see tags in javadoc * TestPostWater issue #1699 Changed it so when you go under water to turn off reverb. I turned off the Low Filter because it is not needed with Reverb is turned off. * Added a feature to leave dry filter on/off. Also put on the screen other hot keys this demo supports. * type preventing input to work correctly. * more formattings changes. * TestPostWater: standardize key names * TestPostWater: correct key assignements that were swapped * TestPostWater: organize imports per the style guide * TestPostWater: whitespace * TestPostWater: change useDryFilter logic so the 4 key has prompt effect Co-authored-by: Stephen Gold <sgold@sonic.net>
* This is a very simple addition. It allows a person to set 3 variables in AppSettings. ‘CenterWindow’, ‘WindowXPosition’ and ‘WindowYPosition’ variables. This way these variable will be saved in the profile when the profile is saved, and be reloaded. I added ‘CenterWindow’ to be added with a ‘true’ value for the default value so it will run just like it did before. But if you set ‘CenterWindow’ to ‘false’ then inside LwjglWindow.java (lwjgl3 code) it will look at these new values, it will determine to center the window or use the position values to place the window back at the location the user last moved it to. Of course, these values are only updated if the “program” updates this value. So if you want to save screen position, you can save them on closing to and on restart put the window back into the same location. * formatting and comments changes. * jme3test.app.TestApplication hangs with LWJGL3 #1193 LWJGL3-JME library would block the current thread when executing LWJGL3. Instead of calling run() that is blocking, made it work like LWJGL2-JME library when they start it as a thread so run gets called. I commented out the run() function and replaced it with Thread.start(). * removing unwanted changes, since you can't do multiple pull requests at once. * formatting issues. * changed parameter naming to be more consistency with other items. * jme3test.app.TestApplication hangs with LWJGL3 #1193 LWJGL3-JME projects was doing a call that is blocking the current thread. I changed it to match how LWJGL2-JME project launches the Context Window. * jme3test.app.TestApplication hangs with LWJGL3 #1193 (#3) LWJGL3-JME projects was doing a call that is blocking the current thread. I changed it to match how LWJGL2-JME project launches the Context Window. * removing unwanted changes. * AppSettings: enhance the new javadoc * AppSettings: capitalize Window{X/Y}Position consistent w/other settings * LwjglWindow: convert tabs to spaces * AppSettings: re-arrange @see tags in javadoc * TestPostWater issue #1699 Changed it so when you go under water to turn off reverb. I turned off the Low Filter because it is not needed with Reverb is turned off. * Added a feature to leave dry filter on/off. Also put on the screen other hot keys this demo supports. * type preventing input to work correctly. * more formattings changes. * TestPostWater: standardize key names * TestPostWater: correct key assignements that were swapped * TestPostWater: organize imports per the style guide * TestPostWater: whitespace * TestPostWater: change useDryFilter logic so the 4 key has prompt effect Co-authored-by: Stephen Gold <sgold@sonic.net>
Current
master
branch running on Windows:TestApplication
completes in < 20 seconds without user input, after displaying a black window and a black fullscreen.TestApplication
displays the black window, then waits for the user to close the window. If the user closes the window, it pauses, displays the black fullscreen, and hangs. ALT-Tab is required to regain control.The text was updated successfully, but these errors were encountered: