diff --git a/modules/GUImodules/TestClay/src/TestClay.cpp b/modules/GUImodules/TestClay/src/TestClay.cpp index e69de29..33a2bc3 100644 --- a/modules/GUImodules/TestClay/src/TestClay.cpp +++ b/modules/GUImodules/TestClay/src/TestClay.cpp @@ -0,0 +1,35 @@ +#include "TestClay.h" + +#define CLAY_IMPLIMENTATION +#include "clay.h" + +#include + +TestClay::TestClay(void* h, Archimedes::App& a) : Archimedes::GuiModule(h, a) { + + name = "TestClay"; +} + +TestClay::~TestClay() { +} + +void TestClay::onLoad() { + + createWindow(); + + window->getRenderer().init(); + + +} + +void TestClay::run() { + + window->getRenderer().addRenderCmd([](){ + + }); + + if(window->shouldClose()) + app.end(); + window->doFrame(); + +} diff --git a/modules/GUImodules/TestClay/src/TestClay.h b/modules/GUImodules/TestClay/src/TestClay.h index e69de29..d2398f7 100644 --- a/modules/GUImodules/TestClay/src/TestClay.h +++ b/modules/GUImodules/TestClay/src/TestClay.h @@ -0,0 +1,25 @@ +#include "Archimedes.h" + + +class TestClay : public Archimedes::GuiModule { + + public: + TestClay(void*, Archimedes::App&); + + ~TestClay(); + + void onLoad(); + + void run(); + + private: +}; + + +extern "C" { + Archimedes::Module* create(void* handle, Archimedes::App& app) { + return new TestClay(handle, app); + } +} + + diff --git a/modules/GUImodules/TestImgui/src/TestImgui.cpp b/modules/GUImodules/TestImgui/src/TestImgui.cpp index 5ac500c..099b316 100644 --- a/modules/GUImodules/TestImgui/src/TestImgui.cpp +++ b/modules/GUImodules/TestImgui/src/TestImgui.cpp @@ -29,6 +29,9 @@ void TestImgui::onLoad() { io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls + io.ConfigFlags |= ImGuiConfigFlags_DockingEnable; // Enable Docking + //io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; // Enable Multi-Viewport / Platform Windows + // Setup Dear ImGui style ImGui::StyleColorsDark(); //ImGui::StyleColorsLight(); @@ -50,6 +53,12 @@ void TestImgui::run() { window->getRenderer().addRenderCmd([](){ ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData()); + + if (ImGui::GetIO().ConfigFlags & ImGuiConfigFlags_ViewportsEnable) + { + ImGui::UpdatePlatformWindows(); + ImGui::RenderPlatformWindowsDefault(); + } }); if(window->shouldClose()) diff --git a/utils/Window/WindowGLFW/WindowGLFW.h b/utils/Window/WindowGLFW/WindowGLFW.h index 4c142d9..397eb8c 100644 --- a/utils/Window/WindowGLFW/WindowGLFW.h +++ b/utils/Window/WindowGLFW/WindowGLFW.h @@ -14,10 +14,12 @@ namespace Archimedes { bool shouldClose(); - void doFrame() { glfwSwapBuffers(w); } + void doFrame() { restoreContext(); glfwSwapBuffers(w); } void pollEvents() { glfwPollEvents(); } + void restoreContext() { glfwMakeContextCurrent(w); } + void getSize(int&, int&); GLFWwindow* getWindow() { return w; }