Newb916
asked on
OpenGL and Transparent MFC window flicker
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:
https://www.experts-exchange.com/questions/21029329/Animation-Flicker.html
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."
-iziz
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"
http://www.coreytabaka.com/index.php?r_s=541&r_p=543&flog_id=4&PHPSESSID=735c46cef1e79860dd5883ae74299f80
He sort of describes his procedure in this link below but also it is vague. I need to know how to properly do this.
file:///C:/Documents%20and %20Setting s/JHER.DTL AB/Desktop /Mapps4_So ftkeyDispl ay_Issue/W eb_Save/Tr ansparent% 20Window%2 0Demo%20-% 20OpenGL.o rg%20Discu ssion%20an d%20Help%2 0Forums.ht m
-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.
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:
https://www.experts-exchange.com/questions/21029329/Animation-Flicker.html
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."
-iziz
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"
http://www.coreytabaka.com/index.php?r_s=541&r_p=543&flog_id=4&PHPSESSID=735c46cef1e79860dd5883ae74299f80
He sort of describes his procedure in this link below but also it is vague. I need to know how to properly do this.
file:///C:/Documents%20and
-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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Here is the real link:
http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=194444&fpart=1