CreateRenderTarget error?
I''m using IDirect3DDevice8::CreateRenderTarget() to create a Direct3D surface. I''m using the SUCCEEDED() macro to test the result from that function like so...
IDirect3DSurface8 *pThumbSurf=NULL;
HRESULT hResult = m_pDirect3DDevice->CreateRenderTarget(iWidth, iHeight, D3DFMT_X8R8G8B8, D3DMULTISAMPLE_4_SAMPLES, FALSE, &pThumbSurf);
if(SUCCEEDED(hResult))
{
// do rendering
}
else
{
// report error
}
This works fine on some systems but, for some of my beta-testers, it always fails the SUCCEEDED() macro and the error resulting from CreateRenderTarget() is not D3DERR_INVALIDCALL, D3DERR_OUTOFVIDEOMEMORY, or E_OUTOFMEMORY, the only error codes listed for this function in the documentation.
Is SUCCEEDED() not a reliable macro to use for this function? Is there another possible error code which is not listed by the documentation?
You should test hardware support for multisample and for the texture format before requesting them from CreateRenderTarget.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement