[程式] 請問DirectX裡除錯的方式...

看板GameDesign (遊戲設計)作者 (快點放長假吧@@)時間16年前 (2008/10/26 17:39), 編輯推噓1(103)
留言4則, 3人參與, 最新討論串1/1
DirectX的函式都會告訴我們類似 只要回傳D3D_OK就表示成功, 感覺上是要讓我們把回傳值和 D3D_OK作比較即可 但是我看到網路上一篇文章這樣寫: Virtually all methods in DirectX return an HRESULT for success/failure. The proper way to test if the method failed is with the FAILED macro. There is also a SUCCEEDED macro to test for success. In many examples, success will be tested by comparing the HRESULT with D3D_OK. This is not the proper way to do it. They only guaranteed method of testing for failure is with the supplied macros. 不知道這樣代表什麼意思? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.218.0.112

10/26 23:14, , 1F
簡單的講就是 他只檢查成功 不是成功就是失敗
10/26 23:14, 1F

10/27 00:08, , 2F
隻是幾個macro而已,用不用無所謂,標準的做法是用。你可以看
10/27 00:08, 2F

10/27 00:08, , 3F
看macro的代碼。
10/27 00:08, 3F

10/30 09:03, , 4F
謝謝,我後來去查DirectX SDK也是建議使用Macro
10/30 09:03, 4F
文章代碼(AID): #1913gsNT (GameDesign)
文章代碼(AID): #1913gsNT (GameDesign)