diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cf358996..2b6e6243 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -48,7 +48,8 @@ elseif (_GLFW_OSMESA) target_sources(glfw PRIVATE null_platform.h null_joystick.h posix_time.h posix_thread.h osmesa_context.h null_init.c null_monitor.c null_window.c null_joystick.c - posix_time.c posix_thread.c osmesa_context.c) + posix_time.c posix_thread.c egl_context.c + osmesa_context.c) endif() if (_GLFW_X11 OR _GLFW_WAYLAND) diff --git a/src/null_init.c b/src/null_init.c index 68599d1f..d72b06bf 100644 --- a/src/null_init.c +++ b/src/null_init.c @@ -48,10 +48,11 @@ void _glfwPlatformTerminate(void) { _glfw_free(_glfw.null.clipboardString); _glfwTerminateOSMesa(); + _glfwTerminateEGL(); } const char* _glfwPlatformGetVersionString(void) { - return _GLFW_VERSION_NUMBER " null OSMesa"; + return _GLFW_VERSION_NUMBER " null OSMesa EGL"; } diff --git a/src/null_window.c b/src/null_window.c index 1f59540e..6a251153 100644 --- a/src/null_window.c +++ b/src/null_window.c @@ -121,10 +121,12 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window, if (!_glfwCreateContextOSMesa(window, ctxconfig, fbconfig)) return GLFW_FALSE; } - else + else if (ctxconfig->source == GLFW_EGL_CONTEXT_API) { - _glfwInputError(GLFW_API_UNAVAILABLE, "Null: EGL not available"); - return GLFW_FALSE; + if (!_glfwInitEGL()) + return GLFW_FALSE; + if (!_glfwCreateContextEGL(window, ctxconfig, fbconfig)) + return GLFW_FALSE; } } @@ -522,6 +524,21 @@ const char* _glfwPlatformGetClipboardString(void) return _glfw.null.clipboardString; } +EGLenum _glfwPlatformGetEGLPlatform(EGLint** attribs) +{ + return 0; +} + +EGLNativeDisplayType _glfwPlatformGetEGLNativeDisplay(void) +{ + return 0; +} + +EGLNativeWindowType _glfwPlatformGetEGLNativeWindow(_GLFWwindow* window) +{ + return 0; +} + const char* _glfwPlatformGetScancodeName(int scancode) { if (scancode < GLFW_KEY_SPACE || scancode > GLFW_KEY_LAST)