X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=dither_effect.cpp;h=72a38deb46490aac5e738a6bf19e48b674a6c45a;hp=6e1ddd8d8ed4b7451698fd0b9d70382560bf0c52;hb=e9f0fb5e6ae193a5a853ac5aef82927b6a81267a;hpb=8dedcc2fd11b00fec125212b60e144363033137d diff --git a/dither_effect.cpp b/dither_effect.cpp index 6e1ddd8..72a38de 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. @@ -82,7 +84,7 @@ void DitherEffect::update_texture(GLuint glsl_program_num, const string &prefix, check_error(); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); check_error(); - glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE16F_ARB, texture_width, texture_height, 0, GL_LUMINANCE, GL_FLOAT, dither_noise); + glTexImage2D(GL_TEXTURE_2D, 0, GL_R16F, texture_width, texture_height, 0, GL_RED, GL_FLOAT, dither_noise); check_error(); delete[] dither_noise; @@ -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