| 70 | } |
| 71 | |
| 72 | void luxcore::Init(void (*LogHandler)(const char *)) { |
| 73 | slg::Init(); |
| 74 | |
| 75 | // To be thread safe |
| 76 | static boost::mutex initMutex; |
| 77 | boost::unique_lock<boost::mutex> lock(initMutex); |
| 78 | |
| 79 | lcInitTime = WallClockTime(); |
| 80 | |
| 81 | slg::LuxRays_DebugHandler = ::LuxRaysDebugHandler; |
| 82 | slg::SLG_DebugHandler = ::SLGDebugHandler; |
| 83 | slg::SLG_SDLDebugHandler = ::SDLDebugHandler; |
| 84 | |
| 85 | if (LogHandler) |
| 86 | SetLogHandler(LogHandler); |
| 87 | else |
| 88 | SetLogHandler(DefaultDebugHandler); |
| 89 | } |
| 90 | |
| 91 | void luxcore::SetLogHandler(void (*LogHandler)(const char *)) { |
| 92 | // Set all debug handlers |
no test coverage detected