| 70 | // -------------------------------------------------------------------------------------------------------------------- |
| 71 | |
| 72 | IPLerror CContext::createEmbreeDevice(IPLEmbreeDeviceSettings* settings, |
| 73 | IEmbreeDevice** device) |
| 74 | { |
| 75 | #if defined(IPL_USES_EMBREE) && (defined(IPL_CPU_X86) || defined(IPL_CPU_X64)) |
| 76 | if (!device) |
| 77 | return IPL_STATUS_FAILURE; |
| 78 | |
| 79 | try |
| 80 | { |
| 81 | auto _device = reinterpret_cast<CEmbreeDevice*>(gMemory().allocate(sizeof(CEmbreeDevice), Memory::kDefaultAlignment)); |
| 82 | new (_device) CEmbreeDevice(this, settings); |
| 83 | *device = _device; |
| 84 | } |
| 85 | catch (Exception exception) |
| 86 | { |
| 87 | return static_cast<IPLerror>(exception.status()); |
| 88 | } |
| 89 | |
| 90 | return IPL_STATUS_SUCCESS; |
| 91 | #else |
| 92 | return IPL_STATUS_FAILURE; |
| 93 | #endif |
| 94 | } |
| 95 | |
| 96 | } |
no test coverage detected