Jump to content
  • Advertisement
Sign in to follow this  

Multiple Windows and DirectX

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

What I am trying to do is to display my rendered objects in my main window and then create either an MDI or a Dialog window on top. There wont be anything directX related in the Child/Dialogs. They wont do anything but contain menu choices, etc. The main window will contain all of the rendering/directx stuff. My problem is that when I display a window on top of my main window, the rendering/directx action just stops. If I move my child window, it erases what is behind it. It's like the background is not being re-drawn when I open some sort of window over my DX stuff. When I close the window, my DX things pick up where they should have been. As long as a window is opened it stops drawing all of my directx stuff. Not sure how to handle this. Do I need to use SwapChain for this still?

Share this post


Link to post
Share on other sites
Advertisement
Are your dialogs modal and taking focus away from the window where rendering occurs?

The classic implementation has Direct3D rendering in sync with the message-pump part of a Win32 program. If this loop doesn't tick over, nor will Direct3D. Thus, your first port of call should be to check that updates are still occuring.

If I'm correct and it's just a case of your updates not being called, then you need to restructure your rendering loop to compensate.

A simple solution might be to watch for different windows messages (e.g. WM_PAINT) or structuring your program so that child dialogs don't freeze the main loop.

It is possible you might need to spawn a worker thread to keep updating your display "in the background", but I've never had to do this so I don't know if it'd work well.

hth
Jack

Share this post


Link to post
Share on other sites
Yup that seems to be the problem. I checked and my rendering is not working at all once I open a child window. Not sure why this is. My rendering loops is set to always be active as long as the form is also.

I will play around with this and will post back if I still have probs. Thanx!

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!