ivansafrin/Polycode — pull request #354 by mcclure (2013-06-30 08:42:13+00:00)
Title: Miscellaneous OpenGL error fixes

Bombed this macro all over Polycode

#define GLERR(x) for ( GLenum Error = glGetError( ); ( GL_NO_ERROR != Error ); Error = glGetError( ) ) {fprintf(stderr,"GLERR %s: %u\n", x, Error);}

Checked for places where Polycode was making OpenGL calls incorrectly. What I found:

* You can't use glBindFramebufferEXT with GL_RENDERBUFFER_EXT. You're supposed to use glBindRenderbufferEXT.

* You can't use GL_LINEAR_MIPMAP_LINEAR with GL_TEXTURE_MAG_FILTER. It's only defined for GL_TEXTURE_MIN_FILTER.

* There were glPushMatrix and glPopMatrix calls in the setOrthoMode and setPerspectiveMode functions?! There seemed to be an implication that every call to setOrthoMode would be balanced by a setPerspectiveMode call, but obviously that assumption doesn't hold and this behavior was causing the OpenGL matrix stack to overflow, like, constantly. I removed the calls and nothing broke. If there is indeed a place where you need this behavior, then there must be a better way to obtain it than this.