]> git.tdb.fi Git - libs/gl.git/blobdiff - source/effects/bloom.cpp
Access builtin resources through a global instance
[libs/gl.git] / source / effects / bloom.cpp
index 98afedfc17c924e1e1b1048488dd0e72497ce4dc..af2057d908a03afa25075330ddbbfe0b2ef6f0d5 100644 (file)
@@ -14,12 +14,12 @@ using namespace std;
 namespace Msp {
 namespace GL {
 
-Bloom::Bloom(Resources &resources, unsigned w, unsigned h):
-       blur_shader(resources.get<Program>("_bloom_blur.glsl.shader")),
-       combine_shader(resources.get<Program>("_bloom_combine.glsl.shader")),
-       quad(resources.get<Mesh>("_fullscreen_quad.mesh")),
-       nearest_sampler(resources.get<Sampler>("_nearest_clamp.samp")),
-       linear_sampler(resources.get<Sampler>("_linear_clamp.samp"))
+Bloom::Bloom(unsigned w, unsigned h):
+       blur_shader(Resources::get_global().get<Program>("_bloom_blur.glsl.shader")),
+       combine_shader(Resources::get_global().get<Program>("_bloom_combine.glsl.shader")),
+       quad(Resources::get_global().get<Mesh>("_fullscreen_quad.mesh")),
+       nearest_sampler(Resources::get_global().get<Sampler>("_nearest_clamp.samp")),
+       linear_sampler(Resources::get_global().get<Sampler>("_linear_clamp.samp"))
 {
        blur_shdata[0].uniform("delta", 1.0f/w, 0.0f);
        blur_shdata[1].uniform("delta", 0.0f, 1.0f/h);
@@ -88,9 +88,9 @@ Bloom::Template::Template():
        strength(0.2f)
 { }
 
-Bloom *Bloom::Template::create(Resources &res, unsigned width, unsigned height) const
+Bloom *Bloom::Template::create(unsigned width, unsigned height) const
 {
-       RefPtr<Bloom> bloom = new Bloom(res, width/size_divisor, height/size_divisor);
+       RefPtr<Bloom> bloom = new Bloom(width/size_divisor, height/size_divisor);
        bloom->set_radius(radius);
        bloom->set_strength(strength);
        return bloom.release();