Sign in to follow this  
dhall3000

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this