X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbloom.cpp;h=0e5ce9d616d9f6827aec8b80b029e87c15e0aba0;hb=656b4577fccfb02bea747871e5ab10148f002443;hp=3993c8c901b9a01c66e621af65d6bcefc5ebc1f7;hpb=7e9e15a12fb398798f2719545cc8553354c1e389;p=libs%2Fgl.git diff --git a/source/bloom.cpp b/source/bloom.cpp index 3993c8c9..0e5ce9d6 100644 --- a/source/bloom.cpp +++ b/source/bloom.cpp @@ -76,8 +76,7 @@ Bloom::Bloom(unsigned w, unsigned h): { 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].storage(RGB16F, w, h); } combine_shdata.uniform(combine_shader.get_uniform_location("source"), 1); @@ -133,8 +132,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); @@ -155,9 +154,6 @@ void Bloom::render(const Texture2D &src) Program::unbind(); Texture::unbind_from(1); Texture::unbind_from(0); - // XXX Should check if the modes were enabled in the first place - enable(DEPTH_TEST); - enable(BLEND); } } // namespace GL