Better OpenGL state switching