Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  aa
Language: C/C++
Code:
///star
#include<glut.h>
void myDisplay(){
     glClearColor(0.3f,0.5f,1.0f,5.6f);
     glClear(GL_COLOR_BUFFER_BIT);
     gluOrtho2D(-100,100,-100,100);
     glColor3f(0.0,6.0,0.0);

     glPolygonMode(GL_BACK,GL_LINE);
     glPolygonMode(GL_FRONT,GL_LINE);
     glFrontFace(GL_CCW);
       
     glLineWidth(6);
 
     glBegin(GL_POLYGON);

  glVertex2i(0,20);
       glVertex2i(-30,-30);
       glVertex2i(40,0);
       glVertex2i(-40,0);
       glVertex2i(30,-30);
     glEnd();
     glFlush();
}
int main(int argc,char**argv){

glutInit(&argc,argv);
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
glutInitWindowSize(500,500);
glutInitWindowPosition(0,0);
glutCreateWindow("gravic");
glutDisplayFunc(myDisplay);
glutMainLoop();

return 0;
}

Comments: