X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbloom.cpp;h=040fd6c7b1fa5ea5f995aafc4e45784665a87269;hb=12ac9bec8e03029c1042fd7732a2cfc04c9a9584;hp=5f2adc85c2bf592a8379d58ee9d3efc228fe055a;hpb=b617c5d7b5283ad260a77f01e42e6170cabbc03d;p=libs%2Fgl.git diff --git a/source/bloom.cpp b/source/bloom.cpp index 5f2adc85..040fd6c7 100644 --- a/source/bloom.cpp +++ b/source/bloom.cpp @@ -75,9 +75,9 @@ Bloom::Bloom(unsigned w, unsigned h): for(unsigned i=0; i<2; ++i) { blur_shdata[i].uniform(loc, 0); + tex[i].set_min_filter(NEAREST); tex[i].storage(RGB16F, w, h, 0); tex[i].image(0, RGB, UNSIGNED_BYTE, 0); - tex[i].set_min_filter(NEAREST); } combine_shdata.uniform(combine_shader.get_uniform_location("source"), 1); @@ -133,8 +133,8 @@ void Bloom::render(const Texture2D &src) blur_shader.bind(); fbo.bind(); src.bind_to(0); - disable(DEPTH_TEST); - disable(BLEND); + Bind unbind_dtest(static_cast(0), true); + Bind unbind_blend(static_cast(0), true); for(unsigned i=0; i<2; ++i) { fbo.attach(COLOR_ATTACHMENT0, tex[i], 0); @@ -153,12 +153,8 @@ void Bloom::render(const Texture2D &src) src.bind_to(1); quad.draw(); Program::unbind(); - Texture::unbind(); - TexUnit::activate(0); - Texture::unbind(); - // XXX Should check if the modes were enabled in the first place - enable(DEPTH_TEST); - enable(BLEND); + Texture::unbind_from(1); + Texture::unbind_from(0); } } // namespace GL