Acquiring an ID3D11DeviceContext

I’m trying to port a library that does some of its own Direct3D rendering. I can’t figure out any way to retrieve a Direct3DDevice or Direct3DDeviceContext from Unreal itself, however. Is there any way to accomplish this? From what I’m looking at now, it seems like I can maybe-theoretically retrieve the RHI via GDynamicRHI. But even once I have the RHI, it seems like FD3D11DynamicRHI is locked-down as private, and there’s no way I can retrieve it on its own, to say nothing of extracting the ID3D11Device from it.

Does UE4 make it impossible for addon libraries to make direct rendering calls? Will I have to modify the UE4 source code to accomplish this?

(Which will be something of a problem, because I want to be able to distribute a version of this that can be connected to UE4 without needing source changes!)

Currently I don’t believe there is any way to get the native device through RHI. Have a look at the following PR. With these changes you will be able to get access to the native device from anywhere. If the changes are approved. Otherwise you could implement the changes yourself (Although I know it goes against what you want, distributing a version without modifying the engine, but could be a temporary workaround)

Pull Request for Native Device access

Yep, that looks like roughly the answer I was expecting. If the CoherentUI team can’t do it, I sure can’t do it :slight_smile: Many thanks!