blog / OpenGl Notes
Mostly what not to do
-
glColor The last glColor call is multiplied against every subsequent texture. This means that if you accidentally call glColor(1.0, 1.0, 10.0), everything will get a blue tint. And you'll spend hours trying to figure out why.
-
glColor again. Sending colours outside the 0.0 .. 1.0 range to GL appears to cause a large slowdown. Not sure if that's the graphics card or the drivers, but it's worth taking the effort to make sure it doesn't happen. Especially when the SIMD version of fmin() is available.
-
Compile with -pg to profile, then run gprof
-
To get assembler output from GCC, try gcc -c -g -Wa,-a,-ad or just -S
-
Remember to reset all openGL modes each frame: GL_PROJECTION,GL_MODELVIEW,GL_COLOR,GL_TEXTURE. If you miss one, you get weird effects like the picture disappearing into the distance shortly after your program starts.