I am reloading image time by time to screen SDL_Surface. Then I draw manually some lines to same screen SDL_Surface. The problem is that lines should be top of image, if I reload a new image, lines are hidden. What would be fastest way to refresh lines? Can I use somehow second surface?
The code is something like this:
// Init
screen = SDL_SetVideoMode( systemX, systemY, bpp, SDL_SWSURFACE );
//Loading image
SDL_BlitSurface(imageSurf, NULL, screen, &offset);
SDL_Flip( screen );
// Drawing lines call setPixel function and then update screen
char *position = (char *)screen->pixels;
position += ( screen->pitch * y );
position += ( screen->format->BytesPerPixel * x );
memcpy ( position , &color , screen->format->BytesPerPixel );
...
SDL_Flip( screen );