Commit 404784ae authored by Matthias Möller's avatar Matthias Möller

add gui elements for shader timestemp function (see options -> files) and reload shaders

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@18453 383ad7c9-94d9-4d36-a494-682f7c89f535
parent ab95ff41
......@@ -67,6 +67,7 @@
#include <OpenFlipper/widgets/glWidget/CursorPainter.hh>
#include <ACG/Scenegraph/SceneGraphAnalysis.hh>
#include <ACG/GL/ShaderCache.hh>
// -------------------- Qt event Includes
#include <QEvent>
......@@ -380,6 +381,8 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
centerWidget_->setLayout(baseLayout_);
ACG::ShaderCache::getInstance()->setTimeCheck(OpenFlipperSettings().value("Core/File/ReloadShaders",false).toBool());
// ======================================================================
// Setup dragging for examiner widget
// ======================================================================
......
......@@ -50,6 +50,7 @@
#include <OpenFlipper/ACGHelper/DrawModeConverter.hh>
#include <OpenFlipper/INIFile/INIFile.hh>
#include <OpenFlipper/BasePlugin/PluginFunctions.hh>
#include <ACG/GL/ShaderCache.hh>
#include <QColorDialog>
#include <QMessageBox>
......@@ -71,6 +72,9 @@ OptionsWidget::OptionsWidget(std::vector<PluginInfo>& _plugins, std::vector<KeyB
connect(updateButton,SIGNAL(clicked()),this,SLOT(slotGetUpdates()));
updateButton->setEnabled(false);
// Files
connect(pbReloadShaders,SIGNAL(clicked()),this,SLOT(slotReloadShaders()));
// Viewer Settings
connect( restrictFPS, SIGNAL(toggled(bool)), FPS, SLOT(setEnabled(bool)) );
connect( viewerList, SIGNAL(currentRowChanged(int)), this, SLOT(updateViewerSettings(int)) );
......@@ -268,6 +272,7 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) {
//Files
logFile->setText( OpenFlipperSettings().value("Core/Log/logFile").toString() );
maxRecentBox->setValue( OpenFlipperSettings().value("Core/File/MaxRecent",15).toInt() );
rbReloadShaders->setChecked(OpenFlipperSettings().value("Core/File/ReloadShaders",false).toBool()) ;
// UI settings
toolBoxOrientation->setCurrentIndex((OpenFlipperSettings().value("Core/Gui/ToolBoxes/ToolBoxOnTheRight",true).toBool() ? 0 : 1));
......@@ -574,7 +579,8 @@ void OptionsWidget::slotApply() {
OpenFlipperSettings().setValue("Core/Log/logFile",logFile->text());
OpenFlipperSettings().setValue("Core/File/MaxRecent",maxRecentBox->value() ) ;
OpenFlipperSettings().setValue("Core/File/ReloadShaders",rbReloadShaders->isChecked() ) ;
ACG::ShaderCache::getInstance()->setTimeCheck(rbReloadShaders->isChecked());
// Toolbox orientation
OpenFlipperSettings().setValue("Core/Gui/ToolBoxes/ToolBoxOnTheRight", (toolBoxOrientation->currentIndex() == 0));
......@@ -939,3 +945,8 @@ void OptionsWidget::slotClearINI() {
OpenFlipper::Options::deleteIniFile(true);
}
void OptionsWidget::slotReloadShaders()
{
ACG::ShaderCache::getInstance()->clearCache();
}
......@@ -131,6 +131,9 @@ private slots:
/// Clear OpenFlipper INI
void slotClearINI();
/// Clear the Shader Cache
void slotReloadShaders();
protected:
void showEvent ( QShowEvent * event );
......
......@@ -36,8 +36,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>670</width>
<height>888</height>
<width>662</width>
<height>914</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
......@@ -50,7 +50,7 @@
<string/>
</property>
<property name="currentIndex">
<number>2</number>
<number>1</number>
</property>
<property name="usesScrollButtons">
<bool>true</bool>
......@@ -379,6 +379,29 @@
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_14">
<property name="title">
<string>Shaderfiles</string>
</property>
<layout class="QFormLayout" name="formLayout_7">
<item row="0" column="0">
<widget class="QRadioButton" name="rbReloadShaders">
<property name="text">
<string>Reload On Filechange</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="pbReloadShaders">
<property name="text">
<string>Reload All Shaders</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_5">
<property name="orientation">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment