Blitting to same surface?

I implemented that graphics system I described briefly earlier, but it
displays some errors. The system memory surface up and left of itself works
fine. However blitting down or right on the same surface produces graphical
corruption that is consistent with what would be expected of a blit routine
that copies the image incrementally. Is SDL_BlitSurface intended to support
overlapping blits, or will I have to implement this code myself? The
following approximates the funtionality of my drawing code:

draw( SDL_Surface *screen ) {
static SDL_Surface *stored;

...If not allocated allocate stored...

destrect.w=640;destrect.h=480;
destrect.x=storedx - new_x;
destrect.y=storedy - new_y;

SDL_BlitSurface( stored, NULL, stored, &destrect );

...Draw Missing Background...

SDL_BlitSurface( stored, NULL, screen, NULL );

}

Thats all the code I believe could be involved with the problem.

emblem

I implemented that graphics system I described briefly earlier, but it
displays some errors. The system memory surface up and left of itself works
fine. However blitting down or right on the same surface produces graphical
corruption that is consistent with what would be expected of a blit routine
that copies the image incrementally. Is SDL_BlitSurface intended to support
overlapping blits, or will I have to implement this code myself?

SDL_BlitSurface() does indeed copy the image incrementally. I would be glad
to incorporate your code that fixes that into SDL.

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/