mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-11-16 00:07:58 +00:00
56 lines
1.1 KiB
C++
56 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <QString>
|
|
|
|
#include <SDL.h>
|
|
#include <SDL_ttf.h>
|
|
|
|
namespace Overlay {
|
|
|
|
enum OverlayType {
|
|
OverlayDebug,
|
|
OverlayStatusUpdate,
|
|
OverlayMax
|
|
};
|
|
|
|
class IOverlayRenderer
|
|
{
|
|
public:
|
|
virtual ~IOverlayRenderer() = default;
|
|
|
|
virtual void notifyOverlayUpdated(OverlayType type) = 0;
|
|
};
|
|
|
|
class OverlayManager
|
|
{
|
|
public:
|
|
OverlayManager();
|
|
~OverlayManager();
|
|
|
|
bool isOverlayEnabled(OverlayType type);
|
|
char* getOverlayText(OverlayType type);
|
|
void setOverlayTextUpdated(OverlayType type);
|
|
void setOverlayState(OverlayType type, bool enabled);
|
|
SDL_Color getOverlayColor(OverlayType type);
|
|
int getOverlayFontSize(OverlayType type);
|
|
SDL_Surface* getUpdatedOverlaySurface(OverlayType type);
|
|
|
|
void setOverlayRenderer(IOverlayRenderer* renderer);
|
|
|
|
private:
|
|
void notifyOverlayUpdated(OverlayType type);
|
|
|
|
struct {
|
|
bool enabled;
|
|
int fontSize;
|
|
SDL_Color color;
|
|
char text[512];
|
|
|
|
TTF_Font* font;
|
|
SDL_Surface* surface;
|
|
} m_Overlays[OverlayMax];
|
|
IOverlayRenderer* m_Renderer;
|
|
QByteArray m_FontData;
|
|
};
|
|
|
|
}
|