views:

266

answers:

4

I have an app with an OpenGL window as a child window of the main window.

When I display a dialog box above the OpenGL window, it doesn't get drawn. It's like it's not getting WM_PAINT messages. If I can guess the title bar position of the dialog box, I can drag it and it's still responsive.

I realise this might be a vague question, but I was wondering if anyone else has seen this sort of behaviour before and knew of a solution?

I wondered if the Pixel Format Descriptor would make a difference - I had PFD_DRAW_TO_WINDOW, but changing to PDF_DRAW_TO_BITMAP didn't make any difference. I'm not sure what else I should be looking at?

Thanks for any help!

A: 

Is your opengl window constantly rendering. It is possible that the 3D hardware is simply rendering into an overlay that is overdrawing your dialog box. If you position the dialog box so it overlaps your main window, can you see some of it?

Try to pause rendering into the main display to see if it effects the results.

You will also need to make sure that your window style ensures the results are clipped...

cs.style |= WS_CLIPSIBLINGS | WS_CLIPCHILDREN ;

You should check though all the items mentioned in this MSDN article, as it covers a lot of the basics for getting opengl rendering in a window correctly.

http://msdn.microsoft.com/en-us/library/ms970745.aspx

rikh
Thanks. A useful link.
Steve Folly
A: 

You may need to switch overlay off. It can be done via forcing back buffer presenting method to copy instead of swap.

Use wglChoosePixelFormatARB and one of parameters should be

WGL_SWAP_METHOD_ARB with value WGL_SWAP_COPY_ARB

A: 

This may seems stupid but are you sure your OpenGL window is not flagged "topmost" ?

Does the dialog box disappear also behind borders of your window or just behind the OpenGL rendering rectangle ?

rockeye
No, it's not topmost and yes, it is only the OpenGL rendering rectangle that was the problem, not the whole window. (However, see my answer for solution!)
Steve Folly
A: 

Bugger. Should have given all the details. I was running Windows in a virtual machine on Mac OS X using Parallels. I upgrade from Parallels 3 to 4 and now everything is working fine. I suspect a Parallels video driver issue.

Thanks to all those who answered with suggestions.

Steve Folly