implemented limited OpenGL state caching
small optimizations