X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=dither_effect.cpp;h=e9ea19f226006e8f30584b7dbc9c1ee95cfd350d;hp=14132bd43407bda72a7d2a8ca86f785bc9e1fab1;hb=fa58f7f430f17d7461e910c36ed39e5fb8b86005;hpb=9651a4eaae012cdc49c1aa38197861e04f62e91e diff --git a/dither_effect.cpp b/dither_effect.cpp index 14132bd..e9ea19f 100644 --- a/dither_effect.cpp +++ b/dither_effect.cpp @@ -10,6 +10,8 @@ using namespace std; +namespace movit { + namespace { // A simple LCG (linear congruental generator) random generator. @@ -45,7 +47,7 @@ DitherEffect::~DitherEffect() string DitherEffect::output_fragment_shader() { char buf[256]; - sprintf(buf, "#define NEED_EXPLICIT_ROUND %d\n", (movit_num_wrongly_rounded > 0)); + sprintf(buf, "#define NEED_EXPLICIT_ROUND %d\n", (movit_num_wrongly_rounded > 0 && movit_shader_rounding_supported)); return buf + read_file("dither_effect.frag"); } @@ -122,3 +124,5 @@ void DitherEffect::set_gl_state(GLuint glsl_program_num, const string &prefix, u set_uniform_float(glsl_program_num, prefix, "round_fac", round_fac); set_uniform_float(glsl_program_num, prefix, "inv_round_fac", 1.0f / round_fac); } + +} // namespace movit