48 lines
878 B
C++
48 lines
878 B
C++
#pragma once
|
|
|
|
#include <array>
|
|
// #include <memory>
|
|
#include <variant>
|
|
|
|
#include "graphic_context.hpp"
|
|
#include "window.hpp"
|
|
|
|
namespace uui
|
|
{
|
|
class GlComponent
|
|
{
|
|
friend class GlWindow;
|
|
|
|
public:
|
|
GlComponent(const GlComponent&) = delete;
|
|
GlComponent(GlComponent&&) = delete;
|
|
~GlComponent();
|
|
|
|
void render();
|
|
|
|
private:
|
|
// std::weak_ptr<GlWindow> window;
|
|
GlWindow* window;
|
|
|
|
std::variant<int, float> position_x;
|
|
std::variant<int, float> position_y;
|
|
std::variant<int, float> size_width;
|
|
std::variant<int, float> size_height;
|
|
|
|
std::array<float, 4> background_color;
|
|
|
|
bool initialized;
|
|
|
|
GLuint gl_vbo;
|
|
GLuint gl_vao;
|
|
GLuint gl_ebo;
|
|
|
|
GlComponent(
|
|
GlWindow* window, const std::variant<int, float> x, const std::variant<int, float> y,
|
|
const std::variant<int, float> width, const std::variant<int, float> height);
|
|
|
|
void init();
|
|
void deinit();
|
|
};
|
|
|
|
} // namespace uui
|