template<class Container>
void BlitSurface::ExtractFrames(Container & output, int frame_width, int frame_height,
int frames_per_row, int frames_per_column,
bool padding) const
{
SDL_Surface ** temp_surf = SDL_Ex_ExtractFrames(_surface, frame_width, frame_height, frames_per_row, frames_per_column, padding);
int surface_count = frames_per_row * frames_per_column;
output.resize(surface_count);
Container::iterator iter = output.begin();
for(int i=0; i<surface_count; ++i, ++iter)
iter->_surface = temp_surf[i];
delete [] temp_surf;
}
I have this function splits an image up into frames and stores them into a container of images. How would I modify it to take an iterator instead of a container, and insert the elements at that point?