Thursday, March 27, 2008

Crossing Every T, Dotting Every I.

I've had a bug in some GL code for about an hour, and I've been beating my head against the wall trying to figure out what I'd done wrong.  glGetUniformLocation was returning crazy values, and glUniform1f was generating an invaild operation.  The problem? glUniform1f where I had intended glUniform1i. A simple typo, but somehow it also screwed up the values coming back from glGetUniformLocation, which is where I noticed it.

On that note, remember that glUniform* act on the currently bound program, so make sure there is one before you call it.

No comments: