# HG changeset patch # User John Tsiombikas # Date 1414540602 -7200 # Node ID 5558b43eb653b0816f45278b5c74f5e507e63c61 # Parent 0888d4e24e213c276a430229d1d832ad28f0d275 moved the glUseProgram(0) state cleanup to its proper place diff -r 0888d4e24e21 -r 5558b43eb653 src/main.c --- a/src/main.c Wed Oct 29 01:09:33 2014 +0200 +++ b/src/main.c Wed Oct 29 01:56:42 2014 +0200 @@ -267,8 +267,6 @@ glBindFramebuffer(GL_FRAMEBUFFER, fbo); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glUseProgram(0); - /* for each eye ... */ for(i=0; i<2; i++) { ovrEyeType eye = hmd->EyeRenderOrder[i]; @@ -320,6 +318,11 @@ ovrHmd_EndFrame(hmd, pose, &fb_ovr_tex[0].Texture); + /* workaround for the oculus sdk distortion renderer bug, which uses a shader + * program, and doesn't restore the original binding when it's done. + */ + glUseProgram(0); + assert(glGetError() == GL_NO_ERROR); }