This method is causing the problem:
[source lang="csharp"] public void InitialiseTextureSharing() { // A DirectX10 Texture2D sharing the DirectX11 Texture2D sharedResource = new SlimDX.DXGI.Resource(textureD3D11); textureD3D10 = device10_1.OpenSharedResource(sharedResource.SharedHandle); // This fails to compile! }[/source]
I get the following error from the compiler:
The type arguments for method 'SlimDX.Direct3D10.Device.OpenSharedResource<T>(System.IntPtr)' cannot be inferred from the usage. Try specifying the type arguments explicitly.
The wierd thing (to me) is, this code is being ported straight from someone elses which is supposed to work. The original code is:
[source lang="csharp"] // A DirectX10 Texture2D sharing the DirectX11 Texture2D SlimDX.DXGI.Resource sharedResource = new SlimDX.DXGI.Resource(textureD3D11); SlimDX.Direct3D10.Texture2D textureD3D10 = device10_1.OpenSharedResource(sharedResource.SharedHandle);[/source]
The difference with my implementation is I am instantiating the 'sharedResource' and 'textureD3D10' objects in the SlimDX Form.
I certainly didn't expect a compilation error. The code I am basing this on is from: http://www.aaronblog.us/?p=36
... which is all about drawing text in SlimDX with DX11.
I'm totally stumped on this. I've had a look at posts which contain solutions to similar issues, but adapting this to mine is beyond me at present.
Any pointers would be uber-appreciated.
UPDATE:
Signature of OpenSharedResource from SlimDX API docs:
http://slimdx.org/docs/html/M_SlimDX_Direct3D11_Device_OpenSharedResource__1.htm
... and Resource:
http://slimdx.org/docs/html/T_SlimDX_DXGI_Resource.htm
Edited by CdrTomalak, 02 September 2012 - 03:31 PM.






