Base Editor (WIP, no vulkan)
This commit is contained in:
parent
cf3f74e47d
commit
6f67c1acc7
|
@ -60,6 +60,7 @@ namespace Sandbox
|
|||
SHADE::SHScriptEngine::Exit();
|
||||
|
||||
SDL_DestroyWindow(sdlWindow);
|
||||
SDL_Quit();
|
||||
#ifdef SHEDITOR
|
||||
#else
|
||||
#endif
|
||||
|
|
|
@ -0,0 +1,67 @@
|
|||
#include "SHpch.h"
|
||||
#include "SHEditor.h"
|
||||
|
||||
#include <imgui.h>
|
||||
|
||||
//IMGUI Backend includes
|
||||
#include <backends/imgui_impl_sdl.h>
|
||||
#include <backends/imgui_impl_vulkan.h>
|
||||
|
||||
#include "ECS_Base/System/SHSystemManager.h"
|
||||
#include "Graphics/Instance/SHVkInstance.h"
|
||||
#include "Graphics/MiddleEnd/Interface/SHGraphicsSystem.h"
|
||||
|
||||
namespace SHADE
|
||||
{
|
||||
void SHEditor::Initialise(SDL_Window* sdlWindow)
|
||||
{
|
||||
IMGUI_CHECKVERSION();
|
||||
ImGui::CreateContext();
|
||||
|
||||
ImGui_ImplSDL2_InitForVulkan(sdlWindow);
|
||||
|
||||
auto* gfxSystem = reinterpret_cast<SHGraphicsSystem*>(SHSystemManager::GetSystem("Graphics System"));
|
||||
|
||||
ImGui_ImplVulkan_InitInfo initInfo{};
|
||||
initInfo.Instance = SHVkInstance::GetVkInstance();
|
||||
initInfo.PhysicalDevice =
|
||||
|
||||
ImGui_ImplVulkan_DestroyFontUploadObjects();
|
||||
|
||||
}
|
||||
|
||||
void SHEditor::PreRender()
|
||||
{
|
||||
NewFrame();
|
||||
|
||||
ImGui::ShowDemoWindow();
|
||||
}
|
||||
|
||||
void SHEditor::Render()
|
||||
{
|
||||
ImGui::Render();
|
||||
}
|
||||
|
||||
void SHEditor::Exit()
|
||||
{
|
||||
ImGui_ImplVulkan_Shutdown();
|
||||
ImGui_ImplSDL2_Shutdown();
|
||||
ImGui::DestroyContext();
|
||||
}
|
||||
|
||||
|
||||
void SHEditor::InitBackend()
|
||||
{
|
||||
}
|
||||
|
||||
void SHEditor::NewFrame()
|
||||
{
|
||||
ImGui_ImplVulkan_NewFrame();
|
||||
ImGui_ImplSDL2_NewFrame();
|
||||
ImGui::NewFrame();
|
||||
}
|
||||
|
||||
void SHEditor::EndFrame()
|
||||
{
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
#pragma once
|
||||
|
||||
#include <SDL.h>
|
||||
|
||||
namespace SHADE
|
||||
{
|
||||
class SHEditor
|
||||
{
|
||||
public:
|
||||
static void Initialise(SDL_Window* sdlWindow);
|
||||
static void PreRender();
|
||||
static void Render();
|
||||
static void Exit();
|
||||
private:
|
||||
static void InitBackend();
|
||||
static void NewFrame();
|
||||
static void EndFrame();
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue