Jump to content
  • Advertisement
Sign in to follow this  
blanky

Custom Windows - OpenGL

This topic is 4652 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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 :)

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!