Thread: c++ tetris game
View Single Post
Old Dec 19th, 2006, 4:49 PM   #44
cwl157
Professional Programmer
 
Join Date: Feb 2005
Posts: 347
Rep Power: 4 cwl157 is on a distinguished road
i got it. There is a function in SDL called SDL_FillRect. It like redraws the screen or something so i just threw that in there and now i can move the image around the screen without getting artifacts.

EDIT: i think it does redraw the whole screen but thats ok because right after the bitmap is also redrawn and at the new location. Will this work for tetris though because if it redraws the whole screen how do i make it now redraw the blocks that are already down? The second parameter it takes is the rectangle that is to be filled. So if there is some way to keep track of the y coordinate where the blocks are then i think i could make a rectangle and pass that in and it would only fill above that.

Last edited by cwl157; Dec 19th, 2006 at 5:00 PM.
cwl157 is offline   Reply With Quote