CreateRenderTarget error?

Started by
2 comments, last by Dov Sherman 21 years, 1 month ago
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?
Advertisement
You should test hardware support for multisample and for the texture format before requesting them from CreateRenderTarget.

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?
^

This topic is closed to new replies.

Advertisement