optimize opengl calls in 2d drawing
remove some deprecated opengl stuff