i'm sorry, but creating a pen\brush inside an argument, is a memory leak?
the FillRect() needs the brush for be drawed.Code:void Clear(COLORREF Color=RGB(0,0,0)) { //Clear: RECT RectWindow; GetWindowRect(myconsole,&RectWindow); RectWindow.top=0; RectWindow.left=0; HBRUSH clean=CreateSolidBrush(Color); HBRUSH oldbrush= (HBRUSH)SelectObject(myconsole,clean); FillRect(mydc,&RectWindow,clean); SelectObject(myconsole, oldbrush); DeleteObject(clean); }
the pen is the default and is white...
i belive the problem is my calculations:
but i must retest and more see if the calculation is right for draw the floor planeCode://floor vectors: POINT FloorPoints[5] = { { (FloorX * MeDistance) / (FloorZ + MeDistance), (FloorY * MeDistance) / (FloorZ + MeDistance) }, { FloorWidth+FloorX, (FloorY * MeDistance) / (FloorZ + MeDistance) }, { FloorWidth+FloorX, FloorHeight+FloorY }, { (FloorX * MeDistance) / (FloorZ + MeDistance), FloorHeight+FloorY }, { (FloorX * MeDistance) / (FloorZ + MeDistance), (FloorY * MeDistance) / (FloorZ + MeDistance) }, };




Reply With Quote
