Skip to content

Commit

Permalink
Add a check that the output buffer is actually sRGB
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Dec 1, 2023
1 parent 97f5cad commit ad4e9bb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kitty/glfw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ad4e9bb

Please sign in to comment.