1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 04:23:51 +00:00

Load icon during rendering backend setup.

Creating a new window along with setting up an OpenGL context is universally
a lengthy operation. Decode the icon image on a separate thread.
This commit is contained in:
Bartosz Taudul 2022-08-07 17:13:38 +02:00
parent 73be35ea98
commit d63d1c9e7f
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -213,10 +213,13 @@ int main( int argc, char** argv )
} );
} );
iconPx = stbi_load_from_memory( (const stbi_uc*)Icon_data, Icon_size, &iconX, &iconY, nullptr, 4 );
auto iconThread = std::thread( [] {
iconPx = stbi_load_from_memory( (const stbi_uc*)Icon_data, Icon_size, &iconX, &iconY, nullptr, 4 );
} );
ImGuiTracyContext imguiContext;
Backend backend( title, DrawContents, &mainThreadTasks );
iconThread.join();
backend.SetIcon( iconPx, iconX, iconY );
bptr = &backend;