Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
We need to update any targets' input texture when we regenerate our outputTexture.
  • Loading branch information
artgillespie committed Apr 30, 2012
1 parent 3aa19a5 commit 4eff8ec
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion framework/Source/GPUImageOutput.m
Expand Up @@ -113,7 +113,6 @@ - (void)removeAllTargets;
- (void)initializeOutputTexture;
{
[GPUImageOpenGLESContext useImageProcessingContext];

glActiveTexture(GL_TEXTURE0);
glGenTextures(1, &outputTexture);
glBindTexture(GL_TEXTURE_2D, outputTexture);
Expand All @@ -123,6 +122,11 @@ - (void)initializeOutputTexture;
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glBindTexture(GL_TEXTURE_2D, 0);

// notify targets
for (id<GPUImageInput> target in targets) {
[target setInputTexture:outputTexture atIndex:0];
}
}

- (void)deleteOutputTexture;
Expand All @@ -131,6 +135,10 @@ - (void)deleteOutputTexture;
{
glDeleteTextures(1, &outputTexture);
outputTexture = 0;
// notify targets
for (id<GPUImageInput> target in targets) {
[target setInputTexture:outputTexture atIndex:0];
}
}
}

Expand Down

0 comments on commit 4eff8ec

Please sign in to comment.