Archived

This topic is now archived and is closed to further replies.

Dov Sherman

CreateRenderTarget error?

Recommended Posts

Dov Sherman    122
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?

Share this post


Link to post
Share on other sites
Dov Sherman    122
quote:
Original post by Magnuz Guerra
You should test hardware support for multisample and for the texture format before requesting them from CreateRenderTarget.


I''ve tested for the texture format but how do I test for the multisample?

Share this post


Link to post
Share on other sites