• Advertisement
Sign in to follow this  

d3d debugging

This topic is 3857 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Should we continue to check HRESULTs when not in debug mode? I ask because the DXUT.h file has something like this: #if defined(DEBUG) || defined(_DEBUG) #ifndef V #define V(x) { hr = (x); if( FAILED(hr) ) { DXUTTrace( __FILE__, (DWORD)__LINE__, hr, L#x, true ); } } #endif #ifndef V_RETURN #define V_RETURN(x) { hr = (x); if( FAILED(hr) ) { return DXUTTrace( __FILE__, (DWORD)__LINE__, hr, L#x, true ); } } #endif #else #ifndef V #define V(x) { hr = (x); } #endif #ifndef V_RETURN #define V_RETURN(x) { hr = (x); if( FAILED(hr) ) { return hr; } } #endif #endif It seems reasonable not to. After all, once your game is burned to a CD you are out of luck if a resource is missing or you have shader bugs. This is especially true for consoles. On the other hand, displaying the error message, line number and file name can help you figure out the problem if you need to issue a patch online.

Share this post


Link to post
Share on other sites
Advertisement
Always check error codes for functions that create resources or return pointers (E.g. Lock()), since if that fails, you'll just crash when you try to access the pointer.

Macros like that are handy for E.g. SetRenderState() and other less important functions.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement