March 29th, 2010, 09:06 AM
hi! i'm trying to make a double buffering to avoid the slow refresh
my code looks like this:
where the hdc passed is the main hdc.
void draw(HDC hdc)
HDC dc = CreateCompatibleDC(hdc);
HBITMAP hBitmap = CreateCompatibleBitmap (hdc, 400, 240);
/*draw all the stuff on dc*/
BitBlt(hdc, 0, 0, 400, 240, dc, 0, 0, SRCCOPY);
it draws but the refresh is slow. i know that is a working method because if i comment out BitBlt(hdc, 0, 0, 400, 240, dc, 0, 0, SRCCOPY); i get a black screen...
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.