Sign in to follow this  
allbabel

OpenSharedResource renders black

Recommended Posts

I am a newbie to DirectX and I have a problem with OpenSharedResource.

I am aquiring a handle to a shared resource from one process and wanting to display this same resource in a secondary process.

In the secondary process I get a texture handle to the shared resource:

[CODE]
_d3dDevice->OpenSharedResource( _sharedHandle, __uuidof(ID3D10Texture2D), (LPVOID*) &_sharedTexture );
[/CODE]

I then copy this resource to my back buffer, pBuffer:

[CODE]
HRESULT hr = _sharedTexture->QueryInterface( __uuidof( ID3D10Resource ), ( void** )&pSrcResource );

if ( FAILED( hr ) )
return hr;

D3D10_TEXTURE2D_DESC desc;
ZeroMemory( &desc, sizeof(desc) );
_sharedTexture->GetDesc( &desc );

_d3dDevice->CopySubresourceRegion( pBuffer, 0, 0, 0, 0, pSrcResource, 0, 0 );
[/CODE]

What I get is a black square drawn to my window. If I check the D3D10_TEXTURE2D_DESC I can see I have the correct dimensions etc but what appears on the screen seems to be a null texture.

Any ideas where I am going wrong? Is there something I need to do to the shared resource before I call CopySubresourceRegion? Should I be using a different technique to get at the shared resource?

Thanks in advance, Andy

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this