log direct3d9 errors
This commit is contained in:
parent
60a66776a6
commit
2a269f19b6
3 changed files with 97 additions and 34 deletions
34
src/debug.c
34
src/debug.c
|
@ -1,6 +1,7 @@
|
|||
#include <windows.h>
|
||||
#include <dbghelp.h>
|
||||
#include <stdio.h>
|
||||
#include <d3d9.h>
|
||||
#include "ddraw.h"
|
||||
#include "dd.h"
|
||||
#include "ddsurface.h"
|
||||
|
@ -1005,6 +1006,39 @@ void dbg_dump_dds_lock_flags(DWORD flags)
|
|||
#endif
|
||||
}
|
||||
|
||||
char* dbg_d3d9_hr_to_str(HRESULT hr)
|
||||
{
|
||||
#define HR_TO_STR(x) if (x == hr) return #x
|
||||
|
||||
HR_TO_STR(D3D_OK);
|
||||
|
||||
HR_TO_STR(D3DERR_WRONGTEXTUREFORMAT);
|
||||
HR_TO_STR(D3DERR_UNSUPPORTEDCOLOROPERATION);
|
||||
HR_TO_STR(D3DERR_UNSUPPORTEDCOLORARG);
|
||||
HR_TO_STR(D3DERR_UNSUPPORTEDALPHAOPERATION);
|
||||
HR_TO_STR(D3DERR_UNSUPPORTEDALPHAARG);
|
||||
HR_TO_STR(D3DERR_TOOMANYOPERATIONS);
|
||||
HR_TO_STR(D3DERR_CONFLICTINGTEXTUREFILTER);
|
||||
HR_TO_STR(D3DERR_UNSUPPORTEDFACTORVALUE);
|
||||
HR_TO_STR(D3DERR_CONFLICTINGRENDERSTATE);
|
||||
HR_TO_STR(D3DERR_UNSUPPORTEDTEXTUREFILTER);
|
||||
HR_TO_STR(D3DERR_CONFLICTINGTEXTUREPALETTE);
|
||||
HR_TO_STR(D3DERR_DRIVERINTERNALERROR);
|
||||
|
||||
HR_TO_STR(D3DERR_NOTFOUND);
|
||||
HR_TO_STR(D3DERR_MOREDATA);
|
||||
HR_TO_STR(D3DERR_DEVICELOST);
|
||||
HR_TO_STR(D3DERR_DEVICENOTRESET);
|
||||
HR_TO_STR(D3DERR_NOTAVAILABLE);
|
||||
HR_TO_STR(D3DERR_OUTOFVIDEOMEMORY);
|
||||
HR_TO_STR(D3DERR_INVALIDDEVICE);
|
||||
HR_TO_STR(D3DERR_INVALIDCALL);
|
||||
HR_TO_STR(D3DERR_DRIVERINVALIDCALL);
|
||||
HR_TO_STR(D3DERR_WASSTILLDRAWING);
|
||||
|
||||
return "UNKNOWN";
|
||||
}
|
||||
|
||||
char* dbg_mes_to_str(int id)
|
||||
{
|
||||
switch (id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue