2019-01-20 07:05:56 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
|
2019-02-13 04:39:10 +00:00
|
|
|
#include <SDL.h>
|
|
|
|
|
2019-02-13 02:43:38 +00:00
|
|
|
namespace Overlay {
|
|
|
|
|
|
|
|
enum OverlayType {
|
|
|
|
OverlayDebug,
|
2019-03-17 22:08:21 +00:00
|
|
|
OverlayStatusUpdate,
|
2019-02-13 02:43:38 +00:00
|
|
|
OverlayMax
|
|
|
|
};
|
|
|
|
|
|
|
|
class IOverlayRenderer
|
2019-01-20 07:05:56 +00:00
|
|
|
{
|
|
|
|
public:
|
2019-02-13 02:43:38 +00:00
|
|
|
virtual ~IOverlayRenderer() = default;
|
|
|
|
|
|
|
|
virtual void notifyOverlayUpdated(OverlayType type) = 0;
|
|
|
|
};
|
2019-01-20 07:05:56 +00:00
|
|
|
|
2019-02-13 02:43:38 +00:00
|
|
|
class OverlayManager
|
|
|
|
{
|
|
|
|
public:
|
2019-01-20 07:05:56 +00:00
|
|
|
OverlayManager();
|
|
|
|
|
|
|
|
bool isOverlayEnabled(OverlayType type);
|
|
|
|
char* getOverlayText(OverlayType type);
|
2019-02-13 02:43:38 +00:00
|
|
|
void setOverlayTextUpdated(OverlayType type);
|
2019-01-20 07:05:56 +00:00
|
|
|
void setOverlayState(OverlayType type, bool enabled);
|
2019-02-13 04:39:10 +00:00
|
|
|
SDL_Color getOverlayColor(OverlayType type);
|
2019-02-13 06:36:56 +00:00
|
|
|
int getOverlayFontSize(OverlayType type);
|
2019-01-20 07:05:56 +00:00
|
|
|
|
2019-02-13 02:43:38 +00:00
|
|
|
void setOverlayRenderer(IOverlayRenderer* renderer);
|
|
|
|
|
2019-01-20 07:05:56 +00:00
|
|
|
struct {
|
|
|
|
bool enabled;
|
2019-02-13 06:36:56 +00:00
|
|
|
int fontSize;
|
2019-02-13 04:39:10 +00:00
|
|
|
SDL_Color color;
|
2019-01-20 07:05:56 +00:00
|
|
|
char text[512];
|
|
|
|
} m_Overlays[OverlayMax];
|
2019-02-13 02:43:38 +00:00
|
|
|
IOverlayRenderer* m_Renderer;
|
2019-01-20 07:05:56 +00:00
|
|
|
};
|
2019-02-13 02:43:38 +00:00
|
|
|
|
|
|
|
}
|