forked from gorbatschow/ImApp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImAppMainWindow.h
More file actions
36 lines (29 loc) · 746 Bytes
/
ImAppMainWindow.h
File metadata and controls
36 lines (29 loc) · 746 Bytes
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
34
35
36
#pragma once
#include <imgui.h>
#include <string>
class GLFWwindow;
namespace ImApp {
class MainWindow {
public:
MainWindow(const std::string &title = "Main Window");
virtual ~MainWindow();
int run();
protected:
virtual void beforeLoop() {}
virtual void firstPaint() {}
virtual void paint();
virtual void beforeQuit() {}
inline ImGuiID dockSpaceID() const { return _dockSpaceId; }
private:
std::string _windowTitle{};
GLFWwindow *_glfwWindow{nullptr};
int _displayW{}, _displayH{};
ImVec4 _clearColor{0.45f, 0.55f, 0.60f, 1.00f};
ImGuiID _dockSpaceId{};
void init();
void frame();
void render();
void quit();
static void onGlfwError(int error, const char *description) noexcept;
};
} // namespace ImApp