Reorganize a little
This commit is contained in:
parent
c375472bbe
commit
8df79328cd
7 changed files with 342 additions and 260 deletions
77
Graphics/public/Graphics.hpp
Normal file
77
Graphics/public/Graphics.hpp
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
#include "Strings.hpp"
|
||||
|
||||
namespace tp {
|
||||
|
||||
class ShowoffGlContext;
|
||||
class ShowoffGUIContext;
|
||||
class ShowoffCanvasContext;
|
||||
|
||||
class Window;
|
||||
class WindowContext;
|
||||
|
||||
class Showoff {
|
||||
public:
|
||||
class GL {
|
||||
ShowoffGlContext* mContext;
|
||||
public:
|
||||
GL();
|
||||
~GL();
|
||||
|
||||
void init();
|
||||
void deinit();
|
||||
static void beginDraw();
|
||||
static void endDraw();
|
||||
};
|
||||
|
||||
class GUI {
|
||||
ShowoffGUIContext* mContext;
|
||||
public:
|
||||
GUI();
|
||||
~GUI();
|
||||
|
||||
void init(Window* window);
|
||||
void deinit();
|
||||
void beginDraw();
|
||||
void endDraw();
|
||||
};
|
||||
|
||||
class Canvas {
|
||||
ShowoffCanvasContext* mContext;
|
||||
public:
|
||||
Canvas();
|
||||
~Canvas();
|
||||
|
||||
void init();
|
||||
void deinit();
|
||||
void beginDraw();
|
||||
void endDraw();
|
||||
};
|
||||
|
||||
public:
|
||||
Showoff() = default;
|
||||
void init(Window* window);
|
||||
void deinit();
|
||||
void draw();
|
||||
|
||||
private:
|
||||
GUI gui;
|
||||
GL gl;
|
||||
Canvas canvas;
|
||||
};
|
||||
|
||||
class Window {
|
||||
Window(int width, int height, const char* title);
|
||||
~Window();
|
||||
|
||||
public:
|
||||
static Window* createWindow(int width, int height, const char* title);
|
||||
static void destroyWindow(Window* window);
|
||||
|
||||
public:
|
||||
void renderLoop();
|
||||
WindowContext* getContext();
|
||||
private:
|
||||
WindowContext* mContext;
|
||||
Showoff showoff;
|
||||
};
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
//
|
||||
// Created by ilusha on 22.07.23.
|
||||
//
|
||||
|
||||
#ifndef TYPES_WINDOW_HPP
|
||||
#define TYPES_WINDOW_HPP
|
||||
|
||||
#endif//TYPES_WINDOW_HPP
|
||||
Loading…
Add table
Add a link
Reference in a new issue