开发者

Full Screen Swing with JOGL

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 sou开发者_如何转开发rce 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?


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜