Permalink
Browse files

Fixed the z-buffer fighting glitch in the demo2transition example code

  • Loading branch information...
1 parent 5dbbd6e commit dee3f79c775ff21d4b6727246f835baf797b296b Edward Patel committed May 24, 2010
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/Demo2Transition.m
View
@@ -79,7 +79,10 @@ - (BOOL)drawTransitionFrameWithTextureFrom:(GLuint)textureFromView
glDrawArrays(GL_TRIANGLE_STRIP, 4, 4);
glRotatef(180.0, 0, 1, 0);
glBindTexture(GL_TEXTURE_2D, textureToView);
+ glPolygonOffset(0, -1);
+ glEnable(GL_POLYGON_OFFSET_FILL);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+ glDisable(GL_POLYGON_OFFSET_FILL);
glPopMatrix();
glDrawArrays(GL_TRIANGLE_STRIP, 4, 4);
glPopMatrix();

0 comments on commit dee3f79

Please sign in to comment.