Hello again!
I'm following a tutorial on (desktop) OpenGL 3.3 about gamma correction.
Basically to gain automatic gamma-corrected colors on the DESKTOP opengl we have to do:
1) Use the SRGBA texture format.
2) Use glEnable(GL_FRAMEBUFFER_SRGB) + at window gl context creation use a SRGB default framebuffer (e.g. GLFW_SRGB or equivalent depending on the library we're using).
Now I've read that this feature is available in OpenGLES3 too. However I got some problem with point 2 above.
-> glEnable(GL_FRAMEBUFFER_SRGB) does not seem to be present (well, this is more an OpenGLES3 question, rather then something related to the emulator).
-> To get a SRGB default framebuffer I've tried using the following code:
#ifdef _WIN32
#else
#endif
When I do so the program crashes with a:
eglGetError() = 12292 (0x00003004) at line (maked with (*) above):
EGL_CHECK(eglChooseConfig(sEGLDisplay, aEGLAttributes, aEGLConfigs, 1, &cEGLConfigs)); // (*)
Any hint ?
lemontree wrote: -> glEnable(GL_FRAMEBUFFER_SRGB) does not seem to be present (well, this is more an OpenGLES3 question, rather then something related to the emulator).
lemontree wrote:
I think this is unnecessary in GLES3, it's assumed to be enabled and cant be set from the API.
EGL_COLORSPACE_sRGB doesn't exist in EGL 1.4, in EGL 1.3 it was renamed to EGL_VG_COLORSPACE_sRGB, so the error for that sounds valid. Note this implies it is only supported in the core spec for VG not GLES. That said, I'm not sure you require that attribute anyway, as it should be sufficient to pass "EGL_GL_COLORSPACE_KHR, EGL_GL_COLORSPACE_SRGB_KHR"? Passing the name of the extension as the attribute value sounds like your error there. That requires the EGL_KHR_gl_colorspace extension however, which the emulator does not currently support, so that will likely return a BAD_ATTRIBUTE error also. For now at least, we only support linear color spaces in the emulator.
Hth,
Chris
Ok. Thank you for your support