use thread safe events for file picker

This commit is contained in:
Turanszki Janos
2020-07-22 21:04:27 +01:00
parent 5d6edf7cd5
commit 2f659443ba
11 changed files with 163 additions and 120 deletions
+7 -5
View File
@@ -272,11 +272,13 @@ PostprocessWindow::PostprocessWindow(EditorComponent* editor) : GUI(&editor->Get
params.extensions.push_back("jpg");
params.extensions.push_back("tga");
wiHelper::FileDialog(params, [=](std::string fileName) {
editor->renderPath->setColorGradingTexture(wiResourceManager::Load(fileName));
if (editor->renderPath->getColorGradingTexture() != nullptr)
{
colorGradingButton->SetText(fileName);
}
wiEvent::Subscribe_Once(SYSTEM_EVENT_THREAD_SAFE_POINT, [=](uint64_t userdata) {
editor->renderPath->setColorGradingTexture(wiResourceManager::Load(fileName));
if (editor->renderPath->getColorGradingTexture() != nullptr)
{
colorGradingButton->SetText(fileName);
}
});
});
}
else