Description
Hey, I've been working on some basic Oculus Rift support in a hobby project and Tom Spillman asked me post about what was missing in MonoGame for Oculus SDK. I've mostly got VR going with a Oculus SDK wrapper called OculusWrap: https://oculuswrap.codeplex.com/ It uses DirectX11 through SharpDX so it wasn't too bad to port over the demo and I have a working project in MonoGame. However there's one main thing missing that I've encountered so far to get it properly integrated into MonoGame using mainly MonoGame API(rather than messily bypassing it with SharpDX).
The render targets are required in their SharpDX form, which means they are very awkward and live outside of MonoGame currently in my code. Being created in SharpDX. Since I have to have them in this form pass to the SDK. It would be useful to have a ".Handle" perhaps similar to GraphicsDevice.Handle on DirectX11 platforms that returns an object we can cast to their SharpDX internal representations for Texture/Texture2D/RenderTarget2D.
This would allow for the creation of the targets required by the Oculus SDK with just new RenderTarget2Ds inside MonoGame and also for them to be handled normally in all other parts of MonoGame such as altering/drawing these targets. An example of what currently doesn't work without interrupting MonoGames drawing is the Mirrored screen mode. The Oculus SDK populates a target with what the user sees to draw on the monitor screen. Without interfering with MonoGames internal drawing with SharpDX(which seems to break rendering down the line) I can't draw this target to screen, since it isn't a MonoGame RenderTarget2D. Where as if I could setup all the textures within MonoGame I can simply draw this on a Quad to screen or via SpriteBatch.