Try to work around variability of opengl APIs.