Quiz

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

#include<windows.

h>
#include<glut.h>
void display()
{ glClearColor(1,1,1,0);
glClear(GL_COLOR_BUFFER_BIT);
glPointSize(100);
glBegin(GL_LINES);
glColor3f(1,0,0);
glVertex2f(-0.3,0.1);
glVertex2f(-0.1,0.1);
glVertex2f(-0.3,0.1);
glVertex2f(-0.3,-0.2);
glVertex2f(-0.1,-0.2);
glVertex2f(-0.3,-0.2);

glVertex2f(0.3,0.1);
glVertex2f(0.1,0.1);
glVertex2f(0.1,0.1);
glVertex2f(0.1,-0.2);
glVertex2f(0.1,-0.2);
glVertex2f(0.3,-0.2);
glVertex2f(0.3,-0.2);
glVertex2f(0.3,-0.1);
glVertex2f(0.3,-0.1);
glVertex2f(0.2,-0.1);
glEnd();

glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
glBegin(GL_QUADS);
glVertex2f(0.5,0.5);
glVertex2f(0.5,-0.5);
glVertex2f(-0.5,-0.5);
glVertex2f(-0.5,0.5);
glEnd();
glBegin(GL_QUADS);
glVertex2f(0.6,0.6);
glVertex2f(0.6,-0.6);
glVertex2f(-0.6,-0.6);
glVertex2f(-0.6,0.6);
glEnd();
glBegin(GL_LINES);
glColor3f(1,0,0);
glVertex2f(0.2,-0.6);
glVertex2f(0.2,-0.8);
glVertex2f(-0.2,-0.6);
glVertex2f(-0.2,-0.8);
glEnd();
glBegin(GL_LINE_LOOP);
glVertex2f(0.4,-0.8);
glVertex2f(0.4,-0.9);
glVertex2f(-0.4,-0.9);
glVertex2f(-0.4,-0.8);
glEnd();
glFlush();}
int main(int argc ,char** argv)
{
glutInit(&argc ,argv);
glutCreateWindow("point");
glutInitWindowSize(460,400);
glutInitWindowPosition(200,200);
glutDisplayFunc(display);
glutMainLoop();
}

You might also like