ID3D11Texture2D* pTexture = /*...*/; D3D11_TEXTURE2D_DESC desc; pTexture->GetDesc(&desc); int width = desc.Width; int height = desc.Height;
ID3D11Texture2D* pTexture = /*...*/; D3D11_TEXTURE2D_DESC desc; pTexture->GetDesc(&desc); bool isRenderTarget = (desc.BindFlags & D3D11_BIND_RENDER_TARGET) != 0;This example demonstrates how to check if a texture is a render target by examining the BindFlags field of the D3D11_TEXTURE2D_DESC structure returned by GetDesc. If the D3D11_BIND_RENDER_TARGET flag is set, the texture is a render target. Package/Library: Microsoft DirectX SDK.