Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

doctorsixstring

Inverted RGN's

This topic is 5918 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

I am trying to implement GDI controls over my windowed DirectDraw app. So far, it is working pretty well. I draw all the DirectX stuff onto the window, then I invalidate the entire window (causing all GDI controls to be drawn). This works almost perfectly. However, when I redraw the window with DirectX, all GDI controls are erased for a brief instant, causing a flicker. To fix this, I want to implement my DirectDrawClipper to clip anything drawn within certain areas of the window. I want to pass the ->SetClipper(...) function a RGN that will be made up of the entire window, minus any areas where a button or control is at. So what I need is to be able to create a region of multiple RECT's (a rectangle each individual control) and then invert it, so that only the areas outside those areas are drawn by DirectDraw. Is there a way to create such a RGN? Or is there an even better way to solve this entire problem? Any ideas would be great. -Mike After posting this, I realize that it probably belongs in the DirectX forum. If any moderators want to move it, please do. [edited by - doctorsixstring on May 30, 2002 5:39:42 PM]

Share this post


Link to post
Share on other sites
Advertisement
search CRgn::CombineRgn on msdn and try using RGN_XOR or RGN_DIFF

this is MFC and you''re using directx, but with operator HRGN you can convert it to HRGN so it should work.

Share this post


Link to post
Share on other sites

  • 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!