mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 12:23:53 +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:
parent
73be35ea98
commit
d63d1c9e7f
@ -213,10 +213,13 @@ int main( int argc, char** argv )
|
||||
} );
|
||||
} );
|
||||
|
||||
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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user