How can I optimize SDL_Texture

I might be able to help you optimize your code but, I have a few questions:

  1. Is the ‘//Create Map Texture’ code executed each frame?
  2. Why are you setting the ‘map.map_texture’ to be the current render target? I can’t see that you’re doing anything with it after you’ve set it to be the current render target.
  3. What’s the reason you want to render all those SDL_Rect’s?’
  4. The map you’re rendering, is it a tile map?