examples/Qt/ISFEditor/ISFEditor_app/Spout/SpoutGLDXinterop.cpp
//
// COPY FROM THE SHARED DX11 TEXTURE TO A DX11 TEXTURE
//

COPY FROM THE SHARED DX11 TEXTURE TO A DX11 TEXTURE
COPY FROM THE SHARED DX11 TEXTURE TO A DX11 TEXTURE
bool spoutGLDXinterop::ReadTexture(ID3D11Texture2D** texture)
{
	if(!texture || !*texture || GetDX9())
		return false;
	D3D11_TEXTURE2D_DESC desc = { 0 };
	(*texture)->GetDesc(&desc);
	if(desc.Width != (unsigned int)m_TextureInfo.width || desc.Height != (unsigned int)m_TextureInfo.height) {
		return false;
	}
	if(spoutdx.CheckAccess(m_hAccessMutex)) {
		if(g_pImmediateContext)
			g_pImmediateContext->CopyResource(*texture, g_pSharedTexture);
		spoutdx.AllowAccess(m_hAccessMutex); 
		return true;
	}
	spoutdx.AllowAccess(m_hAccessMutex);
	return false;
}
bool spoutGLDXinterop :: ReadTexture ( ID3D11Texture2D * * texture ) { if ( ! texture || ! * texture || GetDX9 ( ) ) return false ; D3D11_TEXTURE2D_DESC desc = { 0 } ; ( * texture ) -> GetDesc ( & desc ) ; if ( desc . Width != ( unsigned int ) m_TextureInfo . width || desc . Height != ( unsigned int ) m_TextureInfo . height ) { return false ; } if ( spoutdx . CheckAccess ( m_hAccessMutex ) ) { if ( g_pImmediateContext ) g_pImmediateContext -> CopyResource ( * texture , g_pSharedTexture ) ; spoutdx . AllowAccess ( m_hAccessMutex ) ; return true ; } spoutdx . AllowAccess ( m_hAccessMutex ) ; return false ; }
COPY FROM THE SHARED DX11 TEXTURE TO A DX11 TEXTURE
COPY FROM THE SHARED DX11 TEXTURE TO A DX11 TEXTURE
// Only for DX11 mode
 // Allow access to the texture
 // Cannot access
