NAME

cgD3D9TranslateHRESULT - convert an HRESULT into a string

SYNOPSIS

  #include <Cg/cgD3D9.h>

  const char * cgD3D9TranslateHRESULT( HRESULT hr );

PARAMETERS

hr

The HRESULT to translate. Can be a generic HRESULT or a D3D runtime error.

RETURN VALUES

cgD3D9TranslateHRESULT returns a pointer to a string describing the error.

DESCRIPTION

cgD3D9TranslateHRESULT converts an HRESULT into a string. This routine should be called instead of DXGetErrorDescription9() because it will also translate errors that the Cg D3D runtime generates.

This routine will typically be called in debugging situations such as inside an error callback set using cgSetErrorCallback.

EXAMPLES

The following example code illustrates the use of cgD3D9TranslateHRESULT:

  char buf[512];
  HRESULT hres = cgD3D9GetLastError();
  if (FAILED(hres))
  {
      sprintf(buf, "A D3D error occurred. Error description: '%s'\n",
              cgD3D9TranslateHRESULT(hres));
      OutputDebugString(buf);
  }

ERRORS

cgD3D9TranslateHRESULT does not generate any errors.

    or

to-be-written

HISTORY

cgD3D9TranslateHRESULT was introduced in Cg to-be-written.

SEE ALSO

cgD3D9TranslateCGerror, cgGetErrorString, cgSetErrorCallback