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

标签 java lwjgl

随着 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/

相关文章:

java - 如何使用 X、Y 和 Z 顶点的最小/最大来计算矩形棱柱

java - 使用 HTML 自定义格式的 Log4j.properties 进行日志记录

java - JAVA中字符串数组的定义

java - 尚未为当前线程设置 GLCapability 实例

java - NiftyGui - 如何改变面板的大小

java - CPU 未列为使用 Windows 的设备

构造函数调用中的Java Null指针异常

java - 我如何满足在 java/jsp 中转换集合的警告

java - 何时更喜欢 LinkedBlockingQueue 而不是 ArrayBlockingQueue?

java - slick.util 和 lwjgl 纹理的问题