Replace the surface at index with surface.
index
surface
void updateSurface(int index, Surface surface) { _surfaces[index] = surface; updateBounds(); }