Sign in to follow this  

Line leaves trail behind? GDI

Recommended Posts

Im sure its something small im missing... When I call the function "bresen_line(....)" by itself it draws the line, and when i move it, it does not leave a trail behind. When i call it inside this function (DrawShape())it leaves a trail behind!!

void DrawShape(vector<Line> shape, COLORREF color, const HDC &deviceContext)

	vector<Line>::iterator current;

for(current = shape.begin(); current != shape.end(); current++)
bresen_line (deviceContext, (int)(current->FirstPoint.X()),(int)current->FirstPoint.Y(),(int)current->SecondPoint.X(),(int)current->SecondPoint.Y(),color);

ReleaseDC(g_hWnd, deviceContext);


// im sure there is nothing wrong with my ClearScreen
void ClearScreen(HDC hDC)
	RECT rect;
	rect.left = 0; = 0;
	rect.right = WIN_WIDTH;
	rect.bottom = WIN_HEIGHT;
	FillRect(hDC, &rect, (HBRUSH)GetStockObject(BLACK_BRUSH));


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this