diff --git a/src/egl_context.c b/src/egl_context.c index 819a2b2d8..8ff519273 100644 --- a/src/egl_context.c +++ b/src/egl_context.c @@ -395,7 +395,13 @@ GLFWbool _glfwInitEGL(void) return GLFW_FALSE; } +#if defined(_WIN32) + _GLFWwindow* mainWindow = _glfw.windowListHead; + HDC dc = GetDC(mainWindow->win32.handle); + _glfw.egl.display = eglGetDisplay(dc); +#else _glfw.egl.display = eglGetDisplay(_GLFW_EGL_NATIVE_DISPLAY); +#endif if (_glfw.egl.display == EGL_NO_DISPLAY) { _glfwInputError(GLFW_API_UNAVAILABLE,