GLNonlinearlizeFilter
: Replace GLRenderer *
with GLRenderer &
This commit is contained in:
parent
ab235fed8e
commit
00fbbe9acd
@ -33,13 +33,13 @@
|
||||
|
||||
namespace spades {
|
||||
namespace draw {
|
||||
GLNonlinearlizeFilter::GLNonlinearlizeFilter(GLRenderer *renderer) : renderer(renderer) {
|
||||
lens = renderer->RegisterProgram("Shaders/PostFilters/Nonlinearize.program");
|
||||
GLNonlinearlizeFilter::GLNonlinearlizeFilter(GLRenderer &renderer) : renderer(renderer) {
|
||||
lens = renderer.RegisterProgram("Shaders/PostFilters/Nonlinearize.program");
|
||||
}
|
||||
GLColorBuffer GLNonlinearlizeFilter::Filter(GLColorBuffer input) {
|
||||
SPADES_MARK_FUNCTION();
|
||||
|
||||
IGLDevice &dev = renderer->GetGLDevice();
|
||||
IGLDevice &dev = renderer.GetGLDevice();
|
||||
GLQuadRenderer qr(dev);
|
||||
|
||||
static GLProgramAttribute lensPosition("positionAttribute");
|
||||
@ -55,7 +55,7 @@ namespace spades {
|
||||
lens->Use();
|
||||
|
||||
lensTexture.SetValue(0);
|
||||
lensGamma.SetValue(1.f / (float)renderer->GetSettings().r_hdrGamma);
|
||||
lensGamma.SetValue(1.f / (float)renderer.GetSettings().r_hdrGamma);
|
||||
|
||||
// composite to the final image
|
||||
GLColorBuffer output = input.GetManager()->CreateBufferHandle();
|
||||
|
@ -27,11 +27,11 @@ namespace spades {
|
||||
class GLRenderer;
|
||||
class GLProgram;
|
||||
class GLNonlinearlizeFilter {
|
||||
GLRenderer *renderer;
|
||||
GLRenderer &renderer;
|
||||
GLProgram *lens;
|
||||
|
||||
public:
|
||||
GLNonlinearlizeFilter(GLRenderer *);
|
||||
GLNonlinearlizeFilter(GLRenderer &);
|
||||
GLColorBuffer Filter(GLColorBuffer);
|
||||
};
|
||||
} // namespace draw
|
||||
|
@ -1005,7 +1005,7 @@ namespace spades {
|
||||
|
||||
if (settings.r_hdr) {
|
||||
GLProfiler::Context p(*profiler, "Gamma Correction");
|
||||
handle = GLNonlinearlizeFilter(this).Filter(handle);
|
||||
handle = GLNonlinearlizeFilter(*this).Filter(handle);
|
||||
}
|
||||
|
||||
if (settings.r_colorCorrection) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user