本文整理汇总了C++中Poly::draw方法的典型用法代码示例。如果您正苦于以下问题:C++ Poly::draw方法的具体用法?C++ Poly::draw怎么用?C++ Poly::draw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Poly
的用法示例。
在下文中一共展示了Poly::draw方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw_poly
void draw_poly(const Poly &poly, int gl_type, int linewidth, int pointsize,
const float *rgb, float a, bool randomized)
{
glColor4f(rgb[0],rgb[1],rgb[2],a);
glLineWidth(linewidth);
glPointSize(pointsize);
poly.draw(gl_type, randomized);
}
示例2: draw_poly
void draw_poly(Poly poly, int gl_type, int linewidth, int pointsize,
float r, float g, float b, float a)
{
glColor4f(r,g,b,a);
glLineWidth(linewidth);
glPointSize(pointsize);
poly.draw(gl_type);
}
示例3: Draw
/*----------------------------------------------------------------------------------------
* This is the main display callback function. It sets up the drawing for
* The 3D scene first then calls the Draw3D() function. After that it switches to
* an orthographic projection and calls Draw2D().
*/
void Draw(void)
{
/*
* Clear the background
*/
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
/*
* Allow drawing in full region of the screen
*/
glViewport(0,0,winw,winh);
glPushMatrix();
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
gluOrtho2D(0, winw, 0, winh);
poly.Shrink(40);
glLineWidth(1);
poly.draw(Vector2f(0,0));
glLineWidth(3);
poly.handleShrinkErrors();
poly.draw(Vector2f(640,0));
glPopMatrix();
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
/*
* Bring the back buffer to the front and vice-versa.
*/
glutSwapBuffers();
}