EGL: Warn if non-blocking swap buffers is not available
This commit is contained in:
parent
bfb97a6e6f
commit
a2e47d2d0e
10
glfw/egl_context.c
vendored
10
glfw/egl_context.c
vendored
@ -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
2
glfw/egl_context.h
vendored
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user