mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-17 22:23:31 +00:00
Refactor SDL overlay drawing into OverlayManager for sharing with other renderers
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <QString>
|
||||
|
||||
#include <SDL.h>
|
||||
#include <SDL_ttf.h>
|
||||
|
||||
namespace Overlay {
|
||||
|
||||
@@ -24,6 +25,7 @@ class OverlayManager
|
||||
{
|
||||
public:
|
||||
OverlayManager();
|
||||
~OverlayManager();
|
||||
|
||||
bool isOverlayEnabled(OverlayType type);
|
||||
char* getOverlayText(OverlayType type);
|
||||
@@ -31,16 +33,24 @@ public:
|
||||
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;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user