Skip to content

Commit

Permalink
Some more GL state paranoia.
Browse files Browse the repository at this point in the history
  • Loading branch information
sesse committed Oct 3, 2012
1 parent 0a3c932 commit 3dbe1e7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions effect_chain.cpp
Expand Up @@ -267,6 +267,7 @@ void EffectChain::finalize()
void *mapped_pbo = glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, GL_WRITE_ONLY);
memset(mapped_pbo, 0, width * height * bytes_per_pixel);
glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB);
check_error();

glGenTextures(1, &source_image_num);
check_error();
Expand Down Expand Up @@ -330,6 +331,7 @@ void EffectChain::render_to_screen(unsigned char *src)

for (unsigned phase = 0; phase < phases.size(); ++phase) {
// Set up inputs and outputs for this phase.
glActiveTexture(GL_TEXTURE0);
if (phase == 0) {
// First phase reads from the input texture (which is already bound).
} else {
Expand Down Expand Up @@ -357,6 +359,7 @@ void EffectChain::render_to_screen(unsigned char *src)
GL_TEXTURE_2D,
temp_textures[phase % 2],
0);
check_error();
}

// We have baked an upside-down transform into the quad coordinates,
Expand Down

0 comments on commit 3dbe1e7

Please sign in to comment.