45 lines
858 B
C++
45 lines
858 B
C++
|
#include "ltpch.h"
|
||
|
#include "glUserInterface.h"
|
||
|
|
||
|
#include <imgui.h>
|
||
|
#include <imgui_impl_glfw.h>
|
||
|
#include <imgui_impl_opengl3.h>
|
||
|
|
||
|
namespace Light {
|
||
|
|
||
|
glUserInterface::glUserInterface(GLFWwindow* windowHandle)
|
||
|
{
|
||
|
IMGUI_CHECKVERSION();
|
||
|
ImGui::CreateContext();
|
||
|
ImGuiIO& io = ImGui::GetIO();
|
||
|
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
|
||
|
|
||
|
ImGui::StyleColorsDark();
|
||
|
|
||
|
ImGui_ImplGlfw_InitForOpenGL(windowHandle, true);
|
||
|
ImGui_ImplOpenGL3_Init();
|
||
|
}
|
||
|
|
||
|
glUserInterface::~glUserInterface()
|
||
|
{
|
||
|
ImGui_ImplOpenGL3_Shutdown();
|
||
|
ImGui_ImplGlfw_Shutdown();
|
||
|
ImGui::DestroyContext();
|
||
|
}
|
||
|
|
||
|
void glUserInterface::Begin()
|
||
|
{
|
||
|
ImGui_ImplOpenGL3_NewFrame();
|
||
|
ImGui_ImplGlfw_NewFrame();
|
||
|
ImGui::NewFrame();
|
||
|
|
||
|
ImGui::ShowDemoWindow();
|
||
|
}
|
||
|
|
||
|
void glUserInterface::End()
|
||
|
{
|
||
|
ImGui::Render();
|
||
|
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
|
||
|
}
|
||
|
|
||
|
}
|