Jump to content
  • Advertisement
Sign in to follow this  
dhall3000

[.net] managed directx (mdx) 1.1 GetSwapChain method not working

This topic is 4270 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 got caught by the October 5th MDX 2.0 time bomb and am now trying to regress to 1.1 to save the day. My app needs to support rendering to multiple control windows and I've had great success using multiple swap chains under 2.0. Previously (meaning under mdx 2.0) the following code worked great: m_device = new Device((int)newSettings.AdapterOrdinal, newSettings.DeviceType, m_renderWindow.Handle, newSettings.BehaviorFlags, newSettings.PresentParameters); m_swapChain = m_device.GetSwapChain(0); I could then pass the m_swapChain var around and call m_swapChain.Present() on it to render to the appropriate control. The problem now (under mdx 1.1) is that m_swapChain.Device seems not to be a reference to the m_device object. For example, with the above code, after the second line is executed and a break point is set m_device.Transform appears as normal (Projection, World etc matrices set to proper initial values) whereas examining m_swapChain.Device.Transform reveals that it is set to null! Any ideas?

Share this post


Link to post
Share on other sites
Advertisement
If I were you, I'd create a separate swap chain for each control you want to render into. Create a new PresentParameters for each control, create a SwapChain for those present parameters, then before rendering to each control, set the device's render target to the swapchain' back buffer.

I did that for my game library AgateLib http://agate.sourceforge.net/ and it works fine.

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!