Ogre/WPF Integration using D3DImage

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
jpho
Gnoblar
Posts: 10
Joined: Fri Oct 19, 2012 5:22 pm

Ogre/WPF Integration using D3DImage

Post by jpho »

D3DImage is an interoperability technology in Windows Presentation Foundation that allows efficient interop between WPF and Direct3D. There's code and explanations about how to set it up on MSDN: http://msdn.microsoft.com/en-us/library/cc656710.aspx. It's very low-level D3D-specific stuff. I got it to run for simple D3D-proof of concept (not so hard, as all the code is on MSDN).

But for integrating Ogre, more would have to be done. If I understand it correctly (which is not a given :) ), the following problems exist:

- Initialization of the direct3d plugin would have to be adapted: So far, I think it's only possible to pass a HWND ptr to a win32 window, not to use existing D3D context.
- Direct3D9 plugin would have to allow using *3D9Ex for context creation, required for hardware-accelerated blitting of the D3D surface.

I have to admit I'm a bit lost, as I'm new to Windows development and Direct3D, and especially the MSDN-example was quite confusing for someone used to OpenGL. This also applies to the D3D9Plugin device/driver/... initialization in Ogre.

If someone here could give me a few pointers on how to best achieve D3DImage-based WPF integration of Ogre, I would be very grateful; especially, what path the new Parameters would have to take through Ogre to allow shared use of the D3D9Surface.