OpenGL - how to check a default framebuffer color encoding

Viewed 217

I have created an OpenGL application using GLFW library. The default framebuffer supports SRGB: glfwWindowHint(GLFW_SRGB_CAPABLE, 1);

After calling glEnable(GL_FRAMEBUFFER_SRGB) I get a desired result on the screen when render a test texture.

Out of curiosity I have called glGetFramebufferAttachmentParameteriv for the default framebuffer:

GLint encoding = 0;
glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_BACK_LEFT, GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, &encoding);

The encoding variable equals GL_LINEAR (also for GL_FRONT_LEFT buffer). The documentation says that:

For a default framebuffer, color encoding is determined by the implementation.

but I have set SRGB encoding explicitly during window creation so the encoding variable should be equal to GL_SRGB. Could you explain how does it work ?

1 Answers
Related