diff --git a/src/api/api.cc b/src/api/api.cc index c432590..57a8ae7 100644 --- a/src/api/api.cc +++ b/src/api/api.cc @@ -4,6 +4,7 @@ #include +#include "mynteye/glog_init.h" #include "mynteye/utils.h" #include "api/synthetic.h" @@ -28,6 +29,17 @@ std::shared_ptr API::Create(std::shared_ptr device) { return std::make_shared(device); } +std::shared_ptr API::Create(int argc, char *argv[]) { + static glog_init _(argc, argv); + return std::make_shared(device::select()); +} + +std::shared_ptr API::Create( + int argc, char *argv[], std::shared_ptr device) { + static glog_init _(argc, argv); + return std::make_shared(device); +} + Model API::GetModel() const { return device_->GetModel(); } diff --git a/src/api/api.h b/src/api/api.h index def1055..0cc6cc5 100644 --- a/src/api/api.h +++ b/src/api/api.h @@ -40,6 +40,9 @@ class MYNTEYE_API API { static std::shared_ptr Create(); static std::shared_ptr Create(std::shared_ptr device); + static std::shared_ptr Create(int argc, char *argv[]); + static std::shared_ptr Create( + int argc, char *argv[], std::shared_ptr device); Model GetModel() const;