Quote:
It sounds slow.
It's nowhere near slow. Concerns about the cost of passing parameters are an extreme micro-optimization. It is impossible to alleviate the cost of parameter passing beyond a certain point, as when you get into performance characteristics at that scale (amazingly small), C++ is far to high level to provide deterministic guarantees; you need to know
far too much about the host environment to have a meaningful discussion on the subject, and it's so environment-specific that it isn't worth worrying about because it will operate in an entirely different fashion in another environment.
Anyway, as I suggested, the actual amount of passing things around you do is fairly easy to minimize, and it helps reduce dependencies and increase the visibility of required dependencies. Often people feel that passing parameters around will induce "parameter bloat" involving the passing of
lots of arguments to
lots of functions; this is typically because the underlying design they've been using is broken, and requires or assumes that subsystems are globally accessible from everywhere (this is a bad idea). By fixing that larger issue, the issue of parameter bloat becomes almost irrelevant.
First consider the interface of your renderer. In your game, you'll want to initialize a renderer with various useful settings (perhaps including things like screen size, fullscreen flags, et cetera). Every "tick" of your main game loop, you'll want to (a) process input, (b) process game logic, and (c) draw current game state. (c) is all the renderer is involved with.
Now we think about what is actually involved in (c). At the highest level, it's quite simple: (a) tell the renderer about all the things we wish to draw, and (b) actually draw them. There are two ways to go about this. The first is to use a method like Renderer::DrawObject(const Object &o), and the second is to use a method like Object::Draw(). Personally, I prefer the first form; your design seems to be tending towards the second, however.
In order to actually implement Object::Draw(), however, the object's internals will still need access to the renderer, which in your case seems to hold all the useful SDL objects. You could specify the dependency explicitly via Object::Draw(Renderer &renderer), or, you could make the Object take (and store) a pointer to the renderer when it is constructed. If the object stores its renderer, it does not need to accept the renderer as a parameter in the draw function. The parameter only thus needs to be passed once.
(The other option, where "Object" only describes the rendering but does not actually do it, does not require parameter passing at all; however, it is a more complex system that might be overkill for your needs, which seem simple; also, it's better to make refactoring phases smaller and changing to such a radically different system would be a large, sweeping change that might break a lot of your code, so you should move towards that goal in tiny steps if its something you are interested in).