I’m trying to port my 3D medical imaging tool from unix to Win98 and I am having problems rendering to multiple windows.
I am not using MFC and I am creating child windows (using CS_OWNDC) and associating a rendering context with each window. On startup my program creates three windows and renders different views in each of them. So far so good!
The problem is that as I update the views, sooner or later I start getting the wrong view rendered in one or more of the windows. Also at least one of the windows will not get updated at all. It’s as if OpenGL is getting its RCs and HDCs mixed up, but as far as I can tell, everything is okay with my code. The problem appears to start at random intervals after startup - but sooner or later (usually sooner) it always occurs.
Here’s what I am using:
Creative Blaster riva TNT (problem occurs with both Creative’s original drivers, and detonator 3).
Visual C++ Developer Studio 4.2
I’ve tried the Opengl32.lib that comes with Developer Studio, and also I even built and used MesaGL. Still get the problems.
I am (I think) correctly using wGlMakeCurrent
and I tried using wGlMakeCurrent(NULL,NULL) before setting each context so that I can guarentee only one RC is active at any one time.
I recently came across a posting saying that it is a good idea to just have one RC for my program, but multiple DCs, so I tried this, but no joy.
My rendering contexts are doublebuffered, but I am remembering to use SwapBuffers.
Any suggestions would be greatly appreciated.
The frustrating thing is that I ported my code pretty quickly and easily, and the program almost works!
If anyone’s interested, you can see examples of the unix version of my renderer at: