Basic UI quad, yay

This commit is contained in:
Dynamitos
2021-09-23 10:10:39 +02:00
parent df977110d3
commit 632d120f6d
51 changed files with 579 additions and 187 deletions
+34 -2
View File
@@ -1,9 +1,16 @@
#include "InspectorView.h"
#include "Window.h"
using namespace Seele;
InspectorView::InspectorView(Gfx::PGraphics graphics, PWindow window, const ViewportCreateInfo &createInfo)
: View(graphics, window, createInfo)
{
renderGraph = new RenderGraph();
Gfx::PRenderTargetAttachment attachment = new Gfx::SwapchainAttachment(window->getGfxHandle());
uiPass = new UIPass(renderGraph, graphics, viewport, attachment);
renderGraph->addRenderPass(uiPass);
renderGraph->setup();
}
InspectorView::~InspectorView()
@@ -12,15 +19,40 @@ InspectorView::~InspectorView()
void InspectorView::beginFrame()
{
uiPass->beginFrame();
}
void InspectorView::render()
{
uiPass->render();
}
void InspectorView::endFrame()
{
uiPass->endFrame();
}
void InspectorView::keyCallback(KeyCode code, InputAction action, KeyModifier modifier)
{
}
void InspectorView::mouseMoveCallback(double xPos, double yPos)
{
}
void InspectorView::mouseButtonCallback(MouseButton button, InputAction action, KeyModifier modifier)
{
}
void InspectorView::scrollCallback(double xOffset, double yOffset)
{
}
void InspectorView::fileCallback(int count, const char** paths)
{
}
+17 -3
View File
@@ -1,9 +1,11 @@
#pragma once
#include "View.h"
#include "UI/UIRenderPath.h"
#include "Graphics/RenderPass/RenderGraph.h"
#include "Graphics/RenderPass/UIPass.h"
namespace Seele
{
DECLARE_REF(Actor)
class InspectorView : public View
{
public:
@@ -12,7 +14,19 @@ public:
virtual void beginFrame();
virtual void render();
virtual void endFrame();
private:
void selectActor();
protected:
Array<UI::PElement> rootElements;
PUIPass uiPass;
PActor selectedActor;
PRenderGraph renderGraph;
virtual void keyCallback(KeyCode code, InputAction action, KeyModifier modifier) override;
virtual void mouseMoveCallback(double xPos, double yPos) override;
virtual void mouseButtonCallback(MouseButton button, InputAction action, KeyModifier modifier) override;
virtual void scrollCallback(double xOffset, double yOffset) override;
virtual void fileCallback(int count, const char** paths) override;
};
DEFINE_REF(InspectorView)
} // namespace Seele
-1
View File
@@ -25,6 +25,5 @@ protected:
PDepthPrepass depthPrepass;
PLightCullingPass lightCullingPass;
PBasePass basePass;
};
} // namespace Seele
+1 -1
View File
@@ -3,7 +3,7 @@
namespace Seele
{
DECLARE_REF(Window)
// A view is a part of the window, which can be anything from a viewport to an editor
// A view is a part of the window, which can be anything from a viewport to an inspector
class View
{
public: