Rev 1 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1 | Rev 4 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | interface |
3 | interface |
4 | 4 | ||
5 | {$INCLUDE DelphiXcfg.inc} |
5 | {$INCLUDE DelphiXcfg.inc} |
6 | 6 | ||
7 | uses |
7 | uses |
8 | Windows, SysUtils, DirectX; |
8 | Windows, SysUtils, |
- | 9 | {$IfDef StandardDX} |
|
- | 10 | {$ifdef DX7} |
|
- | 11 | DirectDraw, Direct3D,DirectInput,DirectPlay,DirectSound; |
|
- | 12 | {$else} |
|
- | 13 | {$IfDef DX9} |
|
- | 14 | DirectDraw, Direct3D9, Direct3D, D3DX9, {Direct3D8,} DX7toDX8, DirectInput, DirectPlay8, DirectSound; |
|
- | 15 | // {$Else} |
|
- | 16 | // {$IfDef DX81} |
|
- | 17 | // D3DX8, Direct3D8, DirectInput8, DirectXGraphics, DX7toDX8, DirectPlay8; |
|
- | 18 | // {$Else} |
|
- | 19 | // DirectInput, Direct3D, Direct3DRM, DirectPlay; |
|
- | 20 | {$EndIf} |
|
- | 21 | {$EndIf} |
|
- | 22 | {$Else} |
|
- | 23 | DirectX; |
|
- | 24 | {$EndIf} |
|
- | 25 | ||
9 | 26 | ||
10 | function WindowsErrorMsg(ErrorCode: HRESULT): string; |
27 | function WindowsErrorMsg(ErrorCode: HRESULT): string; |
11 | function DDrawErrorMsg(ErrorCode: HRESULT): string; |
28 | function DDrawErrorMsg(ErrorCode: HRESULT): string; |
12 | function D3DErrorMsg(ErrorCode: HRESULT): string; |
29 | function D3DErrorMsg(ErrorCode: HRESULT): string; |
- | 30 | {$IFDEF D3DRM} |
|
13 | function D3DRMErrorMsg(ErrorCode: HRESULT): string; |
31 | function D3DRMErrorMsg(ErrorCode: HRESULT): string; |
- | 32 | {$ENDIF} |
|
14 | function DSoundErrorMsg(ErrorCode: HRESULT): string; |
33 | function DSoundErrorMsg(ErrorCode: HRESULT): string; |
15 | function DInputErrorMsg(ErrorCode: HRESULT): string; |
34 | function DInputErrorMsg(ErrorCode: HRESULT): string; |
16 | function DPlayErrorMsg(ErrorCode: HRESULT): string; |
35 | function DPlayErrorMsg(ErrorCode: HRESULT): string; |
17 | 36 | ||
18 | implementation |
37 | implementation |
Line 202... | Line 221... | ||
202 | D3DERR_NOCURRENTVIEWPORT : Result := 'D3DERR_NOCURRENTVIEWPORT'; |
221 | D3DERR_NOCURRENTVIEWPORT : Result := 'D3DERR_NOCURRENTVIEWPORT'; |
203 | else |
222 | else |
204 | Result := WindowsErrorMsg(ErrorCode); |
223 | Result := WindowsErrorMsg(ErrorCode); |
205 | end; |
224 | end; |
206 | end; |
225 | end; |
207 | 226 | {$IFDEF D3DRM} |
|
208 | function D3DRMErrorMsg(ErrorCode: HRESULT): string; |
227 | function D3DRMErrorMsg(ErrorCode: HRESULT): string; |
209 | begin |
228 | begin |
210 | case ErrorCode of |
229 | case ErrorCode of |
211 | D3DRM_OK : Result := 'D3DRM_OK'; |
230 | D3DRM_OK : Result := 'D3DRM_OK'; |
212 | D3DRMERR_BADALLOC : Result := 'D3DRMERR_BADALLOC'; |
231 | D3DRMERR_BADALLOC : Result := 'D3DRMERR_BADALLOC'; |
Line 224... | Line 243... | ||
224 | D3DRMERR_UNABLETOEXECUTE : Result := 'D3DRMERR_UNABLETOEXECUTE'; |
243 | D3DRMERR_UNABLETOEXECUTE : Result := 'D3DRMERR_UNABLETOEXECUTE'; |
225 | else |
244 | else |
226 | Result := WindowsErrorMsg(ErrorCode); |
245 | Result := WindowsErrorMsg(ErrorCode); |
227 | end; |
246 | end; |
228 | end; |
247 | end; |
229 | 248 | {$ENDIF} |
|
230 | function DSoundErrorMsg(ErrorCode: HRESULT): string; |
249 | function DSoundErrorMsg(ErrorCode: HRESULT): string; |
231 | begin |
250 | begin |
232 | case ErrorCode of |
251 | case ErrorCode of |
233 | DS_OK : Result := 'DS_OK'; |
252 | DS_OK : Result := 'DS_OK'; |
234 | DSERR_ALLOCATED : Result := 'DSERR_ALLOCATED'; |
253 | DSERR_ALLOCATED : Result := 'DSERR_ALLOCATED'; |
Line 269... | Line 288... | ||
269 | DIERR_NOAGGREGATION : Result := 'DIERR_NOAGGREGATION'; |
288 | DIERR_NOAGGREGATION : Result := 'DIERR_NOAGGREGATION'; |
270 | DIERR_OTHERAPPHASPRIO : Result := 'DIERR_OTHERAPPHASPRIO, DIERR_READONLY, DIERR_HANDLEEXISTS'; |
289 | DIERR_OTHERAPPHASPRIO : Result := 'DIERR_OTHERAPPHASPRIO, DIERR_READONLY, DIERR_HANDLEEXISTS'; |
271 | DIERR_INPUTLOST : Result := 'DIERR_INPUTLOST'; |
290 | DIERR_INPUTLOST : Result := 'DIERR_INPUTLOST'; |
272 | DIERR_ACQUIRED : Result := 'DIERR_ACQUIRED'; |
291 | DIERR_ACQUIRED : Result := 'DIERR_ACQUIRED'; |
273 | DIERR_NOTACQUIRED : Result := 'DIERR_NOTACQUIRED'; |
292 | DIERR_NOTACQUIRED : Result := 'DIERR_NOTACQUIRED'; |
274 | E_PENDING : Result := 'E_PENDING'; |
293 | HRESULT(E_PENDING) : Result := 'E_PENDING'; |
275 | else |
294 | else |
276 | Result := WindowsErrorMsg(ErrorCode); |
295 | Result := WindowsErrorMsg(ErrorCode); |
277 | end; |
296 | end; |
278 | end; |
297 | end; |
- | 298 | {$IfDef DX9} |
|
- | 299 | function DPlayErrorMsg(ErrorCode: HRESULT): string; |
|
- | 300 | begin |
|
- | 301 | case ErrorCode of |
|
- | 302 | DPN_OK : Result := 'DPN_OK'; |
|
- | 303 | DPNERR_ALREADYINITIALIZED : Result := 'DPNERR_ALREADYINITIALIZED'; |
|
- | 304 | //DPNERR_ACCESSDENIED : Result := 'DPNERR_ACCESSDENIED'; |
|
- | 305 | //DPNERR_ACTIVEPLAYERS : Result := 'DPNERR_ACTIVEPLAYERS'; |
|
- | 306 | DPNERR_BUFFERTOOSMALL : Result := 'DPNERR_BUFFERTOOSMALL'; |
|
- | 307 | //DPNERR_CANTADDPLAYER : Result := 'DPNERR_CANTADDPLAYER'; |
|
- | 308 | DPNERR_CANTCREATEGROUP : Result := 'DPNERR_CANTCREATEGROUP'; |
|
- | 309 | DPNERR_CANTCREATEPLAYER : Result := 'DPNERR_CANTCREATEPLAYER'; |
|
- | 310 | //DPNERR_CANTCREATESESSION : Result := 'DPNERR_CANTCREATESESSION'; |
|
- | 311 | //DPNERR_CAPSNOTAVAILABLEYET : Result := 'DPNERR_CAPSNOTAVAILABLEYET'; |
|
- | 312 | DPNERR_EXCEPTION : Result := 'DPNERR_EXCEPTION'; |
|
- | 313 | DPNERR_GENERIC : Result := 'DPNERR_GENERIC'; |
|
- | 314 | DPNERR_INVALIDFLAGS : Result := 'DPNERR_INVALIDFLAGS'; |
|
- | 315 | DPNERR_INVALIDOBJECT : Result := 'DPNERR_INVALIDOBJECT'; |
|
- | 316 | DPNERR_INVALIDPARAM : Result := 'DPNERR_INVALIDPARAM, DPNERR_INVALIDPARAMS'; |
|
- | 317 | DPNERR_INVALIDPLAYER : Result := 'DPNERR_INVALIDPLAYER'; |
|
- | 318 | DPNERR_INVALIDGROUP : Result := 'DPNERR_INVALIDGROUP'; |
|
- | 319 | DPNERR_NOCAPS : Result := 'DPNERR_NOCAPS'; |
|
- | 320 | DPNERR_NOCONNECTION : Result := 'DPNERR_NOCONNECTION'; |
|
- | 321 | //DPNERR_NOMEMORY : Result := 'DPNERR_NOMEMORY, DPNERR_OUTOFMEMORY'; |
|
- | 322 | //DPNERR_NOMESSAGES : Result := 'DPNERR_NOMESSAGES'; |
|
- | 323 | //DPNERR_NONAMESERVERFOUND : Result := 'DPNERR_NONAMESERVERFOUND'; |
|
- | 324 | //DPNERR_NOPLAYERS : Result := 'DPNERR_NOPLAYERS'; |
|
- | 325 | //DPNERR_NOSESSIONS : Result := 'DPNERR_NOSESSIONS'; |
|
- | 326 | DPNERR_PENDING : Result := 'DPNERR_PENDING'; |
|
- | 327 | //DPNERR_SENDTOOBIG : Result := 'DPNERR_SENDTOOBIG'; |
|
- | 328 | //DPNERR_TIMEOUT : Result := 'DPNERR_TIMEOUT'; |
|
- | 329 | //DPNERR_UNAVAILABLE : Result := 'DPNERR_UNAVAILABLE'; |
|
- | 330 | DPNERR_UNSUPPORTED : Result := 'DPNERR_UNSUPPORTED'; |
|
- | 331 | //DPNERR_BUSY : Result := 'DPNERR_BUSY'; |
|
- | 332 | DPNERR_USERCANCEL : Result := 'DPNERR_USERCANCEL'; |
|
- | 333 | DPNERR_NOINTERFACE : Result := 'DPNERR_NOINTERFACE'; |
|
- | 334 | //DPNERR_CANNOTCREATESERVER : Result := 'DPNERR_CANNOTCREATESERVER'; |
|
- | 335 | DPNERR_PLAYERLOST : Result := 'DPNERR_PLAYERLOST'; |
|
- | 336 | //DPNERR_SESSIONLOST : Result := 'DPNERR_SESSIONLOST'; |
|
- | 337 | DPNERR_UNINITIALIZED : Result := 'DPNERR_UNINITIALIZED'; |
|
- | 338 | //DPNERR_NONEWPLAYERS : Result := 'DPNERR_NONEWPLAYERS'; |
|
- | 339 | DPNERR_INVALIDPASSWORD : Result := 'DPNERR_INVALIDPASSWORD'; |
|
- | 340 | DPNERR_CONNECTING : Result := 'DPNERR_CONNECTING'; |
|
- | 341 | //DPNERR_BUFFERTOOLARGE : Result := 'DPNERR_BUFFERTOOLARGE'; |
|
- | 342 | //DPNERR_CANTCREATEPROCESS : Result := 'DPNERR_CANTCREATEPROCESS'; |
|
- | 343 | //DPNERR_APPNOTSTARTED : Result := 'DPNERR_APPNOTSTARTED'; |
|
- | 344 | DPNERR_INVALIDINTERFACE : Result := 'DPNERR_INVALIDINTERFACE'; |
|
- | 345 | //DPNERR_NOSERVICEPROVIDER : Result := 'DPNERR_NOSERVICEPROVIDER'; |
|
- | 346 | //DPNERR_UNKNOWNAPPLICATION : Result := 'DPNERR_UNKNOWNAPPLICATION'; |
|
- | 347 | //DPNERR_NOTLOBBIED : Result := 'DPNERR_NOTLOBBIED'; |
|
- | 348 | //DPNERR_SERVICEPROVIDERLOADED : Result := 'DPNERR_SERVICEPROVIDERLOADED'; |
|
- | 349 | DPNERR_NOTREGISTERED : Result := 'DPNERR_NOTREGISTERED'; |
|
- | 350 | // Security related errors |
|
- | 351 | //DPNERR_AUTHENTICATIONFAILED : Result := 'DPNERR_AUTHENTICATIONFAILED'; |
|
- | 352 | //DPNERR_CANTLOADSSPI : Result := 'DPNERR_CANTLOADSSPI'; |
|
- | 353 | //DPNERR_ENCRYPTIONFAILED : Result := 'DPNERR_ENCRYPTIONFAILED'; |
|
- | 354 | //DPNERR_SIGNFAILED : Result := 'DPNERR_SIGNFAILED'; |
|
- | 355 | //DPNERR_CANTLOADSECURITYPACKAGE : Result := 'DPNERR_CANTLOADSECURITYPACKAGE'; |
|
- | 356 | //DPNERR_ENCRYPTIONNOTSUPPORTED : Result := 'DPNERR_ENCRYPTIONNOTSUPPORTED'; |
|
- | 357 | //DPNERR_CANTLOADCAPI : Result := 'DPNERR_CANTLOADCAPI'; |
|
- | 358 | //DPNERR_NOTLOGGEDIN : Result := 'DPNERR_NOTLOGGEDIN'; |
|
- | 359 | //DPNERR_LOGONDENIED : Result := 'DPNERR_LOGONDENIED'; |
|
- | 360 | else |
|
- | 361 | Result := WindowsErrorMsg(ErrorCode); |
|
- | 362 | end; |
|
279 | 363 | end; |
|
- | 364 | {$Else} |
|
280 | function DPlayErrorMsg(ErrorCode: HRESULT): string; |
365 | function DPlayErrorMsg(ErrorCode: HRESULT): string; |
281 | begin |
366 | begin |
282 | case ErrorCode of |
367 | case ErrorCode of |
283 | DP_OK : Result := 'DP_OK'; |
368 | DP_OK : Result := 'DP_OK'; |
284 | DPERR_ALREADYINITIALIZED : Result := 'DPERR_ALREADYINITIALIZED'; |
369 | DPERR_ALREADYINITIALIZED : Result := 'DPERR_ALREADYINITIALIZED'; |
Line 340... | Line 425... | ||
340 | DPERR_LOGONDENIED : Result := 'DPERR_LOGONDENIED'; |
425 | DPERR_LOGONDENIED : Result := 'DPERR_LOGONDENIED'; |
341 | else |
426 | else |
342 | Result := WindowsErrorMsg(ErrorCode); |
427 | Result := WindowsErrorMsg(ErrorCode); |
343 | end; |
428 | end; |
344 | end; |
429 | end; |
345 | 430 | {$EndIf} |
|
346 | end. |
431 | end. |