examples/Qt/ISFEditor/ISFEditor_app/Spout/SpoutGLDXinterop.cpp
//
// If a DX9 CPU texture surface has not been created  or is a different size, create a new one
//

If a DX9 CPU texture surface has not been created  or is a different size, create a new one
If a DX9 CPU texture surface has not been created or is a different size create a new one
bool spoutGLDXinterop::CheckDX9surface(unsigned int width, unsigned int height)
{
	HRESULT hr;
	D3DSURFACE_DESC desc; 
	if(g_DX9surface) {
		g_DX9surface->GetDesc(&desc);
		if(desc.Width != width || desc.Height != height) {
			g_DX9surface->Release();
			g_DX9surface = NULL;
		}
		else
			return true;
	}
	if(!g_DX9surface) {
		hr = m_pDevice->CreateOffscreenPlainSurface(width, height, DX9format, D3DPOOL_SYSTEMMEM, &g_DX9surface, NULL);
		if(SUCCEEDED(hr))
			return true;
	}
	return false;
}
bool spoutGLDXinterop :: CheckDX9surface ( unsigned int width , unsigned int height ) { HRESULT hr ; D3DSURFACE_DESC desc ; if ( g_DX9surface ) { g_DX9surface -> GetDesc ( & desc ) ; if ( desc . Width != width || desc . Height != height ) { g_DX9surface -> Release ( ) ; g_DX9surface = NULL ; } else return true ; } if ( ! g_DX9surface ) { hr = m_pDevice -> CreateOffscreenPlainSurface ( width , height , DX9format , D3DPOOL_SYSTEMMEM , & g_DX9surface , NULL ) ; if ( SUCCEEDED ( hr ) ) return true ; } return false ; }
If a DX9 CPU texture surface has not been created  or is a different size, create a new one
If a DX9 CPU texture surface has not been created or is a different size create a new one
// Surface description
 // Create a CPU accessable surface to get pixels from the shared texture
