Handle GL state more carefully.