mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Added GLFW error-callback into FlutterEmbedderGLFW (flutter/engine#19998)
GLFW Error callback useful to clarify reasons of 'glfwInit()' failure. On some platforms/desktop environments may be really strange failure reasons, like (in my case): "Linux: Failed to initialize inotify: Too many open files", so descriptive error messages helps to solve problem.
This commit is contained in:
parent
0937aaa3c6
commit
44252b3f41
@ -129,6 +129,10 @@ void printUsage() {
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
void GLFW_ErrorCallback(int error, const char* description) {
|
||||
std::cout << "GLFW Error: (" << error << ") " << description << std::endl;
|
||||
}
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
if (argc != 3) {
|
||||
printUsage();
|
||||
@ -138,6 +142,8 @@ int main(int argc, const char* argv[]) {
|
||||
std::string project_path = argv[1];
|
||||
std::string icudtl_path = argv[2];
|
||||
|
||||
glfwSetErrorCallback(GLFW_ErrorCallback);
|
||||
|
||||
int result = glfwInit();
|
||||
assert(result == GLFW_TRUE);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user