Program to plot a point

#include<GL/glut.h>
#include<Gl/glu.h>
#include<Gl/gl.h>

void point()
{
glClear(GL_COLOR_BUFFER_BIT);        //clear frame buffers bit
glColor3f(1.0,0,0);                                       //color to point(red,green,blue);
glPointSize(10);                                           // point size
glBegin(GL_POINTS);                              
glVertex2f(0.5,0);                                         //point location
glVertex2f(0,0);                                           //point location
glEnd();                                                       //glBegin() ends here
glFlush();                                                    //function to display
}
int main(int argc, char **argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_RGB|GLUT_SINGLE);
glutInitWindowSize(500,500);                                        //define window size
glutCreateWindow("Plot point");                                    //Heading of window
glutDisplayFunc(point);                                                 //void point() call
glutMainLoop();
}


Popular posts from this blog

Shutdown Pc

Ellipse using OpenGl

String Comparisons