How do you revert to the no program object state?

Description:


I have installed a program object using glUseProgram(). It works fine.


Now, at some point, I want to revert to the original program object "state" which is nothing custom installed.


Question:


How is it supposed to be done on OS X?


Things I've tried so far after looking at the doc, sample code, google results.


• glUseProgram(0) is documented as not being the solution by the man page (even though it's used in Apple's FBOBunnies sample code). And indeed, it apparently does not remove/disable the program.


• glDeleteProgram() does not work.


• glGetIntegerv(GL_CURRENT_PROGRAM,&originalProgram); sets originalProgram to 0. So not very helpful when calling glDeleteProgram with originalProgram.


• detaching the shader from the current program produces black pixels (i.e. either no pixel is rendered or they are all black).



This seems to be a pretty basic thing to do but I haven't found a clear answer and a solution that works so far.

Replies

I've found the origin of the issue. It was a wrong texture being activated.


But still, I would be interested in knowing which solution is supposed to be the right one to revert to the original state as glUseProgram(0) is said not to be the expected solution in the man page and yet is being used by Apple's sample code.