1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#pragma once
#include <string>
#include "imgui\imgui.h"
class Unit;
class Renderer
{
private:
static Renderer* _instance;
Renderer();
~Renderer();
public:
static Renderer* Get();
bool inFrame;
void BeginScene();
void EndScene();
void RenderText(const std::string& text, const ImVec2& position, float size, uint32_t color, bool center = false);
void RenderLine(const ImVec2& from, const ImVec2& to, uint32_t color, float thickness = 1.0f);
void RenderPolygon(const ImVec2* points, int pointCount, uint32_t color, float thickness = 1.0f);
void RenderCircle(const ImVec2& position, float radius, uint32_t color, float thickness = 1.0f, uint32_t segments = 16);
void RenderCircleFilled(const ImVec2& position, float radius, uint32_t color, uint32_t segments = 16);
void RenderRect(const ImVec2& from, const ImVec2& to, uint32_t color, float rounding = 0.0f, uint32_t roundingCornersFlags = ImDrawCornerFlags_All, float thickness = 1.0f);
void RenderRect(const ImVec2& one, const ImVec2& two, const ImVec2& three, const ImVec2& four, uint32_t color, float thickness = 1.0f);
void RenderRectFilled(const ImVec2& from, const ImVec2& to, uint32_t color, float rounding = 0.0f, uint32_t roundingCornersFlags = ImDrawCornerFlags_All);
void DrawUnitCollisionRectangle(ImVec2 screenPositionCenter, ImVec2 collision, uint32_t color);
};
|