新人求助,我好菜啊,用c++写三角形

如何用c++,通过三个坐标,输出三角形,谢谢各位大神,没有c币,跪求!!

draw_triangle(CPoint point, int rgb, bool up, unsigned int high, unsigned int half)
{
CPen pen(PS_SOLID, 1, rgb);
CPen *pOldPen = dc->SelectObject(&pen);
dc->MoveTo(point.x-half, point.y);
if(up)
dc->LineTo(point.x, point.y-high);
else
dc->LineTo(point.x, point.y+high);

dc->LineTo(point.x+half, point.y);
dc->LineTo(point.x-half, point.y);

dc->SelectObject(pOldPen);

}