Exception thrown when a DirectX Function fails
| 203 | |
| 204 | // Exception thrown when a DirectX Function fails |
| 205 | class DXException : public Exception |
| 206 | { |
| 207 | |
| 208 | public: |
| 209 | |
| 210 | // Obtains a string for the specified HRESULT error code |
| 211 | DXException(HRESULT hresult) : errorCode(hresult) |
| 212 | { |
| 213 | message = GetDXErrorString(hresult); |
| 214 | } |
| 215 | |
| 216 | DXException(HRESULT hresult, LPCWSTR errorMsg) : errorCode(hresult) |
| 217 | { |
| 218 | message = L"DirectX Error: "; |
| 219 | message += errorMsg; |
| 220 | } |
| 221 | |
| 222 | // Retrieve the error code |
| 223 | HRESULT GetErrorCode() const throw () |
| 224 | { |
| 225 | return errorCode; |
| 226 | } |
| 227 | |
| 228 | protected: |
| 229 | |
| 230 | HRESULT errorCode; // The DX error code |
| 231 | }; |
| 232 | |
| 233 | // Exception thrown when a GDI+ function fails |
| 234 | class GdiPlusException : public Exception |
no outgoing calls
no test coverage detected