mirror of
https://github.com/wolfpld/tracy
synced 2025-05-01 13:13:53 +00:00
Setup main emscripten loop.
This commit is contained in:
parent
863b36d04b
commit
78169326b3
@ -2,6 +2,7 @@
|
|||||||
#include "imgui/imgui_impl_opengl3.h"
|
#include "imgui/imgui_impl_opengl3.h"
|
||||||
#ifdef __EMSCRIPTEN__
|
#ifdef __EMSCRIPTEN__
|
||||||
# include <GLES2/gl2.h>
|
# include <GLES2/gl2.h>
|
||||||
|
# include <emscripten/html5.h>
|
||||||
#else
|
#else
|
||||||
# include "imgui/imgui_impl_opengl3_loader.h"
|
# include "imgui/imgui_impl_opengl3_loader.h"
|
||||||
#endif
|
#endif
|
||||||
@ -120,6 +121,13 @@ void Backend::Show()
|
|||||||
|
|
||||||
void Backend::Run()
|
void Backend::Run()
|
||||||
{
|
{
|
||||||
|
#ifdef __EMSCRIPTEN__
|
||||||
|
emscripten_set_main_loop( []() {
|
||||||
|
glfwPollEvents();
|
||||||
|
s_redraw();
|
||||||
|
s_mainThreadTasks->Run();
|
||||||
|
}, 0, 1 );
|
||||||
|
#else
|
||||||
while( !glfwWindowShouldClose( s_window ) )
|
while( !glfwWindowShouldClose( s_window ) )
|
||||||
{
|
{
|
||||||
if( s_iconified )
|
if( s_iconified )
|
||||||
@ -137,6 +145,7 @@ void Backend::Run()
|
|||||||
s_mainThreadTasks->Run();
|
s_mainThreadTasks->Run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Backend::NewFrame( int& w, int& h )
|
void Backend::NewFrame( int& w, int& h )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user