Program to plot a Quadrant

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

void quads()
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1,0,0);
glBegin(GL_QUADS);
glVertex2i(-60,0);
glVertex2i(-40,50);
glVertex2i(60,30);
glVertex2i(60,-50);
glEnd();
glFlush();
}

void init()
{
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(-65,65,-65,65);
}

int main(int argc,char **argv)
{
glutInitDisplayMode(GLUT_RGB|GLUT_SINGLE);
glutInitWindowSize(500,500);
glutCreateWindow("QUADS");
init();
glutDisplayFunc(quads);
glutMainLoop();
}


Popular posts from this blog

Shutdown Pc

Ellipse using OpenGl

String Comparisons