config: Add a setting for graphics V-Sync.
This commit is contained in:
parent
2267f98941
commit
08ad9b36d4
9 changed files with 20 additions and 1 deletions
|
@ -119,6 +119,7 @@ GRenderWindow::GRenderWindow(QWidget* parent, EmuThread* emu_thread) :
|
|||
QGLFormat fmt;
|
||||
fmt.setVersion(3,3);
|
||||
fmt.setProfile(QGLFormat::CoreProfile);
|
||||
fmt.setSwapInterval(VideoCore::g_vsync_enabled);
|
||||
// Requests a forward-compatible context, which is required to get a 3.2+ context on OS X
|
||||
fmt.setOption(QGL::NoDeprecatedFunctions);
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@ void Config::ReadValues() {
|
|||
Settings::values.use_hw_renderer = qt_config->value("use_hw_renderer", true).toBool();
|
||||
Settings::values.use_shader_jit = qt_config->value("use_shader_jit", true).toBool();
|
||||
Settings::values.use_scaled_resolution = qt_config->value("use_scaled_resolution", false).toBool();
|
||||
Settings::values.use_vsync = qt_config->value("use_vsync", false).toBool();
|
||||
|
||||
Settings::values.bg_red = qt_config->value("bg_red", 1.0).toFloat();
|
||||
Settings::values.bg_green = qt_config->value("bg_green", 1.0).toFloat();
|
||||
|
@ -139,6 +140,7 @@ void Config::SaveValues() {
|
|||
qt_config->setValue("use_hw_renderer", Settings::values.use_hw_renderer);
|
||||
qt_config->setValue("use_shader_jit", Settings::values.use_shader_jit);
|
||||
qt_config->setValue("use_scaled_resolution", Settings::values.use_scaled_resolution);
|
||||
qt_config->setValue("use_vsync", Settings::values.use_vsync);
|
||||
|
||||
// Cast to double because Qt's written float values are not human-readable
|
||||
qt_config->setValue("bg_red", (double)Settings::values.bg_red);
|
||||
|
|
|
@ -22,11 +22,12 @@ void ConfigureGraphics::setConfiguration() {
|
|||
ui->toogle_hw_renderer->setChecked(Settings::values.use_hw_renderer);
|
||||
ui->toogle_shader_jit->setChecked(Settings::values.use_shader_jit);
|
||||
ui->toogle_scaled_resolution->setChecked(Settings::values.use_scaled_resolution);
|
||||
ui->toogle_vsync->setChecked(Settings::values.use_vsync);
|
||||
}
|
||||
|
||||
void ConfigureGraphics::applyConfiguration() {
|
||||
Settings::values.use_hw_renderer = ui->toogle_hw_renderer->isChecked();
|
||||
Settings::values.use_shader_jit = ui->toogle_shader_jit->isChecked();
|
||||
Settings::values.use_scaled_resolution = ui->toogle_scaled_resolution->isChecked();
|
||||
Settings::values.use_vsync = ui->toogle_vsync->isChecked();
|
||||
Settings::Apply();
|
||||
}
|
||||
|
|
|
@ -43,6 +43,13 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="toogle_vsync">
|
||||
<property name="text">
|
||||
<string>Enable V-Sync</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue