I have a std::vector that stores textures. I need to contantly render them to the screen. Would it be faster to create a reference or pointer to the texture and render using the reference or should I just get the texture directly from the vector each time?
Both vector::at and vector operator[] give you a reference. So long as you can guarantee that nothing will happen to the actual texture in the vector while you're rendering it (e.g. in another thread) then creating a copy seems a waste of time; just use that reference.
No, saving a reference to it and then [de]referencing that reference instead of using at()/operator[] is no more or less efficient. And by separating the reference from the container itself (presumably beyond a single function's scope), you're making it less maintainable because now you have to worry about if the container re-allocated after being resized somewhere else in the code. You're trying to micro-optimize for no good purpose, as far as I can tell (though this is a guess, because obviously I'm not looking at the actual code). (If we were dealing with a linked list instead of a vector, this might be a different story.)
If there's a speed issue currently happening, it's most likely something else.
If you're doing Texture texture = texture_pool[texture_index];, then you're making a copy of the texture, which might be inefficient if copying a texture means copying its pixel information.
You would do something like Texture& texture = texture_pool[texture_index]; instead. (Or just use the texture_pool[texture_index] directly with whatever operation.)
This code implies that you don't have that. This code implies that you have a vector that stores pointers-to-textures. SDL_Texture *texture = textures[index];
Would it be faster to create a reference or pointer to the texture and render using the reference
No, slower.
If you create a whole new pointer and set its value to be the same as a pointer in the vector, and use that new pointer, you've spent time creating a new pointer and setting its value.
Accessing the item in the vector once, storing the pointer, and using the stored pointer in the render function (which is called repeatedly) may be slightly faster. (This assumes that the same texture is rendered in all subsequent calls to the render function.) In practice, the performance difference would be negligible; the time taken to actually render the texture on the screen would dominate.