EGL: Warn if non-blocking swap buffers is not available

This commit is contained in:
Kovid Goyal 2019-03-21 09:46:46 +05:30
parent bfb97a6e6f
commit a2e47d2d0e
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 11 additions and 1 deletions

10
glfw/egl_context.c vendored
View File

@ -612,6 +612,15 @@ GLFWbool _glfwCreateContextEGL(_GLFWwindow* window,
window->context.egl.config = config;
EGLint a = EGL_MIN_SWAP_INTERVAL;
if (!eglGetConfigAttrib(_glfw.egl.display, config, a, &a)) {
_glfwInputError(GLFW_VERSION_UNAVAILABLE, "EGL: could not check for non-blocking buffer swap with error: %s", getEGLErrorString(eglGetError()));
} else {
if (a > 0) {
_glfwInputError(GLFW_VERSION_UNAVAILABLE, "EGL: non-blocking swap buffers not available, minimum swap interval is: %d", a);
}
}
// Load the appropriate client library
if (!_glfw.egl.KHR_get_all_proc_addresses)
{
@ -783,4 +792,3 @@ GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* handle)
return window->context.egl.surface;
}

2
glfw/egl_context.h vendored
View File

@ -87,6 +87,8 @@ typedef struct wl_egl_window* EGLNativeWindowType;
#define EGL_NO_DISPLAY ((EGLDisplay) 0)
#define EGL_NO_CONTEXT ((EGLContext) 0)
#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType) 0)
#define EGL_MIN_SWAP_INTERVAL 0x303B
#define EGL_MAX_SWAP_INTERVAL 0x303C
#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002
#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001