use imgui docking
This commit is contained in:
parent
6ff27718e4
commit
15c49f6626
19 changed files with 390 additions and 298 deletions
|
@ -1,5 +1,6 @@
|
|||
#include <quark.hpp>
|
||||
#include "quark/imgui/ImGuiLayer.hpp"
|
||||
#include <glm/vec3.hpp>
|
||||
#include "imgui.h"
|
||||
|
||||
class ExampleLayer :
|
||||
public qk::Layer
|
||||
|
@ -7,10 +8,25 @@ class ExampleLayer :
|
|||
public:
|
||||
ExampleLayer() :
|
||||
Layer("Example")
|
||||
{ }
|
||||
{
|
||||
glm::vec3 test = { 0.0f, 1.0f, 0.75f };
|
||||
}
|
||||
|
||||
void OnUpdate() override {
|
||||
// QK_TRACE("ExampleLayer::Update");
|
||||
|
||||
if (qk::Input::IsKeyDown(QK_KEY_TAB)) {
|
||||
QK_TRACE("Tab pressed");
|
||||
}
|
||||
}
|
||||
|
||||
void OnImGuiRender() override {
|
||||
static bool open = true;
|
||||
|
||||
if (ImGui::Begin("Example window", &open)) {
|
||||
ImGui::Text("Example text");
|
||||
ImGui::End();
|
||||
}
|
||||
}
|
||||
|
||||
void OnEvent(qk::Event& event) override {
|
||||
|
@ -24,7 +40,6 @@ class Sandbox :
|
|||
public:
|
||||
Sandbox() {
|
||||
PushLayer(new ExampleLayer);
|
||||
PushOverlay(new qk::ImGuiLayer);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue