Jump to content

View more

Image of the Day

#ld38 #screenshotsaturday Mimosa Fizz action gif #2 https://t.co/TUzdppvfUL
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

"FAILED(ddrval)" or "ddrval==DD_OK"

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 SikCiv   Members   

122
Like
Likes
Like

Posted 07 December 1999 - 04:17 AM

I havnt had any instances, but is 'FAILED(ddrval)' better to use than 'ddrval == DD_OK" when checking for DirectX return errors?



#2 mhkrause   Members   

122
Like
Likes
Like

Posted 06 December 1999 - 05:36 PM

Yes, FAILED and SUCCEEDED are preferred over checking against DD_OK, or S_OK. This is because it is possible for COM interfaces to return multiple success values.



#3 Dave Astle   Distinguished Rhino   

2312
Like
Likes
Like

Posted 07 December 1999 - 04:17 AM

Using the FAILED/SUCCEEDED macros is definitely the preferred method. I've occasionally heard the argument that they are slower than the check for == DD_OK; however, here's the definition of the macros:

code:

#define SUCCEEDED(Status) ((HRESULT)(Status) >= 0)
#define FAILED(Status) ((HRESULT)(Status)<0)

Since macros are inserted before compilation, there shouldn't be any speed decrease doing it this way.

- Dave





Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.