title: libGDX: Best way to store many small images in libGDX for fast drawing
body: <p>I'm writing a client for a multiplayer tile-based game in libGDX (for Android and Desktop).
  The game world is composed of thousands of small 32x32 png images that are drawn into a large rectangular view area. The images are downloaded over the socket connection (network) as needed.</p>
  
  <p>What is the best (fastest and most resource-efficient) way to store these images in "memory" so they can be drawn really fast onto the screen when needed?</p>
  
  <p>So far, I have implemented a very naive algorithm that will load each and every 32x32 image into a Texture and keep that in memory indefinitly. (Pure coincidence my images got a size that is a power of two.) It seems to work, but I am worried that this is very inefficient and possible exceeds GPU resources on older devices or something.</p>
  
  <p>I am aware of the TextureAtlas, but that seems to work only for static images that are packed and stored in the compiled android app. As I receive my images over the network dynamically, I believe this won't work for me.</p>
  
  <p>I have found this <a href="https://stackoverflow.com/questions/7551669/libgdx-spritebatch-render-to-texture/7632680#7632680">libgdx SpriteBatch render to texture</a> post that suggest rendering many small images into a FrameBuffer, then using this as a source of TextureRegions. This seems promising to me. Is this a good solution?
  Is there a better way?</p>
  
  <p>I also wonder if drawing and storing my small images into a large Pixmap might be helpful. Is this possibly a better approach than drawing into a FrameBuffer, as described above?
  As I understand it from the docs, Pixmaps are purely memory-based. That might be an advantage as it probably doesn't need graphics resources, on the other hand might be slower as loading into a Texture is an expensive operation. Thoughts on this?</p>