Rendering Plugin DXGI Surface

SDK supports Prepar3D’s philosophy of an open development architecture and encourages third parties to bring new innovations with improved add-ons and training content.
Locked
matthew.d.chase
Posts: 1
Joined: Sat Oct 14, 2017 10:31 pm

Rendering Plugin DXGI Surface

Post by matthew.d.chase »

I am looking to use Direct2D to draw to a created texture from the Texture Plugin.

I created a test program outside of P3D to prove I could succesfully use the Interop Features and it works great.

I can also sucessfully compile a DLL and clear the texture (using the SDK Example).

However, after about 12 hours of trying about 20 different techniques I cannot generate a D2D Factory (Was the D3D Device created with BGRA Support?) and I cannot access the DXGI Surface of the RenderTargetView.

I can successfully retrieve the ID3D11Texture2D from the RenderTargetView and I looked at the Texture Description, it only has one MIP layer and is in the same format however I receive an E_NoInterface Error when Querying for the DXGI Surface.

I even tried creating a separate D3DDevice, D2DFactory and RenderTarget and attemptings to copy it into the RenderTarget but that also was fruitless.

Am I missing something here? The D3D11 and D2D Interop features are really easy to use outside of P3D and I think it will be a great and efficient way to draw in the sim.

-Matthew Chase
USCG HC-130H Pilot
Locked