.\" Automatically generated by Pandoc 2.5
.\"
.TH "rtcSetDeviceErrorFunction" "3" "" "" "Embree Ray Tracing Kernels 3"
.hy
.SS NAME
.IP
.nf
\f[C]
rtcSetDeviceErrorFunction \- sets an error callback function for the device
\f[R]
.fi
.SS SYNOPSIS
.IP
.nf
\f[C]
#include <embree3/rtcore.h>

typedef void (*RTCErrorFunction)(
  void* userPtr,
  RTCError code,
  const char* str
);

void rtcSetDeviceErrorFunction(
  RTCDevice device,
  RTCErrorFunction error,
  void* userPtr
);
\f[R]
.fi
.SS DESCRIPTION
.PP
Using the \f[C]rtcSetDeviceErrorFunction\f[R] call, it is possible to
set a callback function (\f[C]error\f[R] argument) with payload
(\f[C]userPtr\f[R] argument), which is called whenever an error occurs
for the specified device (\f[C]device\f[R] argument).
.PP
Only a single callback function can be registered per device, and
further invocations overwrite the previously set callback function.
Passing \f[C]NULL\f[R] as function pointer disables the registered
callback function.
.PP
When the registered callback function is invoked, it gets passed the
user\-defined payload (\f[C]userPtr\f[R] argument as specified at
registration time), the error code (\f[C]code\f[R] argument) of the
occurred error, as well as a string (\f[C]str\f[R] argument) that
further describes the error.
.PP
The error code is also set if an error callback function is registered.
.SS EXIT STATUS
.PP
On failure an error code is set that can be queried using
\f[C]rtcGetDeviceError\f[R].
.SS SEE ALSO
.PP
[rtcGetDeviceError]
