Working, minimal example.
This commit is contained in:
parent
01697f9df4
commit
bfc12b4a72
7 changed files with 123 additions and 7 deletions
|
@ -1,15 +1,31 @@
|
|||
#ifndef BILLYSHEET_GUI_HPP
|
||||
#define BILLYSHEET_GUI_HPP
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
namespace gui {
|
||||
|
||||
class GuiData;
|
||||
|
||||
class Gui final {
|
||||
private:
|
||||
GuiData &data;
|
||||
|
||||
fs::path font;
|
||||
|
||||
bool initialized{ false };
|
||||
public:
|
||||
Gui() = delete;
|
||||
|
||||
explicit Gui(GuiData &data);
|
||||
|
||||
~Gui() noexcept;
|
||||
|
||||
void render_gui();
|
||||
|
||||
void render_gpu() const;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
#ifndef BILLYSHEET_GUI_DATA_HPP
|
||||
#define BILLYSHEET_GUI_DATA_HPP
|
||||
|
||||
#include "window.hpp"
|
||||
|
||||
namespace gui {
|
||||
class Window;
|
||||
|
||||
class GuiData final {
|
||||
private:
|
||||
Window &window;
|
||||
|
@ -13,6 +14,8 @@ namespace gui {
|
|||
|
||||
explicit GuiData(Window &wwindow) : window(wwindow) {}
|
||||
|
||||
[[nodiscard]] Window &get_window() const;
|
||||
|
||||
~GuiData() noexcept = default;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#define BILLYSHEET_WINDOW_HPP
|
||||
|
||||
#include <memory>
|
||||
#include "imgui_impl_opengl3_loader.h"
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
namespace gui {
|
||||
|
@ -18,6 +19,12 @@ namespace gui {
|
|||
Window();
|
||||
|
||||
~Window() noexcept = default;
|
||||
|
||||
[[nodiscard]] const std::unique_ptr<GLFWwindow, decltype(&delete_glfw_window)> &get_window() const { return wwindow; }
|
||||
|
||||
[[nodiscard]] bool should_close() const noexcept;
|
||||
|
||||
void swap_buffers() const noexcept;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue