本文整理汇总了C++中Point2::draw方法的典型用法代码示例。如果您正苦于以下问题:C++ Point2::draw方法的具体用法?C++ Point2::draw怎么用?C++ Point2::draw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point2
的用法示例。
在下文中一共展示了Point2::draw方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: display
//glut display function
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
// Draw all the points
glColor3f(1.0, 0.0, 0.0);
for (int x=0; x<numPoints; x++)
polyPoint[x].draw();
// Draw the polgon
if (initializeComplete)
{
glColor3f(0.0, 0.0, 1.0);
glBegin(GL_LINE_LOOP);
for (int x=0; x<numPoints; x++)
glVertex2f(polyPoint[x].getX(), polyPoint[x].getY());
glEnd();
}
// Draw the test point, and the text saying whether it's inside or outside.
if (firstPointDrawn)
{
char inside[] = "The point drawn is INSIDE the polygon.";
char outside[] = "The point drawn is OUTSIDE the polygon.";
glColor3f(0.0, 1.0, 0.0);
testPoint.draw();
char* dispText = (pointInside) ? inside : outside;
glRasterPos2i(100,100);
for (int x=0; x< strlen(dispText); x++)
glutBitmapCharacter(GLUT_BITMAP_8_BY_13, dispText[x]);
}
glutSwapBuffers();