From a931124a2fb4688485fe6f2125c161f2c50c9b90 Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Tue, 2 Aug 2011 19:54:19 +0200 Subject: [PATCH] Changed the confg writer, it now creates configs identical to those created by Ogre itself. This seems to have solved a small issue with Ogre always using OpenGL rendering even when Direct3D was selected in Windows. --- apps/launcher/graphicspage.cpp | 74 +++++++++++++++++++--------------- 1 file changed, 42 insertions(+), 32 deletions(-) diff --git a/apps/launcher/graphicspage.cpp b/apps/launcher/graphicspage.cpp index 4fe7a7eea..d97a915c9 100644 --- a/apps/launcher/graphicspage.cpp +++ b/apps/launcher/graphicspage.cpp @@ -363,60 +363,70 @@ void GraphicsPage::writeConfig() out << "Render System=" << mSelectedRenderSystem->getName().c_str() << endl << endl; - if (mOpenGLRenderSystem) { - QString openGLName = mOpenGLRenderSystem->getName().c_str(); - openGLName.prepend("["); - openGLName.append("]"); - out << openGLName << endl; - - out << "RTT Preferred Mode=" << mOGLRTTComboBox->currentText() << endl; - out << "FSAA=" << mOGLAntiAliasingComboBox->currentText() << endl; - out << "Video Mode=" << mOGLResolutionComboBox->currentText() << endl; - out << "Display Frequency=" << mOGLFrequencyComboBox->currentText() << endl; - - if (mOGLVSyncCheckBox->checkState() == Qt::Checked) { - out << "VSync=Yes" << endl; - } else { - out << "VSync=No" << endl; - } - - if (mOGLFullScreenCheckBox->checkState() == Qt::Checked) { - out << "Full Screen=Yes" << endl; - } else { - out << "Full Screen=No" << endl; - } - - } - if (mDirect3DRenderSystem) { QString direct3DName = mDirect3DRenderSystem->getName().c_str(); direct3DName.prepend("["); direct3DName.append("]"); out << direct3DName << endl; - out << "Rendering Device=" << mD3DRenderDeviceComboBox->currentText() << endl; - out << "FSAA=" << mD3DAntiAliasingComboBox->currentText() << endl; - out << "Floating-point mode=" << mD3DFloatingPointComboBox->currentText() << endl; - out << "Video Mode=" << mD3DResolutionComboBox->currentText() << endl; - if (mD3DNvPerfCheckBox->checkState() == Qt::Checked) { out << "Allow NVPerfHUD=Yes" << endl; } else { out << "Allow NVPerfHUD=No" << endl; } + out << "FSAA=" << mD3DAntiAliasingComboBox->currentText() << endl; + out << "Floating-point mode=" << mD3DFloatingPointComboBox->currentText() << endl; + + if (mD3DFullScreenCheckBox->checkState() == Qt::Checked) { + out << "Full Screen=Yes" << endl; + } else { + out << "Full Screen=No" << endl; + } + + out << "Rendering Device=" << mD3DRenderDeviceComboBox->currentText() << endl; + out << "Resource Creation Policy=Create on all devices" << endl; + if (mD3DVSyncCheckBox->checkState() == Qt::Checked) { out << "VSync=Yes" << endl; } else { out << "VSync=No" << endl; } - if (mD3DFullScreenCheckBox->checkState() == Qt::Checked) { + out << "VSync Interval=1" << endl; + out << "Video Mode=" << mD3DResolutionComboBox->currentText() << endl; + out << "sRGB Gamma Conversion=No" << endl; + } + + out << endl; + + if (mOpenGLRenderSystem) { + QString openGLName = mOpenGLRenderSystem->getName().c_str(); + openGLName.prepend("["); + openGLName.append("]"); + out << openGLName << endl; + + out << "Colour Depth=32" << endl; + out << "Display Frequency=" << mOGLFrequencyComboBox->currentText() << endl; + out << "FSAA=" << mOGLAntiAliasingComboBox->currentText() << endl; + + if (mOGLFullScreenCheckBox->checkState() == Qt::Checked) { out << "Full Screen=Yes" << endl; } else { out << "Full Screen=No" << endl; } + out << "RTT Preferred Mode=" << mOGLRTTComboBox->currentText() << endl; + + if (mOGLVSyncCheckBox->checkState() == Qt::Checked) { + out << "VSync=Yes" << endl; + } else { + out << "VSync=No" << endl; + } + + out << "VSync Interval=1" << endl; + out << "Video Mode=" << mOGLResolutionComboBox->currentText() << endl; + out << "sRGB Gamma Conversion=No" << endl; } file.close(); @@ -470,5 +480,5 @@ void GraphicsPage::rendererChanged(const QString &renderer) mDisplayStackedWidget->setCurrentIndex(0); } - mSelectedRenderSystem = mOgre->getRenderSystemByName(renderer.toStdString()); + mSelectedRenderSystem = mOgre->getRenderSystemByName(renderer.toStdString()); } \ No newline at end of file