149 {
150 if (argc != 3) {
152 return 1;
153 }
154
155 std::string project_path =
argv[1];
156 std::string icudtl_path =
argv[2];
157
159
162 std::cout << "Could not initialize GLFW." << std::endl;
163 return EXIT_FAILURE;
164 }
165
166#if defined(__linux__)
167 glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API);
168#endif
169
170 GLFWwindow*
window = glfwCreateWindow(
173 std::cout << "Could not create GLFW window." << std::endl;
174 return EXIT_FAILURE;
175 }
176
177 int framebuffer_width, framebuffer_height;
178 glfwGetFramebufferSize(
window, &framebuffer_width, &framebuffer_height);
180
182 if (!run_result) {
183 std::cout << "Could not run the Flutter engine." << std::endl;
184 return EXIT_FAILURE;
185 }
186
190
191 while (!glfwWindowShouldClose(
window)) {
192 glfwWaitEvents();
193 }
194
195 glfwDestroyWindow(
window);
196 glfwTerminate();
197
198 return EXIT_SUCCESS;
199}
bool RunFlutter(GLFWwindow *window, const std::string &project_path, const std::string &icudtl_path)
static void GLFWKeyCallback(GLFWwindow *window, int key, int scancode, int action, int mods)
static const size_t kInitialWindowHeight
static const size_t kInitialWindowWidth
void GLFWwindowSizeCallback(GLFWwindow *window, int width, int height)
void GLFWmouseButtonCallback(GLFWwindow *window, int key, int action, int mods)
void GLFW_ErrorCallback(int error, const char *description)