本文整理汇总了C++中window::DrawLine方法的典型用法代码示例。如果您正苦于以下问题:C++ window::DrawLine方法的具体用法?C++ window::DrawLine怎么用?C++ window::DrawLine使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类window
的用法示例。
在下文中一共展示了window::DrawLine方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawLandscape
void drawLandscape(window &w, color skycolor, color groundcolor) { // creates landscape. only called once
setBrushAndPenColor(w, skycolor);
w.DrawRectangle(0, 0, w.GetWidth(), w.GetHeight(), FILLED);
RandGen r;
int ystart = r.RandInt((double) w.GetHeight() * 0.666, (double) w.GetHeight() * 0.75); // semi random height of ground near bottom of screen
setBrushAndPenColor(w, groundcolor);
for (double x = 0; x < w.GetWidth(); x++) {
int yval = ystart + sin((double) (x / 60)) * 15; // ground will be sin curve
w.DrawLine(x, yval, x, w.GetHeight()); // draws line from ground level to bottom of screen
}
}