PDA

View Full Version : Manipulating other windows interrupts OpenGL draw



karwai
03-17-2009, 10:41 AM
Hi all,

This is probably a newb question but I'd really appreciate any help :)

I've written a small app that I'm using to visualize some experimental data on a Windows box. This app just creates a single, double-buffered pop-up window and a single OpenGL context, does the setup of OpenGL state it needs to, and then goes into a loop wherein it continually draws a frame of OpenGL stuff based on the latest data and calls SwapBuffers() (the data is streamed from another machine over a network connection while the experiment is running). I'm using WGL_EXT_swap_control to vsync and the visualization is very simple (i.e. drawing requires way less time than the refresh period) so the app spends 99.9% of its time waiting for vsyncs after it calls SwapBuffers().

(On a Windows note, the app doesn't do any drawing in response to Windows messages - I've set it up to ignore any Windows messages that aren't WM_QUIT.)

The problem I've noticed is that manipulating other windows can interfere with the drawing in my visualization app, even with the setup above, if I have nothing else running involving OpenGL, and if these window manipulations don't intersect with the visualization app's window. Specifically,

i) If I maximize, minimize, or restore another window, the app's drawing appears to completely stop until the maximize, minimize or restore completes.

ii) If I start dragging another window around, the app's drawing becomes noticeably choppy while I'm dragging the window.

I normally use a dual-monitor setup and have the visualization app's window on the second monitor, but I've done some experimenting and these behaviors occur no matter whether I run the app on the first monitor in a dual setup or just on a single monitor.

Could anyone offer some insight into what's going on here?

yooyo
03-18-2009, 05:51 AM
It's a Windows feature. Minimise/maximise any app window stops realtime priority threads for ~250 ms.

karwai
03-18-2009, 10:26 AM
Thanks yooyo, that's good to know :) Would something like this be true of the window drag as well, or have I probably screwed something up to cause that? I hope to keep expanding this little app, but I'm kind of out of familiar territory.