PDA

View Full Version : Transparent window in opengl



wlb2001
09-20-2006, 09:01 AM
Hi guys:
I am trying to impelement a program under windows, and want the program to show backgroud transparent, which means all area that not occupied by 3d object will be show transparent. (so that u can see desktop icons if no object be drawn at that area)
I have tryed glClearColor(0,0,0,0) and enable blending, but it doesn't work, so anyone has any idea?
Thanks for the help

arekkusu
09-20-2006, 01:16 PM
If your OS has a composited window system (http://www.apple.com/macosx/features/quartzextreme/) , this is trivial.

Otherwise, you have to figure out how to fake it by coping the desktop background and drawing it behind your content. Good luck keeping up while dragging or resizing the window...

k_szczech
09-20-2006, 02:14 PM
In Windows you can set window region to determine the shape of window. If the geometry isn't too complex then you can try it.
Just make sure that swapBuffers and SetWindowRegion are called as close to each other as possible.
Beware of managing regions in windows - read documentation carefully if you do not want to create application with GDI resource leaks.