Drawknob wrote:So why does CEF1 allow the framerate to be adjusted but CEF3 doesn't?
Drawknob wrote:Also, regular interval I understand, but that doesn't tell me what the magnitude of that interval ought to be. For example, I'm currently calling it every 33 ms, but that's just an arbitrary choice. What is the optimal rate, and is the optimum affected by whether there are input events or not?
CefInitialize(...);
...
auto nextTime = chrono::steady_clock::now() + chrono::milliseconds(33);
auto fut = inputPipe.AsyncRead(msgBuffers[index]);
while (running)
{
if (fut.WaitUntil(nextTime))
{
for (auto const message : msgBuffers[index]) Process(message); // Will call SendMouseClickEvent() and whatever else, based on message type
fut = inputPipe.AsyncRead(msgBuffers[index]);
index = 1 - index; // Flip
}
auto timeNow = chrono::steady_clock::now();
if (timeNow >= nextTime)
{
CefDoMessageLoopWork();
do nextTime += chrono::milliseconds(33);
while (nextTime < timeNow); // Constant rate
}
}
Drawknob wrote:So is it fine to run CefRunMessageLoop() in OSR mode when there's no window and I'm not sending any Windows events?
Drawknob wrote:Is it more efficient to put CefRunMessageLoop() in a separate thread and not worry about timeouts?
Users browsing this forum: No registered users and 80 guests