the gui problem^TM
This commit is contained in:
@@ -1,5 +1,49 @@
|
||||
#include "TestImgui.h"
|
||||
|
||||
void TestImgui::load() {}
|
||||
#include "imgui/imgui.h"
|
||||
#include "imgui/backends/imgui_impl_glfw.h"
|
||||
#include "imgui/backends/imgui_impl_opengl3.h"
|
||||
|
||||
void TestImgui::run() {}
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
TestImgui::TestImgui(void* h, Archimedes::App& a) : Archimedes::GuiModule(h, a) {
|
||||
name = "TestImgui";
|
||||
|
||||
IMGUI_CHECKVERSION();
|
||||
ImGui::CreateContext();
|
||||
ImGuiIO& io = ImGui::GetIO(); (void)io;
|
||||
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
|
||||
io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
|
||||
|
||||
// Setup Dear ImGui style
|
||||
ImGui::StyleColorsDark();
|
||||
//ImGui::StyleColorsLight();
|
||||
|
||||
// Setup Platform/Renderer backends
|
||||
ImGui_ImplGlfw_InitForOpenGL(getWindow()->getWindowImpl().getWindow(), true);
|
||||
ImGui_ImplOpenGL3_Init("#version 130");
|
||||
}
|
||||
|
||||
TestImgui::~TestImgui() {
|
||||
ImGui_ImplOpenGL3_Shutdown();
|
||||
ImGui_ImplGlfw_Shutdown();
|
||||
ImGui::DestroyContext();
|
||||
}
|
||||
|
||||
void TestImgui::onLoad() {}
|
||||
|
||||
void TestImgui::run() {
|
||||
|
||||
ImGui_ImplOpenGL3_NewFrame();
|
||||
ImGui_ImplGlfw_NewFrame();
|
||||
ImGui::NewFrame();
|
||||
|
||||
ImGui::ShowDemoWindow(&this->demo);
|
||||
|
||||
ImGui::Render();
|
||||
|
||||
getWindow()->getRenderer().addRenderCmd([](){
|
||||
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user