diff options
author | Bartosz Taudul <wolf@nereid.pl> | 2022-08-07 18:13:38 +0300 |
---|---|---|
committer | Bartosz Taudul <wolf@nereid.pl> | 2022-08-07 18:13:38 +0300 |
commit | d63d1c9e7fa646a3836d1363101309cfaf95a0bd (patch) | |
tree | 79c72fc1ab0d9da5ccd073982fa1e4115a0c196f /profiler | |
parent | 73be35ea980a2ff448db0b90aae09e903e601329 (diff) |
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.
Diffstat (limited to 'profiler')
-rw-r--r-- | profiler/src/main.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/profiler/src/main.cpp b/profiler/src/main.cpp index e9662eb0..218f5a25 100644 --- a/profiler/src/main.cpp +++ b/profiler/src/main.cpp @@ -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; |