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

Started by
0 comments, last by vermilion_wizard 17 years, 6 months ago
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?
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.

This topic is closed to new replies.

Advertisement