SHEditor Base

This commit is contained in:
Sri Sham Haran 2022-09-08 19:37:49 +08:00
parent 04384e6b83
commit 32dc894608
3 changed files with 90 additions and 0 deletions

View File

@ -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()
{
}
}

View File

@ -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();
};
}

View File

@ -0,0 +1,3 @@
#pragma once
#include <backends/imgui_impl_win32.h>
#include <backends/imgui_impl_vulkan.h>