glstate code cleanup
Merge pull request #106 from raven02/patch-5

glstate code cleanup