Add a check that the output buffer is actually sRGB

This commit is contained in:
Kovid Goyal 2023-12-01 13:58:09 +05:30
parent 97f5cad335
commit ad4e9bb42c
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -1135,7 +1135,11 @@ create_os_window(PyObject UNUSED *self, PyObject *args, PyObject *kw) {
if (ret == NULL) return NULL;
Py_DECREF(ret);
get_platform_dependent_config_values(glfw_window);
GLint encoding;
glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_BACK_LEFT, GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, &encoding);
if (encoding != GL_SRGB) log_error("The output buffer does not support sRGB color encoding, colors will be incorrect.");
is_first_window = false;
}
OSWindow *w = add_os_window();
w->handle = glfw_window;