Push IsBusy() callback to Backend.

This commit is contained in:
Bartosz Taudul 2024-03-24 17:39:55 +01:00
parent 9f9cd04761
commit 5b2cce0a02
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
4 changed files with 4 additions and 4 deletions

View File

@ -11,7 +11,7 @@ class RunQueue;
class Backend class Backend
{ {
public: public:
Backend( const char* title, const std::function<void()>& redraw, const std::function<void(float)>& scaleChanged, RunQueue* mainThreadTasks ); Backend( const char* title, const std::function<void()>& redraw, const std::function<void(float)>& scaleChanged, const std::function<int(void)>& isBusy, RunQueue* mainThreadTasks );
~Backend(); ~Backend();
void Show(); void Show();

View File

@ -60,7 +60,7 @@ static void glfw_window_iconify_callback( GLFWwindow*, int iconified )
} }
Backend::Backend( const char* title, const std::function<void()>& redraw, const std::function<void(float)>& scaleChanged, RunQueue* mainThreadTasks ) Backend::Backend( const char* title, const std::function<void()>& redraw, const std::function<void(float)>& scaleChanged, const std::function<int(void)>& isBusy, RunQueue* mainThreadTasks )
{ {
glfwSetErrorCallback( glfw_error_callback ); glfwSetErrorCallback( glfw_error_callback );
if( !glfwInit() ) exit( 1 ); if( !glfwInit() ) exit( 1 );

View File

@ -728,7 +728,7 @@ static void SetupCursor()
s_cursorY = cursor->images[0]->hotspot_y * 120 / s_maxScale; s_cursorY = cursor->images[0]->hotspot_y * 120 / s_maxScale;
} }
Backend::Backend( const char* title, const std::function<void()>& redraw, const std::function<void(float)>& scaleChanged, RunQueue* mainThreadTasks ) Backend::Backend( const char* title, const std::function<void()>& redraw, const std::function<void(float)>& scaleChanged, const std::function<int(void)>& isBusy, RunQueue* mainThreadTasks )
{ {
s_redraw = redraw; s_redraw = redraw;
s_scaleChanged = scaleChanged; s_scaleChanged = scaleChanged;

View File

@ -341,7 +341,7 @@ int main( int argc, char** argv )
LoadConfig(); LoadConfig();
ImGuiTracyContext imguiContext; ImGuiTracyContext imguiContext;
Backend backend( title, DrawContents, ScaleChanged, &mainThreadTasks ); Backend backend( title, DrawContents, ScaleChanged, IsBusy, &mainThreadTasks );
tracy::InitTexture(); tracy::InitTexture();
iconTex = tracy::MakeTexture(); iconTex = tracy::MakeTexture();
zigzagTex = tracy::MakeTexture( true ); zigzagTex = tracy::MakeTexture( true );