• Advertisement
Sign in to follow this  

Line leaves trail behind? GDI

This topic is 3849 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

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;
	rect.top = 0;
	rect.right = WIN_WIDTH;
	rect.bottom = WIN_HEIGHT;
	FillRect(hDC, &rect, (HBRUSH)GetStockObject(BLACK_BRUSH));
	
}


[\source]

Share this post


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

  • Advertisement