Sign in to follow this  

SDL/C++ surfaces left behind after movement

This topic is 1951 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi guys, sorry to bother you again, but I have another issue with my first SDL game(Tetris).
The problem Im having is that when I move the surface using the left/right keys or move the window, there is a copy of the surface left behind on the screen at the position where the movement occured.

The block constantly falls down, obviously, and that works just fine, its only when I press the key to move the block left or right or click the window to move it.

Thank you for any assistance.

Share this post


Link to post
Share on other sites
Separate your updating logic from your rendering logic and double check that each object is only rendered once. Also check that the rendering surface is cleared each frame before any rendering.

Share this post


Link to post
Share on other sites
Sign in to follow this