Bug fixes with sprites and OpenGL