diff --git a/engine/src/flutter/examples/glfw/FlutterEmbedderGLFW.cc b/engine/src/flutter/examples/glfw/FlutterEmbedderGLFW.cc index b4b7fb4fe5..8b17b25958 100644 --- a/engine/src/flutter/examples/glfw/FlutterEmbedderGLFW.cc +++ b/engine/src/flutter/examples/glfw/FlutterEmbedderGLFW.cc @@ -103,6 +103,9 @@ bool RunFlutter(GLFWwindow* window, config.open_gl.fbo_callback = [](void*) -> uint32_t { return 0; // FBO0 }; + config.open_gl.gl_proc_resolver = [](void*, const char* name) -> void* { + return reinterpret_cast(glfwGetProcAddress(name)); + }; // This directory is generated by `flutter build bundle`. std::string assets_path = project_path + "/build/flutter_assets"; @@ -153,6 +156,10 @@ int main(int argc, const char* argv[]) { return EXIT_FAILURE; } +#if defined(__linux__) + glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API); +#endif + GLFWwindow* window = glfwCreateWindow( kInitialWindowWidth, kInitialWindowHeight, "Flutter", NULL, NULL); if (window == nullptr) {