Custom Windows - OpenGL

Started by
3 comments, last by gan 18 years, 3 months ago
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.
Advertisement
Do you mean a Win32 window?
My opinion is a recombination and regurgitation of the opinions of those around me. I bring nothing new to the table, and as such, can be safely ignored.[ Useful things - Firefox | GLee | Boost | DevIL ]
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.
--> The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones <--
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