mirror of
https://github.com/Blinue/Magpie.git
synced 2026-06-24 02:04:10 +00:00
49 lines
744 B
C++
49 lines
744 B
C++
#pragma once
|
|
#include "pch.h"
|
|
#include <deque>
|
|
|
|
struct ImFont;
|
|
class ImGuiImpl;
|
|
|
|
class OverlayDrawer {
|
|
public:
|
|
OverlayDrawer();
|
|
OverlayDrawer(const OverlayDrawer&) = delete;
|
|
OverlayDrawer(OverlayDrawer&&) = delete;
|
|
|
|
~OverlayDrawer();
|
|
|
|
bool Initialize();
|
|
|
|
void Draw();
|
|
|
|
bool IsUIVisiable() const noexcept {
|
|
return _isUIVisiable;
|
|
}
|
|
|
|
void SetUIVisibility(bool value);
|
|
|
|
private:
|
|
void _DrawFPS();
|
|
|
|
void _DrawUI();
|
|
|
|
void _RetrieveHardwareInfo();
|
|
|
|
float _dpiScale = 1.0f;
|
|
|
|
bool _isUIVisiable = false;
|
|
|
|
ImFont* _fontUI = nullptr;
|
|
ImFont* _fontFPS = nullptr;
|
|
|
|
std::deque<float> _frameTimes;
|
|
UINT _validFrames = 0;
|
|
|
|
struct {
|
|
std::string gpuName;
|
|
std::string cpuName;
|
|
} _hardwareInfo;
|
|
|
|
std::unique_ptr<ImGuiImpl> _imguiImpl;
|
|
};
|