-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
LwjglCanvas using lwjgl-jawt #2153
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
LwjglCanvas using lwjgl-jawt #2153
Conversation
extends LwjglContext ,LwjglWindow , Which one is better? LwjglWindow Mainly to initialize glfw window |
synchronized (lock) { | ||
canvas.deleteContext(); | ||
} | ||
//// request the cleanup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code in comments generally should not be. Is this something that is incomplete?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't be there, I forgot to delete it. Sorry for causing confusion...
Yeah, if I just remove
I'm talking about the |
To actually use the profiles you need to do as the error message I posted, but it of course refers to the library settings:
The above works but the canvas is just black and the test cube is not showing. |
Core profile I didn't get to work. Compatibility profile works. Here is an example how I tested this then to conform to jME's rendered setting (although I'm not sure if this is required or not...). But note that these didn't fix any of the problems encountered:
|
As I mentioned before, removing the canvas from the parent component and adding it back (or to any other component) breaks it, which is a problem that lwjgl3-awt currently has; TestCanvas performs this same procedure (removing the canvas).
This is an unexpected issue, thanks for reporting; Just out of curiosity, what operating system are you using (version) |
Still trying to switch tabs? |
Windows 10.
No, this was just in general. I was trying stuff out. As the CORE profile doesn't work at all for me. |
When setting
Now, it's pending... I'm testing on Windows 10 to fix it... |
…ata for the context in case it fails.
At the moment I can run it on Windows-10 and there is no problem with Linux. |
With this patch (if it can be considered), LwjglCanvas works with Linux without problems (100%)
Now I'm working on getting it to work with Windows, MacOS shouldn't be a problem. |
Hi, |
In the case of Windows it is currently pending. The option to remove and re-add the canvas is the only issue present. Regarding MacOS; Removing and re-adding the canvas is no problem (it basically totally works; according to the lwjgl3-awt guys),
The Windows platform that still has the aforementioned problem. |
Looks like #1868 just went in. I suppose that is ok, it should not cause any harm. But I'm in favor of overwriting the said PR with this. As this is hardware accelerated, a real solution to the problem. |
Yes. there is a current pending issue with Windows. I will merge it as soon as it is resolved |
Hi @JNightRide @tonihele - if we decide to merge this PR, should we need to pay attention to some of your #1868 PR code or we can just merge this PR as-is without warring about the changes that you have made? Thanks :) |
To answer this question.
[ NOTE ] This current issue is on the lwjgl3-awt side, it can't be patched from JME3 (as far as I know), lwjgl3-awt may need to be modified to fix it (source code), I'm working on it; However, at the moment I do not have the time necessary to present a definitive solution. Is JME3 willing to accept this "PR"? And in a future version (3.7.x), this issue may be fixed. |
|
This can and should override my PR. No need to worry about the stuff I made. Merge conflicts just no need to be resolved accordingly. Also notable that as of currently this PR will change jme-examples to run on LWJGL 3. I suppose this is fine as we should really start advocating it as default. |
@@ -172,6 +172,10 @@ public void actionPerformed(ActionEvent e) { | |||
currentPanel.remove(canvas); | |||
app.stop(true); | |||
|
|||
try { | |||
Thread.sleep(1000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a test yes but looks like a hack of sorts. Better at least to comment why this is needed. Should consumer add this to their production code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should consumer add this to their production code?
It is an important part for lwjgl3-awt to work correctly (the consumer will have to implement it), in the pending commits I plan to document this part.
[ EDIT ]
It's better to have "LwjglCanvas" handle this internally (I'll put it on my list of things to fix).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to have "LwjglCanvas" handle this internally (I'll put it on my list of things to fix).
Definitely. Optimally users should not care whether they are running LWJGL 2 or 3. Identical code should work. Any shenanigans should be hidden from the user (exist in the library itself).
@@ -234,7 +238,7 @@ public static void createCanvas(String appClass){ | |||
} | |||
|
|||
public static void startApp(){ | |||
app.startCanvas(); | |||
/*app.startCanvas();*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code in comments are bad. Also this test should still work on both LWJGL 2 and LWJGL 3. I think it is important that LwjglCanvas works the same. It should handle all disparities internally and not require any shenanigans from the user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correction in pending commits....
Thanks for your PR 💯 Anyone can test this with Wayland on linux? It seems it is using X11 apis, so i wonder if it will work as expected |
Can you add a test to reproduce this issue? |
There is the https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-examples/src/main/java/jme3test/awt/TestCanvas.java general test. It has the context menu where this can be caused. |
With this, this PR now has the necessary documentation and reported bug fixes. |
It seems that this question has already been answered for you; Thank you @tonihele for your quick response. |
Note that this PR changed the jME tests to run on LWJGL3. While this is fine and desirable. Our TestChooser is still written in Swing, and by using TestChooser people might run into errors... |
Would this be an acceptable solution for now?
This solves the problem of integrating https://github.com/LWJGLX/lwjgl3-awt (#1868)
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)