Archived

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

SikCiv

Whats with DirectX8 error return codes?

Recommended Posts

During the days of DirectX7, most functions would return a number of HRESULT return code to tell you what went wrong, which was cool, but nowadays with DirectX8, most of the functions only return one or two HRESULT return codes (usually D3DERR_INVALIDCALL) resulting in a blindfolded debugging scenario. Have M$ slacked off recently, or do they have a genuine purpose for doing this?

  Game Download  ZeroOne Realm

Share this post


Link to post
Share on other sites
Usually the return codes make sense for the call. If you have a call (taking this example from the SkinMesh Sample) that potentially uses a large amount of memory, you might get an E_OUTOFMEMORY, or, if you passed in a bad argument (NULL, etc), you might get back E_INVALIDARG. It all depends on the paremters you pass in. Some functions might return a sucess code and one error code, and nothing else, others have 5 or 6 error codes.

Z.

Share this post


Link to post
Share on other sites
Its ok for functions with only a few params, but for example D3DXLoadTextureFromFileInMemory() takes over 10 args, and if you look at the SDK, there are only a couple of error return codes for all the args...

Im guessing M$ had to rush DX8 due to the XBox and therefore didnt bother to be specific with error codes or something..

  Game Download  ZeroOne Realm

Share this post


Link to post
Share on other sites