Jump to content
  • Advertisement

Archived

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

a_nick

Getting a error description out of a DirectDraw error, like sterror().

This topic is 6696 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

How can i convert the number i get from DirectDraw functions to a descriptive string, so that i know what the problem is.

Share this post


Link to post
Share on other sites
Advertisement
Well, the way we do it here is by writing our own function that takes in a number and returns a string to the debugger.

Yeah, it''s not the funnest thing to write, but it comes in real handy at times.

Share this post


Link to post
Share on other sites
If you look for the definition of some of the error codes in the header files, there is a description there which you can copy. You could make the whole thing one big switch statement quite quickly with a few search-and-replaces, I think.

The other option is that I think D3DX has an error reporting function, but even that seems flawed - I tried to run one of the samples that come with the SDK and it returned an Unknown error! If MS don''t know what the error is, how am I supposed to!? Oh well.

Share this post


Link to post
Share on other sites
The Problem with this unknown Error, has not to be the fault of the Error reporting Function. I tried to write a Programm whch uses the DirectDraw Videoport, and there i recieve this unknown Error, and i checked all Error Codes manually, but there is no Explanation for this in the whole documentation. So it looks like they Forget to mention some of their Return Values

Lars

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
If you want to avoid this Cut''n''Paste thingy, just check out the Delphi-Conversion of the DirectX Header Files by Erik Unger. You can find his Stuff on http://www.delphi-jedi.ord/DelphiGraphics/. He has written a nice little function which returns you a short error message depending on the ErrorCode. You just have to convert this Code to your favorite programming language. A little bonus: his Error-functions are avaible for other parts of DirectX, too. But if you want to use it for a commercial product, you should at first contact Erik and ask him for it, just to avoid any Copyright-related problems.

Hope it helped

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!