examples/Qt/ISFEditor/ISFEditor_app/Spout/SpoutGLDXinterop.cpp
//
// Create a new global staging texture if it has changed size or does not exist yet
//

Create a new global staging texture if it has changed size or does not exist yet
Create a new global staging texture if it has changed size or does not exist yet
bool spoutGLDXinterop::CheckStagingTexture(unsigned int width, unsigned int height)
{
	D3D11_TEXTURE2D_DESC desc = { 0 };
	if(g_pStagingTexture) {
		g_pStagingTexture->GetDesc(&desc);
		if(desc.Width != width || desc.Height != height) {
			g_pStagingTexture->Release();
			g_pStagingTexture = NULL;
		}
		else
			return true;
	}
	if(!g_pStagingTexture) {
		if(spoutdx.CreateDX11StagingTexture(g_pd3dDevice, width, height, DX11format, &g_pStagingTexture)) {
			return true;
		}
	}
	return false;
}
bool spoutGLDXinterop :: CheckStagingTexture ( unsigned int width , unsigned int height ) { D3D11_TEXTURE2D_DESC desc = { 0 } ; if ( g_pStagingTexture ) { g_pStagingTexture -> GetDesc ( & desc ) ; if ( desc . Width != width || desc . Height != height ) { g_pStagingTexture -> Release ( ) ; g_pStagingTexture = NULL ; } else return true ; } if ( ! g_pStagingTexture ) { if ( spoutdx . CreateDX11StagingTexture ( g_pd3dDevice , width , height , DX11format , & g_pStagingTexture ) ) { return true ; } } return false ; }
Create a new global staging texture if it has changed size or does not exist yet
Create a new global staging texture if it has changed size or does not exist yet