Updated some OpenGL code to support OpenGL ES on iOS.