Where's my window?


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


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:

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.