We help IT Professionals succeed at work.

OpenGL and Transparent MFC window flicker

Newb916 asked
Hi I have a related question to the article below which is about an annoying flicker of transparent windows over an OpenGL window.  

The only difference really is that I am programming in C++.  Also running the dinosaur MS VS 6.0 with MFC.  Our company has picked up legacy source and I will need to support this before we make our move to VS 2008.   What I am trying to accomplish is to have my OpenGL window support  transparent layered windows over it without having the transparent window flicker my eyes off.  Also I am double buffering just to make that clear.

The link can be found here:

I am quoting the solution here:
"Draw your opengl scene to memory instead of your frame buffer and then draw that image to a standard window with standard GUI components.  This should have the effect of causing windows to update all transparent GUI components that are on top of the GUI drawing surface.  This would require more work though! (and would be a bit slower)  However if you were doing this I wouldn't see the point of having two applications... you could do this directly in your vb application... unless you wanted / needed the transparency for more than your opengl background."

1. Now my question is, what does he mean by drawing the scene to memory?  Can I have some help in how to do this?

2. How would I draw this to a standard window?

There was a person who solved this problem with this demo project here:
"The Cube Demo"

He sort of describes his procedure in this link below but also it is vague.  I need to know how to properly do this.

-In this post someone wrote
"My guess: Render to an RGBA pbuffer, readback scene, blit with gdi and set colorkey/blend depending on the alpha channel or background color of the scene."
-The original poster then stated,
"Anyway, evanGLizr is almost dead on. I do use UpdateLayeredWindow and glReadPixels to achieve this effect. AFAIK this is the only way to do this cleanly, since Windows has issues with mixing layered windows and OpenGL. Perhaps Longhorn will bring a better solution. However, this is not really the clever part of this demo. I didn't create any messy offscreen windows or use the desktop window to get an OGL context (since that doesn't work on the NV cards I have)."

3.  Is this the same solution as the one above?  Perhaps the answer is here but not quite sure how to implement.

Any help would be great.  Thanks in advance.

Watch Question


Err... sorry I had given you a local path of discussion for the "Cube Demo" link.

Here is the real link:

I guess there is no love for me at this site.

It gets a big FAIL!