Modules/Graphics/public/Graphics.hpp
2024-11-24 22:41:12 +03:00

109 lines
No EOL
1.5 KiB
C++

#pragma once
#include "GraphicsCommon.hpp"
// TODO : fix this ugly shit
namespace tp {
class Window;
class Graphics {
public:
class GL {
class Context;
Context* mContext;
private:
friend Graphics;
friend Window;
GL();
~GL();
void init();
void deinit();
void proc();
void draw();
public:
// TODO : API
private:
halnf mWidth = 100;
halnf mHeight = 100;
};
class GUI {
class Context;
Context* mContext;
private:
friend Graphics;
GUI();
~GUI();
void init(Window* window);
void deinit();
void proc();
void draw();
public:
// TODO : API
};
class Canvas {
class Context;
Context* mContext;
private:
friend Graphics;
friend Window;
Canvas();
~Canvas();
void init();
void deinit();
void proc();
void draw();
public:
enum Align : int2 {
CC = 0x0000,
CT = 0x0001,
CB = 0x0002,
LC = 0x0100,
LT = 0x0101,
LB = 0x0102,
RC = 0x0200,
RT = 0x0201,
RB = 0x0202,
};
RectF getAvaliableArea();
void rect(const RectF& rec, const RGBA& col, halnf round = 0);
void text(const String&, const RectF&, halnf size, Align, halnf marging, const RGBA&);
// TODO : API
private:
halnf mWidth = 600;
halnf mHeight = 600;
};
private:
friend Window;
Graphics() = default;
void init(Window* window);
void deinit();
void draw();
void proc();
private:
GUI mGui;
GL mGl;
Canvas mCanvas;
};
}