There is just one small detail, removing the canvas from its main component and integrating it again breaks it. This issue occurs on the lwjgl3-awt side (LWJGLX/lwjgl3-awt#40)
In the case of LwjglCanvas it is better to inherit from the LwjglWindow class to facilitate its maintenance, and it was not necessary to inherit from LwjglContext since it does not need it
This is great and addresses the major issue I have with JMonkeyEngine (swing not working with current version of lwjgl3).
I tried using your PR with my application. The good thing is it works.
Sad news for me is that the frame rate was much lower.
I usually get 60 FPS (using vsync)
With this PR build of JME, running in swing window, with jme3-lwjgl3, I get 14 FPS
If I use the same PR build of JME, but switch back to jme3-lwjgl, I get 60 FPS again
If I use the same PR build of JME, running with jme3-lwjgl3, but in full screen (so no swing or awt), I get 60 FPS
For me, this is still an improvement, as I can run in a configuration that did not work at all before. However it would be good if the frame rate was not impacted so severely.
This is the log if that helps. Running on windows 10
FYI I tested 3.7.0-alpha3 and saw the same performance issue with lwjgl3 vs lwjgl when running in a swing window as I reported previously. I saw there were some extra commits since my initial report but they don’t seem to have fixed the issue I am seeing.
You should keep in mind that, to run AWT with lwjgl3; first the awt thread is loccked so that lwjgl3 can draw, then it is unlocked to give control to AWT; This can have high costs if the scene to be rendered is not optimized.
By optimize, do you mean use GeometryBatchFactory.optimize ?
I am using Blocks framework (there is a thread on this forum for it). Similar to Minecraft. I am not sure if it is Optimized.
Not necessarily, for example, a model with 10000 vertices is not the same as one with 100000 (if the model is quite simple); as well as loading many objects at the same point (condensation)
Blocks uses jme3 version 3.4.x; Isn’t this an important factor in performance? (Correct me if I’m wrong)