mirror of
https://github.com/glfw/glfw.git
synced 2024-11-11 13:03:52 +00:00
EGL: Fix creation of single-buffered windows
The EGL backend ignored the state of GLFW_DOUBLEBUFFER and always
created a double-buffered EGL window.
This sets the EGL_RENDER_BUFFER attribute at EGL window creation
appropriately.
Fixes #1843.
(cherry picked from commit 114776a246
)
This commit is contained in:
parent
6769ffcd0f
commit
163fa83fac
@ -173,7 +173,7 @@ static GLFWbool chooseEGLConfig(const _GLFWctxconfig* ctxconfig,
|
|||||||
u->stencilBits = getEGLConfigAttrib(n, EGL_STENCIL_SIZE);
|
u->stencilBits = getEGLConfigAttrib(n, EGL_STENCIL_SIZE);
|
||||||
|
|
||||||
u->samples = getEGLConfigAttrib(n, EGL_SAMPLES);
|
u->samples = getEGLConfigAttrib(n, EGL_SAMPLES);
|
||||||
u->doublebuffer = GLFW_TRUE;
|
u->doublebuffer = desired->doublebuffer;
|
||||||
|
|
||||||
u->handle = (uintptr_t) n;
|
u->handle = (uintptr_t) n;
|
||||||
usableCount++;
|
usableCount++;
|
||||||
@ -596,6 +596,9 @@ GLFWbool _glfwCreateContextEGL(_GLFWwindow* window,
|
|||||||
setAttrib(EGL_GL_COLORSPACE_KHR, EGL_GL_COLORSPACE_SRGB_KHR);
|
setAttrib(EGL_GL_COLORSPACE_KHR, EGL_GL_COLORSPACE_SRGB_KHR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!fbconfig->doublebuffer)
|
||||||
|
setAttrib(EGL_RENDER_BUFFER, EGL_SINGLE_BUFFER);
|
||||||
|
|
||||||
setAttrib(EGL_NONE, EGL_NONE);
|
setAttrib(EGL_NONE, EGL_NONE);
|
||||||
|
|
||||||
window->context.egl.surface =
|
window->context.egl.surface =
|
||||||
|
@ -80,6 +80,8 @@ typedef struct wl_egl_window* EGLNativeWindowType;
|
|||||||
#define EGL_OPENGL_ES_API 0x30a0
|
#define EGL_OPENGL_ES_API 0x30a0
|
||||||
#define EGL_OPENGL_API 0x30a2
|
#define EGL_OPENGL_API 0x30a2
|
||||||
#define EGL_NONE 0x3038
|
#define EGL_NONE 0x3038
|
||||||
|
#define EGL_RENDER_BUFFER 0x3086
|
||||||
|
#define EGL_SINGLE_BUFFER 0x3085
|
||||||
#define EGL_EXTENSIONS 0x3055
|
#define EGL_EXTENSIONS 0x3055
|
||||||
#define EGL_CONTEXT_CLIENT_VERSION 0x3098
|
#define EGL_CONTEXT_CLIENT_VERSION 0x3098
|
||||||
#define EGL_NATIVE_VISUAL_ID 0x302e
|
#define EGL_NATIVE_VISUAL_ID 0x302e
|
||||||
|
Loading…
Reference in New Issue
Block a user