0% found this document useful (0 votes)
3 views1 page

Cg1st Program

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Cg1st Program

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

#include<stdio.

h>

#include<GL/glut.h>

Void display()

glClear(GL_COLOR_BUFFER_BIT); //To Clear the buffer

glColor3f(0.0, 1.0, 1.0); //To change the color of the object

glClearColor(0, 0, 0, 1); //To change the background color

glLineWidth(10);

glBegin(GL_LINES); //OpenGL Basic Primitives to draw a line

glVertex2f(0.0, 0.0); //Coordinates of starting vertex

glVertex2f(0.5, 0.5); //Coordinates of starting vertex

glEnd(); //To delimit the vertices of primitive

glFlush(); //Empties the buffer and forces other commands to execute

Int main(int argc, char** argv)

glutInit(&argc, argv); //To initialize GLUT library

glutInitWindowSize(1280,780);

glutInitWindowPosition(200,200);

glutCreateWindow(“Simple line”); // To name the Output Window

glutDisplayFunc(display); //To set the display callbak to current window

glutMainLoop(); //To call the display in Loop

You might also like