Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Taudul <wolf@nereid.pl>2022-09-30 01:57:07 +0300
committerBartosz Taudul <wolf@nereid.pl>2022-09-30 01:57:07 +0300
commit78169326b3d5d294a64af4e8abf8ea90b5ecc6b1 (patch)
tree8fafcdb32a5003bcb94875a46f1d2fc38046f009 /profiler/src
parent863b36d04b90510f8e818a4c45fe253dc7bb27dd (diff)
Setup main emscripten loop.
Diffstat (limited to 'profiler/src')
-rw-r--r--profiler/src/BackendGlfw.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/profiler/src/BackendGlfw.cpp b/profiler/src/BackendGlfw.cpp
index 516fc05c..5d19ba24 100644
--- a/profiler/src/BackendGlfw.cpp
+++ b/profiler/src/BackendGlfw.cpp
@@ -2,6 +2,7 @@
#include "imgui/imgui_impl_opengl3.h"
#ifdef __EMSCRIPTEN__
# include <GLES2/gl2.h>
+# include <emscripten/html5.h>
#else
# include "imgui/imgui_impl_opengl3_loader.h"
#endif
@@ -120,6 +121,13 @@ void Backend::Show()
void Backend::Run()
{
+#ifdef __EMSCRIPTEN__
+ emscripten_set_main_loop( []() {
+ glfwPollEvents();
+ s_redraw();
+ s_mainThreadTasks->Run();
+ }, 0, 1 );
+#else
while( !glfwWindowShouldClose( s_window ) )
{
if( s_iconified )
@@ -137,6 +145,7 @@ void Backend::Run()
s_mainThreadTasks->Run();
}
}
+#endif
}
void Backend::NewFrame( int& w, int& h )