I'm working on the base engine of my game right now, specifically converting a text file into a level on-screen. As a 2D platformer, each level has an array of rectangles that can be drawn to the screen. Obviously I don't want to draw all these bad boys to the screen every frame, as that would slow everything down. I've thought up two solutions to this problem myself:
Draw these rects to a separate texture (I'm using SDL2, by the way) and paint a specific portion to the screen every frame
Choose which rects to draw every frame based on the player's position by checking collision between every rect and an imaginary moving "chunk"
My question: Which of these two processes, if either, would be less of a burden to the cpu? If neither seem reasonable, what other alternatives are there?