You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
827 B
C++
37 lines
827 B
C++
#include <cstdlib>
|
|
#include <functional>
|
|
#include <thread>
|
|
#include <iostream>
|
|
#include "imgui_hud_shared.h"
|
|
|
|
#ifdef HAVE_DBUS
|
|
#include "dbus_info.h"
|
|
#endif
|
|
|
|
namespace MangoHud { namespace GL {
|
|
|
|
notify_thread notifier;
|
|
static bool cfg_inited = false;
|
|
ImVec2 window_size;
|
|
bool inited = false;
|
|
overlay_params params {};
|
|
|
|
// seems to quit by itself though
|
|
static std::unique_ptr<notify_thread, std::function<void(notify_thread *)>>
|
|
stop_it(¬ifier, [](notify_thread *n){ stop_notifier(*n); });
|
|
|
|
void imgui_init()
|
|
{
|
|
if (cfg_inited)
|
|
return;
|
|
parse_overlay_config(¶ms, getenv("MANGOHUD_CONFIG"));
|
|
notifier.params = ¶ms;
|
|
start_notifier(notifier);
|
|
window_size = ImVec2(params.width, params.height);
|
|
init_system_info();
|
|
cfg_inited = true;
|
|
init_cpu_stats(params);
|
|
}
|
|
|
|
}} // namespaces
|