Render UE4 graphics into another game

Hello,

I have created a simple game which uses my custom LineBatchComponent to draw two lines(I am attaching screenshot in order to check it)

Now, I want these two lines to be rendered into another game which is running on DirectX11. The reason is because I have requirement to use the UE4 in order to draw something in the other game.

What I expect to happen is the following - use the RHI in order to get the D3D11 device. Use this device to capture the swapchain and the buffers of the running game. After that just run the game(my game not the other one).

I thought that a DLL injection could be performed in order to inject the UE4 game(which I created) into the other game. And to execute the game’s rendering code in the main method of the DLL. The problem is that I do not have experience with the rendering part of the UE4 and do not know how to achieve this at all. Any help here is welcomed.

Something more, I want to use the UE4 because it is taking most of the heavy logic for drawing and rendering. I have implemented some D3D11 hooks(using custom swapchains, vertex and index buffers and shaders) before and if I have to implement the logic for the drawing it would be a lot of pain.

Thanks,