Question: GIVE ME THE OUTPUT/IMAGE OF THE CODE BELOW #include void init() { glClearColor(1.0, 1.0, 1.0, 1.0); // set background color to white glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0.0,

GIVE ME THE OUTPUT/IMAGE OF THE CODE BELOW #include

void init()

{

glClearColor(1.0, 1.0, 1.0, 1.0); // set background color to white

glMatrixMode(GL_PROJECTION);

glLoadIdentity();

glOrtho(0.0, 512.0, 512.0, 0.0, -1.0, 1.0);

}

void display()

{

glClear(GL_COLOR_BUFFER_BIT); // clear the screen

// Mark

// Draw Background

glBegin(GL_QUADS);

glColor3f(0.0, 0.7, 1.0); // blue

glVertex2f(0.0, 0.0);

glVertex2f(0.0, 512.0);

glVertex2f(512.0, 512.0);

glVertex2f(512.0, 0.0);

glEnd();

// Draw Object

glBegin(GL_QUADS);

glColor3f(1.0, 1.0, 0.0); // yellow

glVertex2f(100.0, 100.0);

glVertex2f(100.0, 150.0);

glVertex2f(150.0, 150.0);

glVertex2f(150.0, 100.0);

glEnd();

// Draw Mario

glBegin(GL_QUADS);

glColor3f(1.0, 0.0, 0.0); // red

glVertex2f(250.0, 250.0);

glVertex2f(250.0, 300.0);

glVertex2f(300.0, 300.0);

glVertex2f(300.0, 250.0);

glEnd();

glFlush();

}

int main(int argc, char** argv)

{

glutInit(&argc, argv);

glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);

glutInitWindowSize(512, 512);

glutCreateWindow("Super Mario Bros");

init();

glutDisplayFunc(display);

glutMainLoop();

return 0;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!