error reporting function */
| 12 | { |
| 13 | /* error reporting function */ |
| 14 | void error_handler(void* userPtr, const RTCError code, const char* str) |
| 15 | { |
| 16 | if (code == RTC_ERROR_NONE) |
| 17 | return; |
| 18 | |
| 19 | printf("Embree: "); |
| 20 | switch (code) { |
| 21 | case RTC_ERROR_UNKNOWN : printf("RTC_ERROR_UNKNOWN"); break; |
| 22 | case RTC_ERROR_INVALID_ARGUMENT : printf("RTC_ERROR_INVALID_ARGUMENT"); break; |
| 23 | case RTC_ERROR_INVALID_OPERATION: printf("RTC_ERROR_INVALID_OPERATION"); break; |
| 24 | case RTC_ERROR_OUT_OF_MEMORY : printf("RTC_ERROR_OUT_OF_MEMORY"); break; |
| 25 | case RTC_ERROR_UNSUPPORTED_CPU : printf("RTC_ERROR_UNSUPPORTED_CPU"); break; |
| 26 | case RTC_ERROR_CANCELLED : printf("RTC_ERROR_CANCELLED"); break; |
| 27 | default : printf("invalid error code"); break; |
| 28 | } |
| 29 | if (str) { |
| 30 | printf(" ("); |
| 31 | while (*str) putchar(*str++); |
| 32 | printf(")\n"); |
| 33 | } |
| 34 | exit(1); |
| 35 | } |
| 36 | |
| 37 | /* adds a cube to the scene */ |
| 38 | unsigned int addCube (RTCDevice device_i, RTCScene scene_i, const Vec3fa& pos) |