Improved OpenGL context creation algorithm