0

I am using Win2D. I want to apply NVIDIA Reflex SDK to my game. To achieve this, NVIDIA Reflex SDK requests Direct3DDevice object. I think CanvasDevice (which implements IDirect3D11Device) matches Direct3DDevice.

So, how can I get a native Direct3DDevice object from IDirect3D11Device. Or, am I misunderstand this?

P. ful
  • 113
  • 9
  • 1
    Wouldn't https://stackoverflow.com/questions/12507998/how-to-pass-a-com-object-as-an-intptr-to-a-p-invoke-method work here or are these instances not COM objects themselves? – Ray Jun 01 '22 at 00:43
  • @Ray Thanks! It works. I can get ID2D1Device object from Win2D CanvasDevice with your solution. – P. ful Jun 01 '22 at 02:16

1 Answers1

0

IntPtr id2d1device1 = Marshal.GetComInterfaceForObject(MyCanvasDevice, typeof(IDirect3DDevice));

P. ful
  • 113
  • 9