rtcSetDeviceErrorFunction.3embree3 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. .TH "rtcSetDeviceErrorFunction" "3" "" "" "Embree Ray Tracing Kernels 3"
  2. .SS NAME
  3. .IP
  4. .nf
  5. \f[C]
  6. rtcSetDeviceErrorFunction\ \-\ sets\ an\ error\ callback\ function\ for\ the\ device
  7. \f[]
  8. .fi
  9. .SS SYNOPSIS
  10. .IP
  11. .nf
  12. \f[C]
  13. #include\ <embree3/rtcore.h>
  14. typedef\ void\ (*RTCErrorFunction)(
  15. \ \ void*\ userPtr,
  16. \ \ RTCError\ code,
  17. \ \ const\ char*\ str
  18. );
  19. void\ rtcSetDeviceErrorFunction(
  20. \ \ RTCDevice\ device,
  21. \ \ RTCErrorFunction\ error,
  22. \ \ void*\ userPtr
  23. );
  24. \f[]
  25. .fi
  26. .SS DESCRIPTION
  27. .PP
  28. Using the \f[C]rtcSetDeviceErrorFunction\f[] call, it is possible to set
  29. a callback function (\f[C]error\f[] argument) with payload
  30. (\f[C]userPtr\f[] argument), which is called whenever an error occurs
  31. for the specified device (\f[C]device\f[] argument).
  32. .PP
  33. Only a single callback function can be registered per device, and
  34. further invocations overwrite the previously set callback function.
  35. Passing \f[C]NULL\f[] as function pointer disables the registered
  36. callback function.
  37. .PP
  38. When the registered callback function is invoked, it gets passed the
  39. user\-defined payload (\f[C]userPtr\f[] argument as specified at
  40. registration time), the error code (\f[C]code\f[] argument) of the
  41. occurred error, as well as a string (\f[C]str\f[] argument) that further
  42. describes the error.
  43. .PP
  44. The error code is also set if an error callback function is registered.
  45. .SS EXIT STATUS
  46. .PP
  47. On failure an error code is set that can be queried using
  48. \f[C]rtcGetDeviceError\f[].
  49. .SS SEE ALSO
  50. .PP
  51. [rtcGetDeviceError]