Custom Windows - OpenGL
In parallel to the other Custom Windows thread, I've been wanting to ask this as well. How would I make a custom window as in the other thread (not a rectangular one), using opengl? I know the basics are the same as in the other situation; create a transparent border around your 'round' window, and then only receive messages from the top border of it? Create a RECT around the top border and check for mouse messages with coordinates in that rectangle? I've seen this elsewhere so I could figure out how to make it drag, but how would I do this in opengl? The 'not rectangular' window.
You may try the traditional approach: set the window region to a desired shape through SetWindowRgn () and related functions. A region is a set of polygons that make up an unusual shape. You may refer MSDN for more infos. Also note that this approach while has been popular from the past, it is slow, especially with complex regions.
An alternative 'modern' approach: from Windows 2000 (including WindowsXP and 2003 Server), Microsoft has kindly included the feature to let windows to be real transparent, you may take a look at SetLayeredWindowAttributes(). The MSDN has describled it quite sufficiently. This method is fast but unfortunately it is only compatible with these OSes.
An alternative 'modern' approach: from Windows 2000 (including WindowsXP and 2003 Server), Microsoft has kindly included the feature to let windows to be real transparent, you may take a look at SetLayeredWindowAttributes(). The MSDN has describled it quite sufficiently. This method is fast but unfortunately it is only compatible with these OSes.
Thanks, my platform is winXP. I hope my question was understandable, basically say i want to draw out a media player (circular) and want to make everything outside the circle transparent, and make that the window. Thanks for the help :)
Quote:Original post by blankdev
In parallel to the other Custom Windows thread, I've been wanting to ask this as well. How would I make a custom window as in the other thread (not a rectangular one), using opengl? ...I've seen this elsewhere so I could figure out how to make it drag, but how would I do this in opengl? The 'not rectangular' window.
I think u make mistake, OpenGL is graphics library. It deals with graphics only, it's the host who deals with windows stuff. See my signature for a simple example of irregular-shaped executable file that make from win32 API
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement