Jump to content
  • Advertisement
Sign in to follow this  
DirkDaring

Yet another simple Windows GDI question

This topic is 4255 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 asked this before as part of a two part question, so I never got the answer to my second part of my two part question. The question is simply; In Windows GDI, is there a simple way (function or otherwise) to just "erase" all graphics in the window no matter what size it is? Or do I have to find the current size of the Window, fill that into a RECT, and draw a rectangle (with the RECT as the parameter) to fill everything in with pixels? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
It depends on exactly how your app is structured. If you want to do the wipe immediately then yes you need to draw a rect with whatever your background color is.

The more traditional "Windows-y" way to do it would be to call InvalidateRect with a NULL rect pointer and bErase set to TRUE. This in turn would cause your app to get a WM_ERASEBKGND message which you could either handle or pass to DefWindowProc which would effectively do the wipe above with the background brush you specified in your WNDCLASS. You'd then get a paint message queue'd up to redraw whatever needed to be drawn.

There is no such thing as a true "erase" in the sense it sounds like you're thinking of. The pixels are always there. They are just background color or not.

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!