From e69d71cd4d01611adcced3f6e023005f0e9af110 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 24 Mar 2018 22:20:06 +0100 Subject: [PATCH] Open trace passed as standalone server argument. --- standalone/src/main.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/standalone/src/main.cpp b/standalone/src/main.cpp index 66943ead..62a74a38 100644 --- a/standalone/src/main.cpp +++ b/standalone/src/main.cpp @@ -15,8 +15,19 @@ static void error_callback(int error, const char* description) fprintf(stderr, "Error %d: %s\n", error, description); } -int main(int, char**) +int main( int argc, char** argv ) { + std::unique_ptr view; + + if( argc == 2 ) + { + auto f = std::unique_ptr( tracy::FileRead::Open( argv[1] ) ); + if( f ) + { + view = std::make_unique( *f ); + } + } + // Setup window glfwSetErrorCallback(error_callback); if (!glfwInit()) @@ -65,7 +76,6 @@ int main(int, char**) ImVec4 clear_color = ImColor(114, 144, 154); char addr[1024] = { "127.0.0.1" }; - std::unique_ptr view; // Main loop while (!glfwWindowShouldClose(window))