Fullscreen mode + opengl



I’m working on an application that does video tracking and renders the video to an OpenGL component. In one particular situation, it’s really useful for people to see only the OpenGL component stretched across the entire screen with no menu bars, i.e. in kiosk mode. I’ve read all of the other posts about how to launch a component in full screen mode, and I’ve tried all of the posted alternatives. And I can get the OpenGL component to stretch into full screen mode, but it doesn’t render correctly in full screen mode.

When I’ve tried using the following code (or some variation of it), it flickered like crazy between the component and the main Juce application.

getPeer()->setFullScreen( true );
setBounds( Desktop::getInstance().getMainMonitorArea(false) );

When I tried using this alternative code block, it no longer flickered (thankfully). But it only shows the full screen component after you minimize all other windows, and even then, it doesn’t render the component correctly. Some parts of the image are rendered twice in slightly shifted positions:

videoDisplay->setBounds(Desktop::getInstance().getMainMonitorArea(false) );
videoDisplay->setVisible (true);

I’ve run out of ideas of things to try to fix this problem. If anyone has any suggestions, I would appreciate it.



…maybe Desktop::setKioskModeComponent() is what you’re after?


That sounds like just the thing I need, but where is this method? In the API Desktop doesn’t have a setKioskModeComponent() method. I just downloaded the latest source code, and it’s not in the Desktop class either…


Ah… I found it in the SVN repository… Okay, I’m going to try it out…


Hey, no, that’s not working unfortunately either. :frowning: When I try to set the OpenGL component as the component in kiosk mode, the whole screen goes black: no video, no markers, no nothing… When I wrap the OpenGL component in a panel and set the panel in kiosk mode, then the screen flickers between the video display and all the windows from other applications that are behind it.

Unless anyone has any other suggestions, I think I’ll just rewrite this part to not use an OpenGL component at all. For this particular function it’s nice to be able to see the video, but it’s not absolutely essential…


Is this on mac or windows?


I’m working on Windows at the moment. (This is eventually going to have to run on Macs as well though.)


Well, it’s supposed to work. I’ll have to test it when I get chance.


BTW, why is it that OpenGL rendering speed gets that fast in Kiosk mode on OS X (here it goes from 14ms to about 1.5ms rendering speed in the JUCE Demo) ?


I don’t see any difference on my mac, which runs consistently in about 0.5 ms. But that’s with 10.7, and I’m sure there are big differences between OS versions.


I’m on 10.6.8. Please try with “Tiled Images ARGB” + all animations on in the JUCE Graphics Demo using OpenGL. That’s where I measured this difference between normal window and kiosk mode. And btw, as soon as I press on a menu, the CPU jumps from 1.5ms to 14ms up again (as long as the menu is open). So there’s something going on there which seems abnormal.