From: Steinar H. Gunderson Date: Wed, 3 Oct 2012 16:55:08 +0000 (+0200) Subject: Give NULL to glTexImage2D() instead of zeroing memory ourselves. X-Git-Tag: 1.0~398 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=b65675827bcaaa8cd913e46a7210575183d0056f;p=movit Give NULL to glTexImage2D() instead of zeroing memory ourselves. --- diff --git a/effect_chain.cpp b/effect_chain.cpp index 6f53008..270eae6 100644 --- a/effect_chain.cpp +++ b/effect_chain.cpp @@ -220,8 +220,6 @@ void EffectChain::finalize() unsigned num_textures = std::max(phases.size() - 1, 2); glGenTextures(num_textures, temp_textures); - unsigned char *empty = new unsigned char[width * height * 4]; - memset(empty, 0, width * height * 4); for (unsigned i = 0; i < num_textures; ++i) { glBindTexture(GL_TEXTURE_2D, temp_textures[i]); check_error(); @@ -229,10 +227,9 @@ void EffectChain::finalize() check_error(); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); check_error(); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, empty); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); check_error(); } - delete[] empty; } // Translate the input format to OpenGL's enums.