1.3: Scaling
Use the same code as in tutorial 1.1, but this thime change the following line:
// copy:
glBlitFramebuffer(
0, 0, framebufferwidth, framebufferheight, // source area: we rendered into 600 x 300
0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, // destination area: full window size
GL_COLOR_BUFFER_BIT, // buffer bitfield: copy the color only (from location "GL_COLOR_ATTACHMENT0")
GL_NEAREST); // filtering parameter: see Tutorial 9.2 Texture Parameters
If we want to copy the the content of our off-screen framebuffer into the full window, we have to specify the window size in the function glBlitFramebuffer(...) which actually does the copy.
Now resize your framebuffer to only a small part of the window, for example 50 x 50:
unsigned int framebufferwidth = 50;
unsigned int framebufferheight = 50;
The result will look like this: