Full Screen Swing with JOGL

只愿长相守 提交于 2019-12-06 00:59:35

问题


I am trying to make a Swing application which renders in full screen, following the description here http://download.oracle.com/javase/tutorial/extra/fullscreen/exclusivemode.html and the source code here http://download.oracle.com/javase/tutorial/extra/fullscreen/example-1dot4/DisplayModeTest.java

This works quite well, however as soon as I drop in a GLCanvas object as one of the components of the frame, all that shows up is a black screen. Exiting full screen, I can see the OpenGL image for a moment at full screen, then it shows up fine again in a window. Even though nothing is being displayed, I can interact with the swing components, like buttons, as if they were.

It seems to me almost like another blank buffer is being drawn above the actual swing app, but I can't figure out why that would be. Alternatively, I wonder if it's not an issue with the full screen being handled by the graphics card which is also handling JOGL?

I don't need the hardware accelerated full screen, though it might be nice - if this is unresolvable, is there some more robust way to implement full screen in a Java app?


回答1:


Try disabling -Dsun.java2d.noddraw=true as this FAQ says.




回答2:


You cannot call setUndecorated(...) on a displayable window, you have to dispose it first but this will dispose the canvas too. Use a shared drawable to do this and remove it before calling dispose() on the frame.



来源:https://stackoverflow.com/questions/4245060/full-screen-swing-with-jogl

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