-
-
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
Lwjgl3 canvas #1868
Lwjgl3 canvas #1868
Conversation
@@ -291,6 +289,8 @@ public void invoke(int error, long description) { | |||
requestWidth = videoMode.width(); | |||
requestHeight = videoMode.height(); | |||
} | |||
oldFramebufferHeight = requestHeight; |
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.
By assuming that the scaling factor of 1 is correct we avoid extra resize at the start of application, also fixes TestAwtPanels. If you really don't have scaling... AwtContext wasn't build scaling in mind. It throws an exception when framebuffer resize is triggered, and that is how our scaling currently works.
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.
@tonihele please revert oldFramebufferHeight
and oldFramebufferWidth
initial values back to 0
.
See: https://github.com/jMonkeyEngine/jmonkeyengine/pull/1950/files#r1103859250
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.
TestAwtPanels throws an exception
AwtPanelsContext is modified to log an error instead of throwing an exception which should make TestAwtPanels work again.
Please see #1949
Thank you for the PR.
Yes, I think this is the least sketchy way to get this to work reliably, other solutions can be implemented as optimization for specific platforms (eg. i see lwjgl3-awt works only on linux systems that use X11). Also this should probably work well in most systems. I have 2 questions:
|
|
Ok, i was questioning the use of Deque vs List, but i've seen now that you did that to use poll(). Ok then.
Yep, should be easy enough, since we have already a capability registered for that. Do you plan to address it in this PR or would you like to do it at a later time? Non-power-of-two textures should be supported by the vast majority of GPUs anyway, so we could also decide to leave it like that for now.. and just merge this PR |
I would do additional issues. Not this PR. The following issues would be created:
1 & 2 can be handled then separately without applying any pressure on one another. And if 2 is done before, well, that is all good then, canvas works. Also there are issues about the scaling and canvas. That should be taken into consideration when touching issue number two. |
What is the state of this PR? |
It is ready. What it is, is a poor solution to something that currently doesn't work at all. With this it works. Usability depends largely on what it is being used for, i.e. gaming, not feasible; using LWJGL 3 and a small 3D canvas in your app, feasibleish. There is the test canvas test app for this. Even I'm on the fence with this one. My small hope was that we could use LWJGL 3 with the jME SDK with this. But I don't know if this even really makes it possible. SDK rendering at least would need so little power that in that way this would work. Future development needed as stated above. |
Would if be possible to add a short Javadoc comment explaining what/when this is used? IIUC, it's to allow lwjgl to render a scene to an AWT component, but lack of Javadoc is an ongoing pain-point for me with JME. |
The code is self-doc... :D As far as I know it is indeed used to render jME context inside an AWT component. Would that itself be a suffice explanation? |
Sorry, I thought I had responded. Yeah, Just a one-liner stating the use. Most of the methods seem to be I am wondering if |
Would this be acceptable solution for now? If we open another ticket to implement this for real?
This would fix #1192 and also TestAwtPanels. The performance is not great.. not terrible...
I tried getting https://github.com/LWJGLX/lwjgl3-awt to work but didn't get it display anything yet.
The problem with this solution is that it is pretty much software rendering. The rendering is first done to a Framebuffer as it is recommended. But then everything goes bad, we just render it to an image (I guess slightly accelerated but...) for displaying it to the user. And another problem is that it requires support for non power of two textures.
This is basically copy paste from what we already had in the engine, the Offscreen rendering to an AWT panel.