Original Post
I'm working on a DirectX11 engine based on SlimDX, and I've hit a major snag. I'm trying to integrate Direct2D into the engine to render 2D graphics, but I'm unable to do so. The problem is that the RenderTarget.FromDXGI method fails and throws an E_NO_INTERFACE error every time I try to create my Direct2D RenderTarget. I do everything by the book: I create a valid Device and SwapChain, get a Surface instance from SwapChain back-buffer, create a valid D2D Factory,etc. I've verified that everything is correct by stepping through with my debugger. But the method always fails! I've tried different Formats, used the BgraSupport flag to create my Device, tried every combination of settings/params possible - all to no avail. Disturbingly, everything suddenly works fine when I switch to D3D10.1 and edit a couple lines to use the Device1 interface! So it begs the question: why can't D3D11 work with Direct2D? How can any 2D graphics berendered if I can't interop with Direct2D? This is a real show-stopper, and I have [color="#366388"]countless hours of work on the line. I'm hoping someone can point me in the right direction. What's wrong, and how can D3D11 & D2D be used together? And if it's not possible, which would shock me, how the heck can I do 2D rendering at all? MSDN and the documentation for [color="#366388"]DirectX and SlimDX offer no answers. The DX docs mention only D3D10.1 / Direct2D interop, and offer no explanation ofhow we render 2D graphics now that the Font and Sprite classes are removed in 11. So can anyone help me out? I'm terribly frustrated after wasting days trying to find a solution. So I hope someone knows what I need to do. Thanks for your time and any help/advice you can provide!