Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

dx_errors.cpp

Go to the documentation of this file.
00001 /*
00002         $Id: dx_errors.cpp,v 1.1 2001/03/06 15:09:17 mbn Exp $
00003 
00004         ------------------------------------------------------------------------
00005         ClanLib, the platform independent game SDK.
00006 
00007         This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE
00008         version 2. See COPYING for details.
00009 
00010         For a total list of contributers see CREDITS.
00011 
00012         ------------------------------------------------------------------------
00013 */
00014 
00015 #include "Core/precomp.h"
00016 #include "dx_errors.h"
00017 
00018 char *get_dderr(HRESULT errcode)
00019 {
00020         switch(errcode)
00021         {
00022         case DDERR_ALREADYINITIALIZED:
00023                 return "DDERR_ALREADYINITIALIZED: This object is already initialized";
00024 
00025         case DDERR_CANNOTATTACHSURFACE:
00026                 return "DDERR_CANNOTATTACHSURFACE: This surface can not be attached to the requested surface.";
00027 
00028         case DDERR_CANNOTDETACHSURFACE:
00029                 return "DDERR_CANNOTDETACHSURFACE: This surface can not be detached from the requested surface.";
00030 
00031         case DDERR_CURRENTLYNOTAVAIL:
00032                 return "DDERR_CURRENTLYNOTAVAIL : Support is currently not available.";
00033 
00034         case DDERR_EXCEPTION:
00035                 return "DDERR_EXCEPTION: An exception was encountered while performing the requested operation";
00036 
00037         case DDERR_GENERIC:
00038                 return "DDERR_GENERIC: Generic failure.";
00039 
00040         case DDERR_HEIGHTALIGN:
00041                 return "DDERR_HEIGHTALIGN: Height of rectangle provided is not a multiple of reqd alignment";
00042 
00043         case DDERR_INCOMPATIBLEPRIMARY:
00044                 return "DDERR_INCOMPATIBLEPRIMARY: Unable to match primary surface creation request with existing";
00045 
00046         case DDERR_INVALIDCAPS:
00047                 return "DDERR_INVALIDCAPS: One or more of the caps bits passed to the callback are incorrect.";
00048 
00049         case DDERR_INVALIDCLIPLIST:
00050                 return "DDERR_INVALIDCLIPLIST: DirectDraw does not support provided Cliplist.";
00051 
00052         case DDERR_INVALIDMODE:
00053                 return "DDERR_INVALIDMODE: DirectDraw does not support the requested mode";
00054 
00055         case DDERR_INVALIDOBJECT:
00056                 return "DDERR_INVALIDOBJECT: DirectDraw received a pointer that was an invalid DIRECTDRAW object.";
00057 
00058         case DDERR_INVALIDPARAMS:
00059                 return "DDERR_INVALIDPARAMS: One or more of the parameters passed to the callback function are incorrect";
00060 
00061         case DDERR_INVALIDPIXELFORMAT:
00062                 return "DDERR_INVALIDPIXELFORMAT: pixel format was invalid as specified";
00063 
00064         case DDERR_INVALIDRECT:
00065                 return "DDERR_INVALIDRECT: Rectangle provided was invalid.";
00066 
00067         case DDERR_LOCKEDSURFACES:
00068                 return "DDERR_LOCKEDSURFACES: Operation could not be carried out because one or more surfaces are locked";
00069 
00070         case DDERR_NO3D:
00071                 return "DDERR_NO3D: There is no 3D present.";
00072 
00073         case DDERR_NOALPHAHW:
00074                 return "DDERR_NOALPHAHW: Operation could not be carried out because there is no alpha accleration";
00075 
00076         case DDERR_NOCLIPLIST:
00077                 return "DDERR_NOCLIPLIST: no clip list available";
00078 
00079         case DDERR_NOCOLORCONVHW:
00080                 return "DDERR_NOCOLORCONVHW: Operation could not be carried out because there is no color conversion hardware present or available.";
00081 
00082         case DDERR_NOCOOPERATIVELEVELSET:
00083                 return "DDERR_NOCOOPERATIVELEVELSET: Create function called without DirectDraw object method SetCooperativeLevel being called.";
00084 
00085         case DDERR_NOCOLORKEY:
00086                 return "DDERR_NOCOLORKEY: Surface doesn't currently have a color key";
00087 
00088         case DDERR_NOCOLORKEYHW:
00089                 return "DDERR_NOCOLORKEYHW: Operation could not be carried out because there is no hardware support of the dest color key.";
00090 
00091         case DDERR_NODIRECTDRAWSUPPORT:
00092                 return "DDERR_NODIRECTDRAWSUPPORT: No DirectDraw support possible with current display driver";
00093 
00094         case DDERR_NOEXCLUSIVEMODE:
00095                 return "DDERR_NOEXCLUSIVEMODE: Operation requires the application to have exclusive mode but the application does not have exclusive mode.";
00096 
00097         case DDERR_NOFLIPHW:
00098                 return "DDERR_NOFLIPHW: Flipping visible surfaces is not supported.";
00099 
00100         case DDERR_NOGDI:
00101                 return "DDERR_NOGDI: There is no GDI present.";
00102 
00103         case DDERR_NOMIRRORHW:
00104                 return "DDERR_NOMIRRORHW: Operation could not be carried out because there is no hardware present or available.";
00105 
00106         case DDERR_NOTFOUND:
00107                 return "DDERR_NOTFOUND: Requested item was not found";
00108 
00109         case DDERR_NOOVERLAYHW:
00110                 return "DDERR_NOOVERLAYHW: Operation could not be carried out because there is no overlay hardware present or available.";
00111 
00112         case DDERR_NORASTEROPHW:
00113                 return "DDERR_NORASTEROPHW: Operation could not be carried out because there is no appropriate raster op hardware present or available.";
00114 
00115         case DDERR_NOROTATIONHW:
00116                 return "DDERR_NOROTATIONHW: Operation could not be carried out because there is no rotation hardware present or available.";
00117 
00118         case DDERR_NOSTRETCHHW:
00119                 return "DDERR_NOSTRETCHHW: Operation could not be carried out because there is no hardware support for stretching";
00120 
00121         case DDERR_NOT4BITCOLOR:
00122                 return "DDERR_NOT4BITCOLOR: DirectDrawSurface is not in 4 bit color palette and the requested operation requires 4 bit color palette.";
00123 
00124         case DDERR_NOT4BITCOLORINDEX:
00125                 return "DDERR_NOT4BITCOLORINDEX: DirectDrawSurface is not in 4 bit color index palette and the requested operation requires 4 bit color index palette.";
00126 
00127         case DDERR_NOT8BITCOLOR:
00128                 return "DDERR_NOT8BITCOLOR: DirectDraw Surface is not in 8 bit color mode and the requested operation requires 8 bit color.";
00129 
00130         case DDERR_NOTEXTUREHW:
00131                 return "DDERR_NOTEXTUREHW: Operation could not be carried out because there is no texture mapping hardware present or available.";
00132 
00133         case DDERR_NOVSYNCHW:
00134                 return "DDERR_NOVSYNCHW: Operation could not be carried out because there is no hardware support for vertical blank synchronized operations.";
00135 
00136         case DDERR_NOZBUFFERHW:
00137                 return "DDERR_NOZBUFFERHW: Operation could not be carried out because there is no hardware support for zbuffer blting.";
00138 
00139         case DDERR_NOZOVERLAYHW:
00140                 return "DDERR_NOZOVERLAYHW: Overlay surfaces could not be z layered based on their BltOrder because the hardware does not support z layering of overlays.";
00141 
00142         case DDERR_OUTOFCAPS:
00143                 return "DDERR_OUTOFCAPS: The hardware needed for the requested operation has already been allocated.";
00144 
00145         case DDERR_OUTOFMEMORY:
00146                 return "DDERR_OUTOFMEMORY: DirectDraw does not have enough memory to perform the operation.";
00147 
00148         case DDERR_OUTOFVIDEOMEMORY:
00149                 return "DDERR_OUTOFVIDEOMEMORY: DirectDraw does not have enough memory to perform the operation.";
00150 
00151         case DDERR_OVERLAYCANTCLIP:
00152                 return "DDERR_OVERLAYCANTCLIP: hardware does not support clipped overlays";
00153 
00154         case DDERR_OVERLAYCOLORKEYONLYONEACTIVE:
00155                 return "DDERR_OVERLAYCOLORKEYONLYONEACTIVE: Can only have ony color key active at one time for overlays";
00156 
00157         case DDERR_PALETTEBUSY:
00158                 return "DDERR_PALETTEBUSY: Access to this palette is being refused because the palette is already locked by another thread.";
00159 
00160         case DDERR_COLORKEYNOTSET:
00161                 return "DDERR_COLORKEYNOTSET: No src color key specified for this operation.";
00162 
00163         case DDERR_SURFACEALREADYATTACHED:
00164                 return "DDERR_SURFACEALREADYATTACHED: This surface is already attached to the surface it is being attached to.";
00165 
00166         case DDERR_SURFACEALREADYDEPENDENT:
00167                 return "DDERR_SURFACEALREADYDEPENDENT: This surface is already a dependency of the surface it is being made a dependency of.";
00168 
00169         case DDERR_SURFACEBUSY:
00170                 return "DDERR_SURFACEBUSY: Access to this surface is being refused because the surface is already locked by another thread.";
00171 
00172         case DDERR_CANTLOCKSURFACE:
00173                 return "DDERR_CANTLOCKSURFACE: Access to this surface is being refused because no driver exists which can supply a pointer to the surface. This is most likely to happen when attempting to lock the primary surface when no DCI provider is present. Will also happen on attempts to lock an optimized surface.";
00174 
00175         case DDERR_SURFACEISOBSCURED:
00176                 return "DDERR_SURFACEISOBSCURED: Access to Surface refused because Surface is obscured.";
00177 
00178         case DDERR_SURFACELOST:
00179                 return "DDERR_SURFACELOST: Access to this surface is being refused because the surface is gone. The DIRECTDRAWSURFACE object representing this surface should have Restore called on it.";
00180 
00181         case DDERR_SURFACENOTATTACHED:
00182                 return "DDERR_SURFACENOTATTACHED: The requested surface is not attached.";
00183 
00184         case DDERR_TOOBIGHEIGHT:
00185                 return "DDERR_TOOBIGHEIGHT: Height requested by DirectDraw is too large.";
00186 
00187         case DDERR_TOOBIGSIZE:
00188                 return "DDERR_TOOBIGSIZE: Size requested by DirectDraw is too large --   The individual height and width are OK.";
00189 
00190         case DDERR_TOOBIGWIDTH:
00191                 return "DDERR_TOOBIGWIDTH: Width requested by DirectDraw is too large.";
00192 
00193         case DDERR_UNSUPPORTED:
00194                 return "DDERR_UNSUPPORTED: Action not supported.";
00195 
00196         case DDERR_UNSUPPORTEDFORMAT:
00197                 return "DDERR_UNSUPPORTEDFORMAT: FOURCC format requested is unsupported by DirectDraw";
00198 
00199         case DDERR_UNSUPPORTEDMASK:
00200                 return "DDERR_UNSUPPORTEDMASK: Bitmask in the pixel format requested is unsupported by DirectDraw";
00201 
00202         case DDERR_VERTICALBLANKINPROGRESS:
00203                 return "DDERR_VERTICALBLANKINPROGRESS: vertical blank is in progress";
00204 
00205         case DDERR_WASSTILLDRAWING:
00206                 return "DDERR_WASSTILLDRAWING: Informs DirectDraw that the previous Blt which is transfering information to or from this Surface is incomplete.";
00207 
00208         case DDERR_XALIGN:
00209                 return "DDERR_XALIGN: Rectangle provided was not horizontally aligned on reqd. boundary";
00210 
00211         case DDERR_INVALIDDIRECTDRAWGUID:
00212                 return "DDERR_INVALIDDIRECTDRAWGUID: The GUID passed to DirectDrawCreate is not a valid DirectDraw driver identifier.";
00213 
00214         case DDERR_DIRECTDRAWALREADYCREATED:
00215                 return "DDERR_DIRECTDRAWALREADYCREATED: A DirectDraw object representing this driver has already been created for this process.";
00216 
00217         case DDERR_NODIRECTDRAWHW:
00218                 return "DDERR_NODIRECTDRAWHW: A hardware only DirectDraw object creation was attempted but the driver did not support any hardware.";
00219 
00220         case DDERR_PRIMARYSURFACEALREADYEXISTS:
00221                 return "DDERR_PRIMARYSURFACEALREADYEXISTS: this process already has created a primary surface";
00222 
00223         case DDERR_NOEMULATION:
00224                 return "DDERR_NOEMULATION: software emulation not available.";
00225 
00226         case DDERR_REGIONTOOSMALL:
00227                 return "DDERR_REGIONTOOSMALL: region passed to Clipper::GetClipList is too small.";
00228 
00229         case DDERR_CLIPPERISUSINGHWND:
00230                 return "DDERR_CLIPPERISUSINGHWND: an attempt was made to set a clip list for a clipper objec that is already monitoring an hwnd.";
00231 
00232         case DDERR_NOCLIPPERATTACHED:
00233                 return "DDERR_NOCLIPPERATTACHED: No clipper object attached to surface object";
00234 
00235         case DDERR_NOHWND:
00236                 return "DDERR_NOHWND: Clipper notification requires an HWND or no HWND has previously been set as the CooperativeLevel HWND.";
00237 
00238         case DDERR_HWNDSUBCLASSED:
00239                 return "DDERR_HWNDSUBCLASSED: HWND used by DirectDraw CooperativeLevel has been subclassed, this prevents DirectDraw from restoring state.";
00240 
00241         case DDERR_HWNDALREADYSET:
00242                 return "DDERR_HWNDALREADYSET: The CooperativeLevel HWND has already been set. It can not be reset while the process has surfaces or palettes created.";
00243 
00244         case DDERR_NOPALETTEATTACHED:
00245                 return "DDERR_NOPALETTEATTACHED: No palette object attached to this surface.";
00246 
00247         case DDERR_NOPALETTEHW:
00248                 return "DDERR_NOPALETTEHW: No hardware support for 16 or 256 color palettes.";
00249 
00250         case DDERR_BLTFASTCANTCLIP:
00251                 return "DDERR_BLTFASTCANTCLIP: If a clipper object is attached to the source surface passed into a BltFast call.";
00252 
00253         case DDERR_NOBLTHW:
00254                 return "DDERR_NOBLTHW: No blter.";
00255 
00256         case DDERR_NODDROPSHW:
00257                 return "DDERR_NODDROPSHW: No DirectDraw ROP hardware.";
00258 
00259         case DDERR_OVERLAYNOTVISIBLE:
00260                 return "DDERR_OVERLAYNOTVISIBLE: returned when GetOverlayPosition is called on a hidden overlay";
00261 
00262         case DDERR_NOOVERLAYDEST:
00263                 return "DDERR_NOOVERLAYDEST: returned when GetOverlayPosition is called on a overlay that UpdateOverlay has never been called on to establish a destionation.";
00264 
00265         case DDERR_INVALIDPOSITION:
00266                 return "DDERR_INVALIDPOSITION: returned when the position of the overlay on the destionation is no longer legal for that destionation.";
00267 
00268         case DDERR_NOTAOVERLAYSURFACE:
00269                 return "DDERR_NOTAOVERLAYSURFACE: returned when an overlay member is called for a non-overlay surface";
00270 
00271         case DDERR_EXCLUSIVEMODEALREADYSET:
00272                 return "DDERR_EXCLUSIVEMODEALREADYSET: An attempt was made to set the cooperative level when it was already set to exclusive.";
00273 
00274         case DDERR_NOTFLIPPABLE:
00275                 return "DDERR_NOTFLIPPABLE: An attempt has been made to flip a surface that is not flippable.";
00276 
00277         case DDERR_CANTDUPLICATE:
00278                 return "DDERR_CANTDUPLICATE: Can't duplicate primary & 3D surfaces, or surfaces that are implicitly created.";
00279 
00280         case DDERR_NOTLOCKED:
00281                 return "DDERR_NOTLOCKED: Surface was not locked.        An attempt to unlock a surface that was not locked at all, or by this process, has been attempted.";
00282 
00283         case DDERR_CANTCREATEDC:
00284                 return "DDERR_CANTCREATEDC: Windows can not create any more DCs";
00285 
00286         case DDERR_NODC:
00287                 return "DDERR_NODC: No DC was ever created for this surface.";
00288 
00289         case DDERR_WRONGMODE:
00290                 return "DDERR_WRONGMODE: This surface can not be restored because it was created in a different mode.";
00291 
00292         case DDERR_IMPLICITLYCREATED:
00293                 return "DDERR_IMPLICITLYCREATED: This surface can not be restored because it is an implicitly created surface.";
00294 
00295         case DDERR_NOTPALETTIZED:
00296                 return "DDERR_NOTPALETTIZED: The surface being used is not a palette-based surface";
00297 
00298         case DDERR_UNSUPPORTEDMODE:
00299                 return "DDERR_UNSUPPORTEDMODE: The display is currently in an unsupported mode";
00300 
00301         case DDERR_NOMIPMAPHW:
00302                 return "DDERR_NOMIPMAPHW: Operation could not be carried out because there is no mip-map texture mapping hardware present or available.";
00303 
00304         case DDERR_INVALIDSURFACETYPE:
00305                 return "DDERR_INVALIDSURFACETYPE: The requested action could not be performed because the surface was of the wrong type.";
00306 
00307         case DDERR_NOOPTIMIZEHW:
00308                 return "DDERR_NOOPTIMIZEHW: Device does not support optimized surfaces, therefore no video memory optimized surfaces";
00309 
00310         case DDERR_NOTLOADED:
00311                 return "DDERR_NOTLOADED: Surface is an optimized surface, but has not yet been allocated any memory";
00312 
00313         case DDERR_DCALREADYCREATED:
00314                 return "DDERR_DCALREADYCREATED: A DC has already been returned for this surface. Only one DC can be retrieved per surface.";
00315 
00316         case DDERR_NONONLOCALVIDMEM:
00317                 return "DDERR_NONONLOCALVIDMEM: An attempt was made to allocate non-local video memory from a device that does not support non-local video memory.";
00318 
00319         case DDERR_CANTPAGELOCK:
00320                 return "DDERR_CANTPAGELOCK: The attempt to page lock a surface failed.";
00321 
00322         case DDERR_CANTPAGEUNLOCK:
00323                 return "DDERR_CANTPAGEUNLOCK: The attempt to page unlock a surface failed.";
00324 
00325         case DDERR_NOTPAGELOCKED:
00326                 return "DDERR_NOTPAGELOCKED: An attempt was made to page unlock a surface with no outstanding page locks.";
00327 
00328         case DDERR_MOREDATA:
00329                 return "DDERR_MOREDATA: There is more data available than the specified buffer size could hold";
00330 
00331         case DDERR_VIDEONOTACTIVE:
00332                 return "DDERR_VIDEONOTACTIVE: The video port is not active";
00333 
00334         case DDERR_DEVICEDOESNTOWNSURFACE:
00335                 return "DDERR_DEVICEDOESNTOWNSURFACE: Surfaces created by one direct draw device cannot be used directly by another direct draw device.";
00336 
00337         case DDERR_NOTINITIALIZED:
00338                 return "DDERR_NOTINITIALIZED: An attempt was made to invoke an interface member of a DirectDraw object created by CoCreateInstance() before it was initialized.";
00339 
00340                 default:
00341                         return "Unknown generic directdraw error";
00342         }
00343 }
00344 
00345 char *get_d3derr(HRESULT err)
00346 {
00347         char *res1 = get_dderr(err);
00348         if (res1 != NULL) return res1;
00349         switch(err) 
00350         {
00351                 case D3DERR_BADMAJORVERSION:
00352                                 return "D3DERR_BADMAJORVERSION\0";
00353                 case D3DERR_BADMINORVERSION:
00354                                 return "D3DERR_BADMINORVERSION\0";
00355                 case D3DERR_EXECUTE_LOCKED:
00356                                 return "D3DERR_EXECUTE_LOCKED\0";
00357                 case D3DERR_EXECUTE_NOT_LOCKED:
00358                                 return "D3DERR_EXECUTE_NOT_LOCKED\0";
00359                 case D3DERR_EXECUTE_CREATE_FAILED:
00360                                 return "D3DERR_EXECUTE_CREATE_FAILED\0";
00361                 case D3DERR_EXECUTE_DESTROY_FAILED:
00362                                 return "D3DERR_EXECUTE_DESTROY_FAILED\0";
00363                 case D3DERR_EXECUTE_LOCK_FAILED:
00364                                 return "D3DERR_EXECUTE_LOCK_FAILED\0";
00365                 case D3DERR_EXECUTE_UNLOCK_FAILED:
00366                                 return "D3DERR_EXECUTE_UNLOCK_FAILED\0";
00367                 case D3DERR_EXECUTE_FAILED:
00368                                 return "D3DERR_EXECUTE_FAILED\0";
00369                 case D3DERR_EXECUTE_CLIPPED_FAILED:
00370                                 return "D3DERR_EXECUTE_CLIPPED_FAILED\0";
00371                 case D3DERR_TEXTURE_NO_SUPPORT:
00372                                 return "D3DERR_TEXTURE_NO_SUPPORT\0";
00373                 case D3DERR_TEXTURE_NOT_LOCKED:
00374                                 return "D3DERR_TEXTURE_NOT_LOCKED\0";
00375                 case D3DERR_TEXTURE_LOCKED:
00376                                 return "D3DERR_TEXTURELOCKED\0";
00377                 case D3DERR_TEXTURE_CREATE_FAILED:
00378                                 return "D3DERR_TEXTURE_CREATE_FAILED\0";
00379                 case D3DERR_TEXTURE_DESTROY_FAILED:
00380                                 return "D3DERR_TEXTURE_DESTROY_FAILED\0";
00381                 case D3DERR_TEXTURE_LOCK_FAILED:
00382                                 return "D3DERR_TEXTURE_LOCK_FAILED\0";
00383                 case D3DERR_TEXTURE_UNLOCK_FAILED:
00384                                 return "D3DERR_TEXTURE_UNLOCK_FAILED\0";
00385                 case D3DERR_TEXTURE_LOAD_FAILED:
00386                                 return "D3DERR_TEXTURE_LOAD_FAILED\0";
00387                 case D3DERR_MATRIX_CREATE_FAILED:
00388                                 return "D3DERR_MATRIX_CREATE_FAILED\0";
00389                 case D3DERR_MATRIX_DESTROY_FAILED:
00390                                 return "D3DERR_MATRIX_DESTROY_FAILED\0";
00391                 case D3DERR_MATRIX_SETDATA_FAILED:
00392                                 return "D3DERR_MATRIX_SETDATA_FAILED\0";
00393                 case D3DERR_SETVIEWPORTDATA_FAILED:
00394                                 return "D3DERR_SETVIEWPORTDATA_FAILED\0";
00395                 case D3DERR_MATERIAL_CREATE_FAILED:
00396                                 return "D3DERR_MATERIAL_CREATE_FAILED\0";
00397                 case D3DERR_MATERIAL_DESTROY_FAILED:
00398                                 return "D3DERR_MATERIAL_DESTROY_FAILED\0";
00399                 case D3DERR_MATERIAL_SETDATA_FAILED:
00400                                 return "D3DERR_MATERIAL_SETDATA_FAILED\0";
00401                 case D3DERR_LIGHT_SET_FAILED:
00402                                 return "D3DERR_LIGHT_SET_FAILED\0";
00403                 case D3DERR_INVALID_DEVICE:
00404                         return "Invalid device";
00405                 case D3DERR_INITFAILED:
00406                         return "Init failed";
00407                 case D3DERR_DEVICEAGGREGATED:
00408                         return "SetRenderTarget attempted on a device that was\nQI'd off the render target.";
00409                 case D3DERR_INVALIDCURRENTVIEWPORT:
00410                         return "Invalid current viewport";
00411                 case D3DERR_INVALIDPRIMITIVETYPE:
00412                         return "Invalid primitivetype";
00413                 case D3DERR_INVALIDVERTEXTYPE:
00414                         return "Invalid vertex type";
00415                 case D3DERR_TEXTURE_BADSIZE:
00416                         return "Bad texturesize";
00417                 case D3DERR_INVALIDRAMPTEXTURE:
00418                         return "Invalid ramptexture";
00419                 case D3DERR_MATERIAL_GETDATA_FAILED:
00420                         return "Material-getdata failed";
00421                 case D3DERR_INVALIDPALETTE:
00422                         return "Invalid palette";
00423                 case D3DERR_ZBUFF_NEEDS_SYSTEMMEMORY:
00424                         return "Z-buffer needs systemmemory";
00425                 case D3DERR_ZBUFF_NEEDS_VIDEOMEMORY:
00426                         return "Z-buffer needs videomemory";
00427                 case D3DERR_SURFACENOTINVIDMEM:
00428                         return "Surface not in videomemory";
00429                 case D3DERR_LIGHTHASVIEWPORT:
00430                         return "Light has viewport";
00431                 case D3DERR_LIGHTNOTINTHISVIEWPORT:
00432                         return "Light not in this viewport";
00433                 case D3DERR_SCENE_IN_SCENE:
00434                         return "Scene in scene";
00435                 case D3DERR_SCENE_NOT_IN_SCENE:
00436                         return "Scene not in scene";
00437                 case D3DERR_SCENE_BEGIN_FAILED:
00438                         return "Scene-begin failed";
00439                 case D3DERR_SCENE_END_FAILED:
00440                         return "Scene-end failed";
00441                 case D3DERR_INBEGIN:
00442                         return "In begin";
00443                 case D3DERR_NOTINBEGIN:
00444                         return "Not in begin";
00445                 case D3DERR_NOVIEWPORTS:
00446                         return "There are no viewports";
00447                 case D3DERR_VIEWPORTDATANOTSET:
00448                         return "Viewport has not been set";
00449                 case D3DERR_VIEWPORTHASNODEVICE:
00450                         return "Viewport has no device";
00451                 case D3DERR_NOCURRENTVIEWPORT:
00452                         return "There are no current viewport";
00453         }
00454         return "Unknown d3d-error";
00455 }
00456 
00457 char *get_dsounderr(HRESULT err)
00458 {
00459         switch (err)
00460         {
00461         case DSERR_ALLOCATED:
00462                 return "DSERR_ALLOCATED: The call failed because resources (such as a priority level) were already being used by another caller.";
00463         case DSERR_CONTROLUNAVAIL:
00464                 return "DSERR_CONTROLUNAVAIL: The control (vol,pan,etc.) requested by the caller is not available.";
00465         case DSERR_INVALIDPARAM:
00466                 return "DSERR_INVALIDPARAM: An invalid parameter was passed to the returning function";
00467         case DSERR_INVALIDCALL:
00468                 return "DSERR_INVALIDCALL: This call is not valid for the current state of this object";
00469         case DSERR_GENERIC:
00470                 return "DSERR_GENERIC: An undetermined error occured inside the DirectSound subsystem";
00471         case DSERR_PRIOLEVELNEEDED:
00472                 return "DSERR_PRIOLEVELNEEDED: The caller does not have the priority level required for the function to\nsucceed.";
00473         case DSERR_OUTOFMEMORY:
00474                 return "DSERR_OUTOFMEMORY: Not enough free memory is available to complete the operation";
00475         case DSERR_BADFORMAT:
00476                 return "DSERR_BADFORMAT: The specified WAVE format is not supported";
00477         case DSERR_UNSUPPORTED:
00478                 return "DSERR_UNSUPPORTED: The function called is not supported at this time";
00479         case DSERR_NODRIVER:
00480                 return "DSERR_NODRIVER: No sound driver is available for use";
00481         case DSERR_ALREADYINITIALIZED:
00482                 return "DSERR_ALREADYINITIALIZED: This object is already initialized";
00483         case DSERR_NOAGGREGATION:
00484                 return "DSERR_NOAGGREGATION: This object does not support aggregation";
00485         case DSERR_BUFFERLOST:
00486                 return "DSERR_BUFFERLOST: The buffer memory has been lost, and must be restored.";
00487         case DSERR_OTHERAPPHASPRIO:
00488                 return "DSERR_OTHERAPPHASPRIO: Another app has a higher priority level, preventing this call from\nsucceeding.";
00489         case DSERR_UNINITIALIZED:
00490                 return "DSERR_UNINITIALIZED: This object has not been initialized";
00491         case DSERR_NOINTERFACE:
00492                 return "DSERR_NOINTERFACE: The requested COM interface is not available";
00493         }
00494         return "Generic unknown strange and fatal DSound-error";
00495 }
00496 
00497 char *get_dinputerr(HRESULT err)
00498 {
00499         switch (err)
00500         {
00501 /*      case DI_OK:
00502                 return "The operation completed successfully.";
00503         case DI_NOTATTACHED:
00504                 return "The device exists but is not currently attached.";
00505         case DI_BUFFEROVERFLOW:
00506                 return "The device buffer overflowed.    Some input was lost.";
00507         case DI_PROPNOEFFECT:
00508                 return "The change in device properties had no effect.";
00509         case DI_NOEFFECT:
00510                 return "The operation had no effect.";
00511 */
00512         case DI_POLLEDDEVICE:
00513                 return "The device is a polled device.  As a result, device buffering\nwill not collect any data and event notifications will not be\nsignalled until GetDeviceState is called.";
00514         case DI_DOWNLOADSKIPPED:
00515                 return "The parameters of the effect were successfully updated by\nIDirectInputEffect::SetParameters, but the effect was not\ndownloaded because the device is not exclusively acquired\nor because the DIEP_NODOWNLOAD flag was passed.";
00516         case DI_EFFECTRESTARTED:
00517                 return "The parameters of the effect were successfully updated by\nIDirectInputEffect::SetParameters, but in order to change\nthe parameters, the effect needed to be restarted.";
00518         case DI_TRUNCATED:
00519                 return "The parameters of the effect were successfully updated by\nIDirectInputEffect::SetParameters, but some of them were\nbeyond the capabilities of the device and were truncated.";
00520         case DI_TRUNCATEDANDRESTARTED:
00521                 return "Equal to DI_EFFECTRESTARTED | DI_TRUNCATED.";
00522         case DIERR_OLDDIRECTINPUTVERSION:
00523                 return "The application requires a newer version of DirectInput.";
00524         case DIERR_BETADIRECTINPUTVERSION:
00525                 return "The application was written for an unsupported prerelease version\nof DirectInput.";
00526         case DIERR_BADDRIVERVER:
00527                 return "The object could not be created due to an incompatible driver version\nor mismatched or incomplete driver components.";
00528         case DIERR_DEVICENOTREG:
00529                 return "The device or device instance or effect is not registered with DirectInput.";
00530         case DIERR_NOTFOUND:
00531                 return "The requested object does not exist.";
00532 //      case DIERR_OBJECTNOTFOUND:
00533 //              return "The requested object does not exist.";
00534         case DIERR_INVALIDPARAM:
00535                 return "An invalid parameter was passed to the returning function,\nor the object was not in a state that admitted the function\nto be called.";
00536         case DIERR_NOINTERFACE:
00537                 return "The specified interface is not supported by the object";
00538         case DIERR_GENERIC:
00539                 return "An undetermined error occured inside the DInput subsystem";
00540         case DIERR_OUTOFMEMORY:
00541                 return "The DInput subsystem couldn't allocate sufficient memory to complete the\ncaller's request.";
00542         case DIERR_UNSUPPORTED:
00543                 return "The function called is not supported at this time";
00544         case DIERR_NOTINITIALIZED:
00545                 return "This object has not been initialized";
00546         case DIERR_ALREADYINITIALIZED:
00547                 return "This object is already initialized";
00548         case DIERR_NOAGGREGATION:
00549                 return "This object does not support aggregation";
00550         case DIERR_OTHERAPPHASPRIO:
00551                 return "Another app has a higher priority level, preventing this call from\nsucceeding.";
00552         case DIERR_INPUTLOST:
00553                 return "Access to the device has been lost.      It must be re-acquired.";
00554         case DIERR_ACQUIRED:
00555                 return "The operation cannot be performed while the device is acquired.";
00556         case DIERR_NOTACQUIRED:
00557                 return "The operation cannot be performed unless the device is acquired.";
00558 //      case DIERR_READONLY:
00559 //              return "The specified property cannot be changed.";
00560 //      case DIERR_HANDLEEXISTS:
00561 //              return "The device already has an event notification associated with it.";
00562         case E_PENDING:
00563                 return "Data is not yet available.";
00564         case DIERR_INSUFFICIENTPRIVS:
00565                 return "Unable to IDirectInputJoyConfig_Acquire because the user\ndoes not have sufficient privileges to change the joystick\nconfiguration.";
00566         case DIERR_DEVICEFULL:
00567                 return "The device is full.";
00568         case DIERR_MOREDATA:
00569                 return "Not all the requested information fit into the buffer.";
00570         case DIERR_NOTDOWNLOADED:
00571                 return "The effect is not downloaded.";
00572         case DIERR_HASEFFECTS:
00573                 return "The device cannot be reinitialized because there are still effects\nattached to it.";
00574         case DIERR_NOTEXCLUSIVEACQUIRED:
00575                 return "The operation cannot be performed unless the device is acquired\nin DISCL_EXCLUSIVE mode.";
00576         case DIERR_INCOMPLETEEFFECT:
00577                 return "The effect could not be downloaded because essential information\nis missing.    For example, no axes have been associated with the\neffect, or no type-specific information has been created.";
00578         case DIERR_NOTBUFFERED:
00579                 return "Attempted to read buffered device data from a device that is\nnot buffered.";
00580         case DIERR_EFFECTPLAYING:
00581                 return "An attempt was made to modify parameters of an effect while it is\nplaying.      Not all hardware devices support altering the parameters\nof an effect while it is playing.";
00582         }
00583         return "Strange error reported by the DirectInput sub-sub-subsystem";
00584 }

Generated at Wed Apr 4 19:54:00 2001 for ClanLib by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001