X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fcolorcurve.cpp;fp=source%2Fcolorcurve.cpp;h=81b5a43e7a6ef4d6724a39e2ea182e7ecd63586a;hp=ad2c51ca337f35340974226253e706a58f58b088;hb=d1e3975c163694d7bca6417463462be950019e5e;hpb=072bbbd579cb82b4571cbb6babebe6e5ea498356 diff --git a/source/colorcurve.cpp b/source/colorcurve.cpp index ad2c51ca..81b5a43e 100644 --- a/source/colorcurve.cpp +++ b/source/colorcurve.cpp @@ -2,6 +2,7 @@ #include "color.h" #include "colorcurve.h" #include "mesh.h" +#include "renderer.h" #include "shader.h" #include "texture2d.h" @@ -20,6 +21,7 @@ ColorCurve::ColorCurve(): curve.storage(LUMINANCE, 256); curve.set_min_filter(LINEAR); curve.set_wrap(CLAMP_TO_EDGE); + texturing.attach(1, curve); set_peak(0.2); set_brightness(1.5); @@ -68,14 +70,14 @@ void ColorCurve::set_linear() curve.image(0, LUMINANCE, UNSIGNED_BYTE, curve_data); } -void ColorCurve::render(const Texture2D &color_buf, const Texture2D &) +void ColorCurve::render(Renderer &renderer, const Texture2D &color_buf, const Texture2D &) { - Bind _bind_shader(shprog); - shdata.apply(); - Bind _bind_mesh(quad); - Bind _bind_tex(color_buf); - Bind _bind_curve(curve, 1); - quad.draw(); + texturing.attach(0, color_buf); + + Renderer::Push push(renderer); + renderer.set_shader_program(&shprog, &shdata); + renderer.set_texturing(&texturing); + quad.draw(renderer); } } // namespace GL