From 2e39d18e94c9aa15aecf5803422b7f2e9a9ba991 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 15 Jul 2018 20:10:34 +0200 Subject: [PATCH] Web page opening functionality. --- standalone/src/main.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/standalone/src/main.cpp b/standalone/src/main.cpp index 6ae6f8aa..a241c233 100644 --- a/standalone/src/main.cpp +++ b/standalone/src/main.cpp @@ -1,6 +1,7 @@ #include #include "imgui_impl_glfw_gl3.h" #include +#include #include #include #include @@ -9,6 +10,7 @@ #ifdef _WIN32 # include +# include #endif #include "../../server/TracyBadVersion.hpp" @@ -20,6 +22,17 @@ static void glfw_error_callback(int error, const char* description) fprintf(stderr, "Error %d: %s\n", error, description); } +void OpenWebpage( const char* url ) +{ +#ifdef _WIN32 + ShellExecuteA( nullptr, nullptr, url, nullptr, nullptr, 0 ); +#else + char buf[1024]; + sprintf( buf, "xdg-open %s", url ); + system( buf ); +#endif +} + int main( int argc, char** argv ) { std::unique_ptr view;