I would like to know what are the following "framebuffer related hints" of GLFW3 function glfwWindowHint :


  • What is the purpose of this?
  • Usually their default values are enough?
  • Where are those bits stored? In a buffer in the GPU?
  • What do they affect? And by that I mean in what way

Thank you in advance!


1 Answer 1


These flags allow you to specify the formatting of your color target, and depth stencil buffers that are a part of the final frame buffer.

The color target is typically formatted in a R8G8B8A8 format, providing 8 bits of precision for each color, and the alpha channel. This gives a total of 32 bits.

The final two flags specify formatting for the depth stencil, this is typically formatted as D24S8, and this indicates 24 bits of precision for the depth buffer, and 8 bits for the stencil. Higher precision on the depth buffer allows for more accurate depth testing when checking for overdraw.

When the frame buffer targets are created, it will use these formatting specifiers to indicate to the rendering pipeline how to interpret the data when reading from and writing to it. These buffers are allocated in VRAM to provide faster access to the GPU.

  • \$\begingroup\$ Note torbjoernwh's edit reason: "the typical framebuffer format on desktop GL is 8-bits per channel. Not 32 bits per channel. If you used 32 bits per channel you would waste a lot of bits, as monitors are limited to much fewer bits. Also, the final framebuffer would require 4x as much memory..." \$\endgroup\$
    – House
    Commented Jun 25, 2013 at 21:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .