ImGui
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
#ifndef HYDRADRAWWINDOWTASK
|
||||
#define HYDRADRAWWINDOWTASK
|
||||
#include "../HydraTask.h"
|
||||
#include "../../engine/HydraEngine.h"
|
||||
#include "../../renderer/HydraRenderer.h"
|
||||
#include "../../windowmanager/HydraWindowManager.h"
|
||||
#include "../../gui/HydraGuiWindow.h"
|
||||
#include "../../GlewIncludes.h"
|
||||
#include <GLMIncludes.h>
|
||||
#include <imgui.h>
|
||||
#include <imgui_impl_glfw.h>
|
||||
#include <imgui_impl_opengl3.h>
|
||||
|
||||
class HydraDrawWindowTask : public HydraTask
|
||||
{
|
||||
private:
|
||||
HydraGuiWindow* m_window = nullptr;
|
||||
|
||||
protected:
|
||||
public:
|
||||
void Process() override
|
||||
{
|
||||
m_window->DrawComponents();
|
||||
}
|
||||
void Initialise(HydraGuiWindow* window)
|
||||
{
|
||||
m_window = window;
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* HYDRADRAWWINDOWTASK */
|
||||
@@ -0,0 +1,33 @@
|
||||
#ifndef HYDRAENDGUIFRAMETASK
|
||||
#define HYDRAENDGUIFRAMETASK
|
||||
#include "../HydraTask.h"
|
||||
#include "../../engine/HydraEngine.h"
|
||||
#include "../../renderer/HydraRenderer.h"
|
||||
#include "../../windowmanager/HydraWindowManager.h"
|
||||
#include "../../GlewIncludes.h"
|
||||
#include <GLMIncludes.h>
|
||||
#include <imgui.h>
|
||||
#include <imgui_impl_glfw.h>
|
||||
#include <imgui_impl_opengl3.h>
|
||||
|
||||
class HydraEndGUIFrameTask : public HydraTask
|
||||
{
|
||||
private:
|
||||
|
||||
|
||||
protected:
|
||||
public:
|
||||
void Process() override
|
||||
{
|
||||
ImGui::Render();
|
||||
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
|
||||
ImGui::EndFrame();
|
||||
}
|
||||
void Initialise()
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif /* HYDRAENDGUIFRAMETASK */
|
||||
@@ -0,0 +1,41 @@
|
||||
#ifndef HYDRAINITIALISEGUITASK
|
||||
#define HYDRAINITIALISEGUITASK
|
||||
#include "../HydraTask.h"
|
||||
#include "../../engine/HydraEngine.h"
|
||||
#include "../../renderer/HydraRenderer.h"
|
||||
#include "../../windowmanager/HydraWindowManager.h"
|
||||
#include "../../GlewIncludes.h"
|
||||
#include <GLMIncludes.h>
|
||||
#include <imgui.h>
|
||||
#include <imgui_impl_glfw.h>
|
||||
#include <imgui_impl_opengl3.h>
|
||||
|
||||
class HydraInitialiseGUITask : public HydraTask
|
||||
{
|
||||
private:
|
||||
|
||||
|
||||
protected:
|
||||
public:
|
||||
void Process() override
|
||||
{
|
||||
// Setup Dear ImGui context
|
||||
IMGUI_CHECKVERSION();
|
||||
ImGui::CreateContext();
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
|
||||
io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
|
||||
//io.ConfigFlags |= ImGuiConfigFlags_DockingEnable; // IF using Docking Branch
|
||||
|
||||
// Setup Platform/Renderer backends
|
||||
|
||||
ImGui_ImplGlfw_InitForOpenGL(GetEngine()->WindowManager()->GetWindow(), true); // Second param install_callback=true will install GLFW callbacks and chain to existing ones.
|
||||
ImGui_ImplOpenGL3_Init();
|
||||
}
|
||||
void Initialise()
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* HYDRAINITIALISEGUITASK */
|
||||
@@ -0,0 +1,35 @@
|
||||
#ifndef HYDRASHUTDOWNGUITASK
|
||||
#define HYDRASHUTDOWNGUITASK
|
||||
|
||||
#include "../HydraTask.h"
|
||||
#include "../../engine/HydraEngine.h"
|
||||
#include "../../renderer/HydraRenderer.h"
|
||||
#include "../../windowmanager/HydraWindowManager.h"
|
||||
#include "../../GlewIncludes.h"
|
||||
#include <GLMIncludes.h>
|
||||
#include <imgui.h>
|
||||
#include <imgui_impl_glfw.h>
|
||||
#include <imgui_impl_opengl3.h>
|
||||
|
||||
class HydraShutdownGUITask : public HydraTask
|
||||
{
|
||||
private:
|
||||
|
||||
|
||||
protected:
|
||||
public:
|
||||
void Process() override
|
||||
{
|
||||
// Setup Dear ImGui context
|
||||
ImGui_ImplOpenGL3_Shutdown();
|
||||
ImGui_ImplGlfw_Shutdown();
|
||||
ImGui::DestroyContext();
|
||||
}
|
||||
void Initialise()
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif /* HYDRASHUTDOWNGUITASK */
|
||||
@@ -0,0 +1,34 @@
|
||||
#ifndef HYDRASTARTGUIFRAMETASK
|
||||
#define HYDRASTARTGUIFRAMETASK
|
||||
|
||||
#include "../HydraTask.h"
|
||||
#include "../../engine/HydraEngine.h"
|
||||
#include "../../renderer/HydraRenderer.h"
|
||||
#include "../../windowmanager/HydraWindowManager.h"
|
||||
#include "../../GlewIncludes.h"
|
||||
#include <GLMIncludes.h>
|
||||
#include <imgui.h>
|
||||
#include <imgui_impl_glfw.h>
|
||||
#include <imgui_impl_opengl3.h>
|
||||
|
||||
class HydraStartGUIFrameTask : public HydraTask
|
||||
{
|
||||
private:
|
||||
|
||||
|
||||
protected:
|
||||
public:
|
||||
void Process() override
|
||||
{
|
||||
ImGui_ImplOpenGL3_NewFrame();
|
||||
ImGui_ImplGlfw_NewFrame();
|
||||
ImGui::NewFrame();
|
||||
}
|
||||
void Initialise()
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif /* HYDRASHUTDOWNGUITASK */
|
||||
Reference in New Issue
Block a user