main function in embree namespace */
| 206 | |
| 207 | /* main function in embree namespace */ |
| 208 | int main(int argc, char** argv) |
| 209 | { |
| 210 | /* for best performance set FTZ and DAZ flags in MXCSR control and status register */ |
| 211 | _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON); |
| 212 | _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON); |
| 213 | |
| 214 | /* create new Embree device and force bvh4.triangle4v hierarchy for triangles */ |
| 215 | RTCDevice device = rtcNewDevice("tri_accel=bvh4.triangle4v"); |
| 216 | error_handler(nullptr,rtcGetDeviceError(device)); |
| 217 | |
| 218 | /* set error handler */ |
| 219 | rtcSetDeviceErrorFunction(device,error_handler,nullptr); |
| 220 | |
| 221 | /* create scene */ |
| 222 | RTCScene scene = rtcNewScene(device); |
| 223 | addCube(device,scene,Vec3fa(-1,0,0)); |
| 224 | addCube(device,scene,Vec3fa(1,0,0)); |
| 225 | addCube(device,scene,Vec3fa(0,0,-1)); |
| 226 | addCube(device,scene,Vec3fa(0,0,1)); |
| 227 | addHair(device,scene); |
| 228 | addGroundPlane(device,scene); |
| 229 | rtcCommitScene (scene); |
| 230 | /* print triangle BVH */ |
| 231 | print_bvh(scene); |
| 232 | |
| 233 | /* cleanup */ |
| 234 | rtcReleaseScene (scene); |
| 235 | rtcReleaseDevice(device); |
| 236 | |
| 237 | /* wait for user input under Windows when opened in separate window */ |
| 238 | waitForKeyPressedUnderWindows(); |
| 239 | |
| 240 | return 0; |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | int main(int argc, char** argv) |
nothing calls this directly
no test coverage detected