Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  hello.c
Language: C/C++
Code:
 #include<stdio.h>
 #include<Gl/glut.h>
 void myInit(){
      glClearColor(1.0,1.0,1.0,1.0);
      glMatrixMode(GL_PROJECTION);
      gluOrtho2D(-780,780,-420,420);
 }
 void linesegment(){
      glClear(GL_COLOR_BUFFER_BIT);
      glColor3f(1.0,0.0,0.0);
      glBegin(GL_LINES;
      glVertex2i(10,10);
      glVertex2i(10,150);
      glEnd();
      glFlush();
      
      
 }
 void main(int argc,char**argv)
 {glutInit(&argc,argv);
 glutInitDisplayMode(GLUT-SINGLE|GLUT_RGB);
 glutInitWindowPosition(0,0);
 glutInitWindowSize(1368,768);
 glutCreateWindow("Draw a line Segment");
 MyInit();
 glutDisplayFunc(linesegment);
 glutMainLoop();
 }
      
      
      
      
      
 
Comments: