Commit 444edfc9 authored by Jan Möbius's avatar Jan Möbius

Added an automatic redraw blocker for core

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@2882 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 691e4797
......@@ -151,6 +151,11 @@ Core::init() {
if ( OpenFlipper::Options::gui() ) {
redrawTimer_ = new QTimer();
redrawTimer_->setSingleShot(true);
connect(redrawTimer_, SIGNAL(timeout()), this, SLOT(updateView()),Qt::DirectConnection);
if ( OpenFlipper::Options::splash() ) {
QPixmap splashPixmap(OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator() + "splash.png");
......@@ -518,6 +523,23 @@ Core::slotAddHiddenPickMode( const std::string _mode , QCursor _cursor) {
/** Update the view in the examiner widget
*/
void Core::updateView() {
if ( true ) {
// redraw time not reached ... waiting for timer event for next redraw
if ( redrawTimer_->isActive() ) {
std::cerr << "Too early for redraw!" << std::endl;
return;
}
std::cerr << "Redraw" << std::endl;
// Start the timer if we are not called by the timer
if ( sender() != redrawTimer_ )
redrawTimer_->start(35);
}
if ( OpenFlipper::Options::gui() && !OpenFlipper::Options::openingIni() ) {
coreWidget_->examiner_widget_->sceneGraph(root_node_scenegraph_);
coreWidget_->examiner_widget_->updateGL();
......
......@@ -650,6 +650,9 @@ private:
/// List of available draw modes
QVector<ViewMode*> viewModes_;
/// If enabled, this timer will block screen refresh if done more then 30 times per second.
QTimer* redrawTimer_;
};
/// Special print function for core logger
......
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