mirror of https://github.com/snes9xgit/snes9x.git
Fix OpenGL shader changed race.
This commit is contained in:
parent
8bb1e7747d
commit
ad613b5f0b
|
@ -30,7 +30,7 @@ DisplayPanel::DisplayPanel(EmuApplication *app_)
|
||||||
|
|
||||||
QObject::connect(checkBox_use_shader, &QCheckBox::clicked, [&](bool checked) {
|
QObject::connect(checkBox_use_shader, &QCheckBox::clicked, [&](bool checked) {
|
||||||
app->config->use_shader = checked;
|
app->config->use_shader = checked;
|
||||||
app->window->canvas->shaderChanged();
|
app->window->shaderChanged();
|
||||||
});
|
});
|
||||||
|
|
||||||
QObject::connect(pushButton_browse_shader, &QPushButton::clicked, [&] {
|
QObject::connect(pushButton_browse_shader, &QPushButton::clicked, [&] {
|
||||||
|
@ -116,7 +116,7 @@ void DisplayPanel::selectShaderDialog()
|
||||||
app->config->shader = dialog.selectedFiles().at(0).toUtf8();
|
app->config->shader = dialog.selectedFiles().at(0).toUtf8();
|
||||||
app->config->last_shader_folder = dialog.directory().absolutePath().toStdString();
|
app->config->last_shader_folder = dialog.directory().absolutePath().toStdString();
|
||||||
lineEdit_shader->setText(app->config->shader.c_str());
|
lineEdit_shader->setText(app->config->shader.c_str());
|
||||||
app->window->canvas->shaderChanged();
|
app->window->shaderChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisplayPanel::populateDevices()
|
void DisplayPanel::populateDevices()
|
||||||
|
|
|
@ -640,4 +640,12 @@ void EmuMainWindow::recreateUIAssets()
|
||||||
if (canvas)
|
if (canvas)
|
||||||
canvas->recreateUIAssets();
|
canvas->recreateUIAssets();
|
||||||
}, true);
|
}, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void EmuMainWindow::shaderChanged()
|
||||||
|
{
|
||||||
|
app->emu_thread->runOnThread([&] {
|
||||||
|
if (canvas)
|
||||||
|
canvas->shaderChanged();
|
||||||
|
});
|
||||||
}
|
}
|
|
@ -34,6 +34,7 @@ class EmuMainWindow : public QMainWindow
|
||||||
void openFile();
|
void openFile();
|
||||||
bool openFile(std::string filename);
|
bool openFile(std::string filename);
|
||||||
void recreateUIAssets();
|
void recreateUIAssets();
|
||||||
|
void shaderChanged();
|
||||||
std::vector<std::string> getDisplayDeviceList();
|
std::vector<std::string> getDisplayDeviceList();
|
||||||
EmuApplication *app;
|
EmuApplication *app;
|
||||||
EmuCanvas *canvas;
|
EmuCanvas *canvas;
|
||||||
|
|
Loading…
Reference in New Issue