Hello guys. I'm writing a tetris game using C++ and MFC. I have a timer and OnTimer handler. Handler looks like this:
... do some game-only logic ...
this->RedrawWindow();
And in OnPaint handler I draw blocks, map(with bitmap background), score etc. For drawing i use bitmaps and BitBlt function. Everything is drawn from scratch, i redraw the whole window area. Overall performance is normal, flickering sometimes, but it's ok, but when i added bitmap background to the map, flickering while redrawing became insufferable. Do I have to use another algorithms to draw bitmap, or may be I'm wrong in doing all redrawings each time OnPaint is triggered?
How can i eliminate flickering? I can use only C++ and MFC, the latter one unfortunately i didnt know at all before starting this project.
So, again: how can I eliminate flickering and increase performance of redrawing?