[SDL] "Eww" effect
So I've decided to implement a message-based system to things in my engine - this includes rendering. Bascially the engine will send a message to the player once every iteration of the game loop to tell him to redraw himself at a given X,Y co-ord.
T'all works well except the sprite leaves nasty trails behind it when it moves. I tried to SDL_FillRect() the background every frame but that didn't work - it all just went blank.
I haven't used SDL very much so is there something else I'm supposed to be doing?
EDIT: Oh and if you're wondering, I've decided to clone that good ol' Net Yaroze version of Rocks 'n' Gems as my first game. And that sprite was 4 red dots until I moved it.
EDIT2: I looked at SDL_UpdateRect(), made no difference.
Are you sure your player is receiving only one Draw event each iteration?
Are you using double buffering? Cause if so you draw to the second buffer, blit it to the screen, clear it and then re-draw it rinse and repeat.
Cheers prog-bman. I just realised I had initialised SDL without SDL_DOUBLEBUF, so I just switched on double buffering and cleared after each SDL_Flip and it works.
Your welcome, even though I do the allegro thingy I did dabble in SDL ;).