1.2: Viewport

Use the same code as in the previous tutorial, and comment just 1 line out:

void Initialize()

{

// settings:

glClearColor(0.3f, 0.3f, 0.3f, 0); // background = gray

glClear(GL_COLOR_BUFFER_BIT); // clear the default framebuffer just once

// now the complete screen is gray

glClearColor(0.3f, 0.4f, 0.8f, 0); // change background to skyblue

//glViewport(0, 0, framebufferwidth, framebufferheight); // define the draw area

glViewport(...) defines the area in which we draw.

If we use our own framebuffer which has a size different to the window size, we have to adjust the drawing area.