Skip to content

Commit

Permalink
Slight cleanup in texture upload format selection.
Browse files Browse the repository at this point in the history
  • Loading branch information
sesse committed Oct 2, 2012
1 parent fdf859f commit 7ead6f1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion effect_chain.cpp
Expand Up @@ -213,7 +213,12 @@ void EffectChain::render_to_screen(unsigned char *src)
assert(false);
}

glTexImage2D(GL_TEXTURE_2D, 0, internal_format, width, height, 0, format, GL_UNSIGNED_BYTE, src);
static bool first = true;
if (first) {
glTexImage2D(GL_TEXTURE_2D, 0, internal_format, width, height, 0, format, GL_UNSIGNED_BYTE, src);
} else {
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height, 0, format, GL_UNSIGNED_BYTE, src);
}
check_error();
glUniform1i(glGetUniformLocation(glsl_program_num, "input_tex"), 0);

Expand Down

0 comments on commit 7ead6f1

Please sign in to comment.