Skip to content

Commit

Permalink
UI|libgui: Disable widget background blurring when a game is loaded
Browse files Browse the repository at this point in the history
Game rendering is simply not efficient enough to be done multiple
times per frame => perf hit is too big.
  • Loading branch information
skyjake committed Jan 15, 2014
1 parent 1135742 commit 628fdc4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
8 changes: 3 additions & 5 deletions doomsday/client/src/ui/clientwindow.cpp
Expand Up @@ -263,18 +263,16 @@ DENG2_OBSERVES(App, StartupComplete)
//game->hide();
background->show();
gameSelMenu->show();
taskBar->console().enableBlur();
}
else
{
//game->show();
background->hide();
gameSelMenu->hide();

// For the time being, blurring is not compatible with the
// legacy OpenGL rendering.
taskBar->console().enableBlur(false);
}

// Check with Style if blurring is allowed.
taskBar->console().enableBlur(taskBar->style().isBlurringAllowed());
}

void setMode(Mode const &newMode)
Expand Down
9 changes: 8 additions & 1 deletion doomsday/client/src/ui/windowsystem.cpp
Expand Up @@ -21,6 +21,7 @@
#include "ui/clientwindow.h"
#include "gl/gl_main.h"
#include "clientapp.h"
#include "dd_main.h"

#include <de/Style>
#include <QMap>
Expand All @@ -31,9 +32,15 @@ DENG2_PIMPL(WindowSystem)
{
SettingsRegister settings;

struct ClientStyle : public Style {
bool isBlurringAllowed() const {
return !App_GameLoaded();
}
};

typedef QMap<String, ClientWindow *> Windows;
Windows windows;
Style style;
ClientStyle style;

// Mouse motion.
bool mouseMoved;
Expand Down
1 change: 1 addition & 0 deletions doomsday/libappfw/src/guiwidget.cpp
Expand Up @@ -273,6 +273,7 @@ DENG2_PIMPL(GuiWidget)
GLState::push()
.setTarget(blurFB[0]->target())
.setViewport(Rectangleui::fromSize(blurSize));
blurFB[0]->target().clear(GLTarget::Depth);
self.root().drawUntil(self);
GLState::pop();

Expand Down

0 comments on commit 628fdc4

Please sign in to comment.