Jump to content
  • Advertisement
Sign in to follow this  
sakky

Windowed DirectDraw in MFC MDI Application

This topic is 5396 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’m using DirectDraw in windowed mode (DDSCL_NORMAL) for my MDI application. The CView class is responsible for drawing the contents with DirectDraw. The way I’m doing this right now is used the OnDraw method. So DirectDraw isn’t drawing until this method is called. So my CView remains blank with nothing until I update the document some how. I also run into problem when a window overlaps the CView window. Every thing is colored black (black I the clear color I use with a Blt-color fill). Is there a way to retrieve the clipping information from the window so I could use a clipper to allow overlapping windows to be seen? Where and when is OnDraw called and can I force OnDraw to be called?

Share this post


Link to post
Share on other sites
Advertisement
It's been a long time since I did anything with MFC, and I'm definately not expert, so may be way off on this but...

1) You could do the OnIdle of the windows to render. Or even explicitly call the draw/update for every sub window from the OnIdle for the whole application.

2) Clippers should definately work for that. CWnd::GetClientRect() should get you a suitable rectangle for the clipper. You should also use GetSafeHwnd() for any HWNDs you pass to D3D.

3) Dunno. Try installing the MFC source code, put a breakpoint in OnDraw() and trace back down the callstack. It'll probably either come from a window message such as WM_PAINT or from idle part of the message pump. If whatever OnDraw() is a method of is accessible to your code, then you should be able to call it yourself (check the MFC docs for any side effect warnings).

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!