JOGL - Swing - JavaFX

假如想象 提交于 2020-01-16 06:42:49

问题


Ok,

I have a working JOGL application. I use a lot of OpenGL features in it including Textures, VBO's, Ray-Picking, etc. I like working with OpenGL directly and don't want to use any other 3D graphics libraries.

What I want to achieve is two fold:

  1. I want to be able to embed this JOGL application in a subset window of a larger UI window. So alongside the JOGL window will be a photo viewer, text box and scrollable list.

  2. I am designing this application to run on Windows 10, multi touch hardware.

What I have found so far:

  1. Java's Swing toolkit is the only way that I have been able to embed a JOGL window. However, Swing is old and dated looking.

  2. Incorporating multi touch into swing can be done but does require a lot of custom gesture detection. This is fine but maybe options exists that don't reinvent the wheel.

  3. JavaFX looks great and i'd like to use it but I don't see any straightforward way of pairing it with JOGL.

Do any of you have suggestions? Has anyone done this before?


回答1:


You can integrate JOGL into a JavaFX application by using the SwingNode. https://docs.oracle.com/javase/8/javafx/api/javafx/embed/swing/SwingNode.html The opposite (integrating some JavaFX into a Swing application) is also possible but I would not reccomend it.

Doing the JOGL integration this way will not be as performant as a native OpenGL window but for many application it will be sufficient.



来源:https://stackoverflow.com/questions/35608138/jogl-swing-javafx

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!