Started editor windows refactor
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
#include "DebugCmd.h"
|
||||
|
||||
|
||||
using namespace Nuake;
|
||||
|
||||
DebugCmd::DebugCmd(Cmd& inCmd) :
|
||||
cmd(inCmd)
|
||||
{
|
||||
}
|
||||
|
||||
void DebugCmd::DrawLine(const Vector3& start, const Vector3& end, const Color& color) const
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void DebugCmd::DrawSphere(const Vector2& position, float radius, const Color& color) const
|
||||
{
|
||||
}
|
||||
|
||||
void DebugCmd::DrawCube(const Vector3& position, const Vector3& size, const Color& color) const
|
||||
{
|
||||
}
|
||||
|
||||
void DebugCmd::DrawAABB(const Vector3& min, const Vector3& max, const Color& color) const
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
#include "Cmd.h"
|
||||
|
||||
namespace Nuake
|
||||
{
|
||||
// This is the API to render anything debugging related
|
||||
// Like lines, shapes, gizmos, etc.
|
||||
class DebugCmd
|
||||
{
|
||||
private:
|
||||
Cmd& cmd;
|
||||
|
||||
public:
|
||||
DebugCmd(Cmd& inCmd);
|
||||
~DebugCmd() = default;
|
||||
|
||||
public:
|
||||
void DrawLine(const Vector3& start, const Vector3& end, const Color& color) const;
|
||||
void DrawSphere(const Vector2& position, float radius, const Color& color) const;
|
||||
void DrawCube(const Vector3& position, const Vector3& size, const Color& color) const;
|
||||
void DrawAABB(const Vector3& min, const Vector3& max, const Color& color) const;
|
||||
};
|
||||
}
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "src/Scene/Components/ModelComponent.h"
|
||||
|
||||
#include <Tracy.hpp>
|
||||
#include "DebugCmd.h"
|
||||
|
||||
using namespace Nuake;
|
||||
|
||||
@@ -280,8 +281,8 @@ void SceneRenderPipeline::Render(PassRenderContext& ctx)
|
||||
GBufferPipeline.Execute(ctx, pipelineInputs);
|
||||
|
||||
// Debug drawing
|
||||
// Get delegate
|
||||
OnDebugDraw().Broadcast();
|
||||
DebugCmd debugCmd = DebugCmd(ctx.commandBuffer);
|
||||
OnDebugDraw().Broadcast(debugCmd);
|
||||
}
|
||||
|
||||
Ref<VulkanImage> SceneRenderPipeline::ResizeImage(Ref<VulkanImage> image, const Vector2& size)
|
||||
|
||||
@@ -62,6 +62,8 @@ namespace Nuake
|
||||
int BlurDirection;
|
||||
};
|
||||
|
||||
class DebugCmd;
|
||||
|
||||
// This class handles all the rendering of the scene
|
||||
class SceneRenderPipeline
|
||||
{
|
||||
@@ -98,7 +100,7 @@ namespace Nuake
|
||||
static RenderPipeline GBufferPipeline;
|
||||
|
||||
// Delegates
|
||||
MulticastDelegate<> DebugDrawDelegate;
|
||||
MulticastDelegate<DebugCmd&> DebugDrawDelegate;
|
||||
|
||||
public:
|
||||
SceneRenderPipeline();
|
||||
@@ -108,7 +110,7 @@ namespace Nuake
|
||||
void Render(PassRenderContext& ctx);
|
||||
Ref<VulkanImage> GetOutput() { return TonemappedOutput; }
|
||||
|
||||
MulticastDelegate<>& OnDebugDraw() { return DebugDrawDelegate; }
|
||||
MulticastDelegate<DebugCmd&>& OnDebugDraw() { return DebugDrawDelegate; }
|
||||
|
||||
private:
|
||||
Ref<VulkanImage> ResizeImage(Ref<VulkanImage> image, const Vector2& size);
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
#include "imgui/imgui.h"
|
||||
#include "imgui/imgui_internal.h"
|
||||
#include "../../../Editor/src/Misc/InterfaceFonts.h"
|
||||
|
||||
#include "imgui/imgui_stdlib.h"
|
||||
#include "src/Resource/FontAwesome5.h"
|
||||
#include "src/Rendering/Textures/Texture.h"
|
||||
#include <src/Rendering/Vulkan/VulkanImage/VulkanImage.h>
|
||||
|
||||
Reference in New Issue
Block a user