Question: Update the following OpenGL code to include the blanket, pillow, suitcases, wooden bed supports and table lamp. Does not have to be perfect, just basic

 Update the following OpenGL code to include the blanket, pillow, suitcases,

Update the following OpenGL code to include the blanket, pillow, suitcases, wooden bed supports and table lamp. Does not have to be perfect, just basic 2D rendition of these objects added to the already existing scene produced by the attached program. PLEASE post source code, shaders used and the command to run the program. I will give a quick like upon successful answer, thanks!

#include #include

int main(void) { GLFWwindow* window;

if (!glfwInit()) return -1;

window = glfwCreateWindow(640, 480, "OpenGL Test", NULL, NULL); if (!window) { glfwTerminate(); return -1; }

glfwMakeContextCurrent(window);

while (!glfwWindowShouldClose(window)) { int width, height; glfwGetFramebufferSize(window, &width, &height); glViewport(0, 0, width, height);

// Clear the screen to white glClearColor(1.0, 1.0, 1.0, 1.0); glClear(GL_COLOR_BUFFER_BIT);

// Draw the bed glBegin(GL_QUADS); glColor3f(0.8, 0.8, 0.8); glVertex2f(-0.7, -0.7); glVertex2f(0.7, -0.7); glVertex2f(0.7, -0.5); glVertex2f(-0.7, -0.5); glEnd();

// Draw the floor glBegin(GL_QUADS); glColor3f(0.9, 0.9, 0.9); glVertex2f(-1.0, -1.0); glVertex2f(1.0, -1.0); glVertex2f(1.0, -0.7); glVertex2f(-1.0, -0.7); glEnd();

// Draw the window glBegin(GL_QUADS); glColor3f(0.7, 0.7, 1.0); glVertex2f(0.6, 0.6); glVertex2f(0.8, 0.6); glVertex2f(0.8, 0.8); glVertex2f(0.6, 0.8); glEnd();

// Draw the fridge glBegin(GL_QUADS); glColor3f(0.5, 0.5, 0.5); glVertex2f(-0.9, -0.7); glVertex2f(-0.7, -0.7); glVertex2f(-0.7, 0.7); glVertex2f(-0.9, 0.7); glEnd();

glfwSwapBuffers(window);

glfwPollEvents(); }

glfwTerminate(); return 0; }

COMMAND FOR RUNNING THIS:

g++ -o test test.cpp -lglfw -lGL -lX11

./test

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!