oculus2_psprite

changeset 17:5558b43eb653

moved the glUseProgram(0) state cleanup to its proper place
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 29 Oct 2014 01:56:42 +0200
parents 0888d4e24e21
children 64089dd45d50
files src/main.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line diff
     1.1 --- a/src/main.c	Wed Oct 29 01:09:33 2014 +0200
     1.2 +++ b/src/main.c	Wed Oct 29 01:56:42 2014 +0200
     1.3 @@ -267,8 +267,6 @@
     1.4  	glBindFramebuffer(GL_FRAMEBUFFER, fbo);
     1.5  	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
     1.6  
     1.7 -	glUseProgram(0);
     1.8 -
     1.9  	/* for each eye ... */
    1.10  	for(i=0; i<2; i++) {
    1.11  		ovrEyeType eye = hmd->EyeRenderOrder[i];
    1.12 @@ -320,6 +318,11 @@
    1.13  
    1.14  	ovrHmd_EndFrame(hmd, pose, &fb_ovr_tex[0].Texture);
    1.15  
    1.16 +	/* workaround for the oculus sdk distortion renderer bug, which uses a shader
    1.17 +	 * program, and doesn't restore the original binding when it's done.
    1.18 +	 */
    1.19 +	glUseProgram(0);
    1.20 +
    1.21  	assert(glGetError() == GL_NO_ERROR);
    1.22  }
    1.23