1
Vote

Can't get `GetSharedD3D9` working.

description

I am migrating from SlimDX to SharpDX. I think I have most of it complete, but I'm struggling with the GetSharedD3D9.
            _dx9SharedTexture = new SharpDX.Direct3D9.Texture(
                _d3dDevice,
                texture.Description.Width,
                texture.Description.Height,
                1,
                SharpDX.Direct3D9.Usage.RenderTarget,
                format,
                SharpDX.Direct3D9.Pool.Default,
                ref handle);
With this error:
An unhandled exception of type 'SharpDX.SharpDXException' occurred in SharpDX.dll

Additional information: HRESULT: [0x8876086C], Module: [SharpDX.Direct3D9], ApiCode: [D3DERR_INVALIDCALL/InvalidCall], Message: Unknown

The code is almost the same, except the method to get the resource:

SharpDX:
using (var resource = texture.QueryInterface<SharpDX.DXGI.Resource>())
SlimDX:
using (var resource = new SlimDX.DXGI.Resource(texture))
any idea?

comments