Make the GLFW embedder example work on Linux (flutter/engine#34156)
This commit is contained in:
@@ -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<void*>(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) {
|
||||
|
||||
Reference in New Issue
Block a user