GLArea sRGB support
GtkGLArea is not sRGB aware. This means output on the screen may have the wrong gamma. In other toolkits, there is usually an option to request sRGB output (to the "default framebuffer" in OpenGL jargon):
- freeglut has
GLUT_SRGB
display mode flag - SDL2 has
SDL_GL_FRAMEBUFFER_SRGB_CAPABLE
attribute https://wiki.libsdl.org/SDL_GL_SetAttribute - glfw3 has
GLFW_SRGB_CAPABLE
hint https://www.glfw.org/docs/latest/window_guide.html#window_hints_fb - Qt has
QSurfaceFormat::sRGBColorSpace
https://doc.qt.io/qt-5/qsurfaceformat.html#ColorSpace-enum
This could possibly be partially fixed by having a way to request GL_SRGB8_ALPHA8
or similar as the internal format for the texture backing the GtkGLArea, and using glEnable(GL_FRAMEBUFFER_SRGB)
to ensure gamma-correct blending to its framebuffer. There is however more that needs doing at the context-creation level.
The relevant OpenGL specification is at https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_framebuffer_sRGB.txt