-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathGUI.h
More file actions
77 lines (63 loc) · 1.33 KB
/
GUI.h
File metadata and controls
77 lines (63 loc) · 1.33 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#pragma once
#include "ImGui/imgui.h"
#include "ImGui/imgui_impl_glfw.h"
#include "ImGui/imgui_impl_opengl3.h"
#include <glad/glad.h>
#include <stdio.h>
#include <GLFW/glfw3.h>
#include <windows.h>
#include <iostream>
#include "GUI/Inspector.h"
#include "GUI/NodeEditor.h"
#include "Rendering/Renderer.h"
#define HI(v) ImVec4(0.502f, 0.075f, 0.256f, v)
#define MED(v) ImVec4(0.455f, 0.198f, 0.301f, v)
#define LOW(v) ImVec4(0.232f, 0.201f, 0.271f, v)
#define BG(v) ImVec4(0.05f, 0.07f, 0.120f, v)
#define TEXT(v) ImVec4(0.860f, 0.930f, 0.890f, v)
class GUI
{
private:
static GUI* s_gui;
GLFWwindow* m_window;
GLFWwindow* setupImguiGlfw();
void setupStyle();
Renderer* m_renderer;
Inspector* m_inspector;
NodeEditor* m_nodeEditor;
ImVec2 m_renderSceneSize;
ImFont* defaultFont;
ImFont* robotoMediumFont;
ImFont* robotoRegularFont;
public:
GUI();
~GUI();
void initialize();
static GUI* getSingleton() {
if (!s_gui)
{
s_gui = new GUI();
}
return s_gui;
}
void pushMediumFont()
{
ImGui::PushFont(robotoMediumFont);
}
void pushDefaultFont()
{
ImGui::PushFont(defaultFont);
}
GLFWwindow* getWindow()
{
return m_window;
}
ImVec2 getRenderSize()
{
return m_renderSceneSize;
}
// set up the frame - sets up the GUI. doesn't render it.
void setupFrame();
// renders the GUI.
void renderFrame();
};