My first thought was that writing to file was taking a long time. This appears to be true to some extent - the two calls
Code: Select all
irr::video::IVideoDriver *driver = m_rendering_engine->get_video_driver();
irr::video::IImage* const raw_image = driver->createScreenShot();
are fast. It is the call to
Code: Select all
driver->writeImageToFile(raw_image, (std::to_string(timestamp)+filename_ext).c_str(), quality);
My first thought was to wrap the method containing the above code in a call using async so that the writes don't block, but it ends up just writing out completely black screens, and also still runs at a similar framerate. I imagine that this is not a completely unheard of use case, so I was wondering if anyone could point me to a potential solution or knew of anyone trying to do something similar.
I am somewhat new to C++ and completely new to Irrlicht - thank you in advance for your patience.