Open mosra opened 4 years ago
It also affects functions like emscripten_wget_data
. After an asincify operation, future frames aren't requested anymore and the application freezes. Manually requesting the next frame draw seems to work around it. Code copied from here
if(ImGui::Button("load")){
value = get_digest_size(silly);
Magnum::Debug() << value;
int (*_callback)(void*);
_callback = [](void* userData) -> int {
auto& app = *static_cast<ImGuiExample*>(userData);
app.drawEvent();
return true;
};
EM_ASM({
/* Animation frame callback */
var drawEvent = function() {
var id = window.requestAnimationFrame(drawEvent);
/* Call our callback via function pointer returning int with two
int params */
if(!dynCall('ii', $0, [$1])) {
window.cancelAnimationFrame(id);
}
};
window.requestAnimationFrame(drawEvent);
}, _callback, this);
}
Reported by @ShaddyDC. Current workaround is using
Sdl2Application
instead.Repro code -- after pressing the button, the value is printed, but
Frame
isn't anymore after that.WindowFlag::AlwaysRequestAnimationFrame
doesn't help.@Squareys since you were originally implementing the idle loop, do you have any idea what could cause this?