-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathImgui_layer.h
57 lines (44 loc) · 937 Bytes
/
Imgui_layer.h
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
#pragma once
#include "imgui.h"
#include "imgui_impl_glfw.h"
#include "imgui_impl_opengl3.h"
#include "Shader.h"
class Imgui_layer
{
public:
float merge = 0.0f;
void Init(GLFWwindow* window)
{
IMGUI_CHECKVERSION();
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO();
ImGui_ImplGlfw_InitForOpenGL(window, true);
ImGui_ImplOpenGL3_Init("#version 460");
ImGui::StyleColorsDark();
}
void NewFrame()
{
ImGui_ImplOpenGL3_NewFrame();
ImGui_ImplGlfw_NewFrame();
ImGui::NewFrame();
}
void Update(float time)
{
ImGui::Begin("ImGUI window");
ImGui::Text("it's working here");
//shader.setFloat("model", merg);
ImGui::SliderFloat("FPS:", &time, 150.0f, 300.0f);
ImGui::End();
}
void Render()
{
ImGui::Render();
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
}
void ShutDown()
{
ImGui_ImplOpenGL3_Shutdown();
ImGui_ImplGlfw_Shutdown();
ImGui::DestroyContext();
}
};