Skip to content

Commit

Permalink
Renderer|FX: Added a convenience method for accessing GLShaderBank
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Nov 17, 2013
1 parent 9f99a1a commit 15de061
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions doomsday/client/include/render/consoleeffect.h
Expand Up @@ -21,6 +21,7 @@

#include <de/libdeng2.h>
#include <de/Rectangle>
#include <de/GLShaderBank>

/**
* Draws camera lens effects for a particular player console. Maintains
Expand All @@ -45,6 +46,8 @@ class ConsoleEffect

bool isInited() const;

de::GLShaderBank &shaders() const;

/**
* Allocate and prepare GL resources for drawing. Derived classes must call
* the base class method if they override it.
Expand Down
6 changes: 6 additions & 0 deletions doomsday/client/src/render/consoleeffect.cpp
Expand Up @@ -18,6 +18,7 @@

#include "render/consoleeffect.h"
#include "render/viewports.h"
#include "clientapp.h"

using namespace de;

Expand Down Expand Up @@ -57,6 +58,11 @@ bool ConsoleEffect::isInited() const
return d->inited;
}

GLShaderBank &ConsoleEffect::shaders() const
{
return ClientApp::glShaderBank();
}

void ConsoleEffect::glInit()
{
d->inited = true;
Expand Down
3 changes: 2 additions & 1 deletion doomsday/client/src/render/fx/postprocessing.cpp
Expand Up @@ -18,6 +18,7 @@

#include "render/fx/postprocessing.h"
#include "ui/clientwindow.h"
#include "clientapp.h"

#include <de/Animation>
#include <de/Drawable>
Expand Down Expand Up @@ -80,7 +81,7 @@ DENG2_PIMPL(PostProcessing)
{
try
{
root().shaders().build(frame.program(), "fx.post." + name);
self.shaders().build(frame.program(), "fx.post." + name);
LOG_VERBOSE("Post-processing shader \"fx.post.%s\"") << name;
return true;
}
Expand Down

0 comments on commit 15de061

Please sign in to comment.