问题
With the new update to lwjgl 3 the class Display does not exists, i've searched everywhere but i can't find anything on how to put all my lwjgl app in a jpanel or in a canvas or anything like. I already thought to use an opengl gui like twl but it would make all more difficult and i don't need it, so my question is how to put the lwjgl app in a jpanel or in a canvas. Thanks, it would save my life.
回答1:
Unfortunately, there currently isn't any support for using LWJGL3 with Swing. Support for more windowing systems is in the roadmap, but it isn't clear whether it will be implemented at all.
From the roadmap:
Multiple windowing system implementations.
- [✓] GLFW
- LWJGL 2 compatible
- [?] AWT/Canvas
- [?][.x] JavaFX
One lesson learned from LWJGL 2 is that it's very hard for a windowing system to keep everyone happy. There was always that one feature missing. For 3, the plan is to support a few different windowing system back-ends and possibly an "official" API similar to the current one, with an unspecified implementation under the hood. This might sound like too important a part of LWJGL to be so open, but the fact is that the API surface is quite small. Even with no abstraction layers, it's easy to move client code from one windowing system to another. Forcing a cross-platform and implementation-agnostic API to our users will soon hit us with the same issues we have in LWJGL 2. The only complete implementation we have for now, GLFW, is feature-packed and robust, but it's still early to commit to it. The plan is to explore many different options first and expose everything to users. They always know better.
[?]: Still under discussion. May change or is controversial and may not be implemented at all.
来源:https://stackoverflow.com/questions/29048482/put-a-lwjgl-java-app-in-a-jpanel-or-canvas