gpt4 book ai didi

java - 将 LWJGL java 应用程序放入 jpanel 或 canvas

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:21:05 25 4
gpt4 key购买 nike

随着 lwjgl 3 的新更新,类 Display 不存在,我到处搜索但我找不到任何关于如何将我的所有 lwjgl 应用程序放入 jpanel 或 Canvas 或类似的东西。我已经考虑过使用像 twl 这样的 opengl gui,但这会使一切变得更加困难,而且我不需要它,所以我的问题是如何将 lwjgl 应用程序放入 jpanel 或 Canvas 中。谢谢,它会救我一命。

最佳答案

不幸的是,目前不支持将 LWJGL3 与 Swing 一起使用。对更多窗口系统的支持在路线图中,但尚不清楚是否会实现。

来自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.

关于java - 将 LWJGL java 应用程序放入 jpanel 或 canvas,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29048482/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com