39 lines
769 B
C++
39 lines
769 B
C++
#include "Graphics/GUI/GUIManager.h"
|
|
#include "imgui.h"
|
|
#include "backends/imgui_impl_opengl3.h"
|
|
#include <backends/imgui_impl_glfw.cpp>
|
|
|
|
GUIManager::GUIManager(BarinkWindow* window)
|
|
: currentwindow(window)
|
|
{
|
|
IMGUI_CHECKVERSION();
|
|
ImGui::CreateContext();
|
|
ImGuiIO& io = ImGui::GetIO();
|
|
(void)io;
|
|
|
|
ImGui::StyleColorsDark();
|
|
ImGui_ImplGlfw_InitForOpenGL(currentwindow->windowptr(), true);
|
|
ImGui_ImplOpenGL3_Init("#version 440");
|
|
|
|
|
|
ImGui_ImplGlfw_NewFrame();
|
|
ImGui_ImplOpenGL3_NewFrame();
|
|
|
|
}
|
|
|
|
GUIManager::~GUIManager()
|
|
{
|
|
ImGui_ImplOpenGL3_Shutdown();
|
|
ImGui_ImplGlfw_Shutdown();
|
|
ImGui::DestroyContext();
|
|
}
|
|
|
|
|
|
void GUIManager::Render()
|
|
{
|
|
|
|
|
|
ImGui::Render();
|
|
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
|
|
}
|