From 32dc894608e8ee9f6e5186cf55ac1244650be727 Mon Sep 17 00:00:00 2001 From: Sri Sham Haran Date: Thu, 8 Sep 2022 19:37:49 +0800 Subject: [PATCH] SHEditor Base --- SHADE_Engine/src/Editor/SHEditor.cpp | 62 +++++++++++++++++++++++ SHADE_Engine/src/Editor/SHEditor.h | 25 +++++++++ SHADE_Engine/src/Editor/SHEditorBackend.h | 3 ++ 3 files changed, 90 insertions(+) create mode 100644 SHADE_Engine/src/Editor/SHEditor.cpp create mode 100644 SHADE_Engine/src/Editor/SHEditor.h create mode 100644 SHADE_Engine/src/Editor/SHEditorBackend.h diff --git a/SHADE_Engine/src/Editor/SHEditor.cpp b/SHADE_Engine/src/Editor/SHEditor.cpp new file mode 100644 index 00000000..17b09291 --- /dev/null +++ b/SHADE_Engine/src/Editor/SHEditor.cpp @@ -0,0 +1,62 @@ +#include "SHpch.h" +#include "SHEditor.h" +#include "SHEditorBackend.h" + +namespace SHADE +{ + void SHEditor::Initialize() + { + IMGUI_CHECKVERSION(); + ImGui::CreateContext(); + + SetupWin32Backend(); + SetupVulkanBackend(); + + } + + void SHEditor::Update() + { + NewFrame(); + + //Add all windows to draw list, Perform necessary updates + + ImGui::Render(); + } + + void SHEditor::Render() + { + ImGui_ImplVulkan_RenderDrawData(ImGui::GetDrawData(), ) + } + + void SHEditor::Exit() + { + ShutdownVulkanBackend(); + ShutdownWin32Backend(); + ImGui::DestroyContext(); + } + + void SHEditor::SetupVulkanBackend() + { + ImGui_ImplVulkan_InitInfo initInfo; + + ImGui_ImplVulkan_Init(&initInfo, VK_NULL_HANDLE); + } + + void SHEditor::ShutdownVulkanBackend() + { + ImGui_ImplVulkan_Shutdown(); + } + + void SHEditor::NewFrame() + { + } + + void SHEditor::SetupWin32Backend() + { + //ImGui_ImplWin32_Init(/*hwnd*/); + } + + void SHEditor::ShutdownWin32Backend() + { + } +} diff --git a/SHADE_Engine/src/Editor/SHEditor.h b/SHADE_Engine/src/Editor/SHEditor.h new file mode 100644 index 00000000..a3b03421 --- /dev/null +++ b/SHADE_Engine/src/Editor/SHEditor.h @@ -0,0 +1,25 @@ +#pragma once + +namespace SHADE +{ + class SHEditor + { + public: + + static void Initialize(); + + static void Update(); + + static void Render(); + + static void Exit(); + + private: + static void SetupWin32Backend(); + static void ShutdownWin32Backend(); + static void SetupVulkanBackend(); + static void ShutdownVulkanBackend(); + + static void NewFrame(); + }; +} \ No newline at end of file diff --git a/SHADE_Engine/src/Editor/SHEditorBackend.h b/SHADE_Engine/src/Editor/SHEditorBackend.h new file mode 100644 index 00000000..29a19f86 --- /dev/null +++ b/SHADE_Engine/src/Editor/SHEditorBackend.h @@ -0,0 +1,3 @@ +#pragma once +#include +#include \ No newline at end of file