PDA

View Full Version : Where's my window?



mcsellski
12-01-2004, 01:48 AM
Hi,

I have an MFC SDI application that has a couple or three OpenGL windows. On some platforms all windows display normally, on others only one GL window displays. Can someone tell me what I need to be looking at to work out what might be causing this?

More info:
1. I have once HGLRC and call wglmakeCurrent etc when I want to invalidate a different GL window.
2. I use the CS_OWNDC window style
3. I have an option to copy the window to the clipboard that uses glReadPixels(). When I paste the apparently blank window to MS Paint, lo and behold, the window appears as if it had displayed correctly.

If anyone can give me a few useful pointers about how to trace the problem as to why not all of the GL windows display themselves on some platforms I would be very grateful.

I'm guessing that this problem might be card related as some XP systems are fine while others have this problem. Win2k is also a target platform but not a priority.

Many thanks

Matthew

Relic
12-01-2004, 02:02 AM
Yes, Microsoft's OpenGL implementation has problems rendering to child windows in SDI and MDI applications.
Here are two documented bugs which sound exactly like what you got:
http://support.microsoft.com/default.aspx?scid=kb;en-us;272222
http://support.microsoft.com/default.aspx?scid=kb;en-us;278695

mcsellski
12-01-2004, 02:56 AM
There you go...thanks for that...

I'm not sure that I want to render to a DIB section, seems slow, although some of the GL windows that exhibit this problem do not need to updated fast. It could work quite nicely.

I render in immediate mode as the GL stuff is for visualising data from an acqisition system. It can run at 2KHz and I use buffering that luckily brings the refresh down to about 60Hz. I'm not confident that rendering to a DIB section will be fast enough. Does this not imply that a memory dc will be needed so it would be in software more anyway...?

Perhaps I need an alternate scheme that renders to a DIB if hardware acceleration is not present. If that's the case I might as well switch to GDI for the whole thing.

thanks

matthew