|
@@ -27,6 +27,14 @@
|
|
|
#include "nativeWindowHandle.h"
|
|
#include "nativeWindowHandle.h"
|
|
|
#include "get_x11.h"
|
|
#include "get_x11.h"
|
|
|
|
|
|
|
|
|
|
+#ifndef EGL_GL_COLORSPACE_KHR
|
|
|
|
|
+#define EGL_GL_COLORSPACE_KHR 0x309D
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
+#ifndef EGL_GL_COLORSPACE_SRGB_KHR
|
|
|
|
|
+#define EGL_GL_COLORSPACE_SRGB_KHR 0x3089
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
TypeHandle eglGraphicsWindow::_type_handle;
|
|
TypeHandle eglGraphicsWindow::_type_handle;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -233,7 +241,16 @@ open_window() {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- _egl_surface = eglCreateWindowSurface(_egl_display, eglgsg->_fbconfig, (NativeWindowType) _xwindow, nullptr);
|
|
|
|
|
|
|
+ EGLint attribs[4];
|
|
|
|
|
+ EGLint *attribs_p = nullptr;
|
|
|
|
|
+ if (eglgsg->get_fb_properties().get_srgb_color()) {
|
|
|
|
|
+ attribs[0] = EGL_GL_COLORSPACE_KHR;
|
|
|
|
|
+ attribs[1] = EGL_GL_COLORSPACE_SRGB_KHR;
|
|
|
|
|
+ attribs[2] = EGL_NONE;
|
|
|
|
|
+ attribs[3] = EGL_NONE;
|
|
|
|
|
+ attribs_p = attribs;
|
|
|
|
|
+ }
|
|
|
|
|
+ _egl_surface = eglCreateWindowSurface(_egl_display, eglgsg->_fbconfig, (NativeWindowType) _xwindow, attribs_p);
|
|
|
if (eglGetError() != EGL_SUCCESS) {
|
|
if (eglGetError() != EGL_SUCCESS) {
|
|
|
egldisplay_cat.error()
|
|
egldisplay_cat.error()
|
|
|
<< "Failed to create window surface.\n";
|
|
<< "Failed to create window surface.\n";
|