2021-01-19 15:30:00 +01:00
|
|
|
#include "InspectorView.h"
|
2021-11-14 20:36:53 +01:00
|
|
|
#include "Graphics/Graphics.h"
|
|
|
|
|
#include "Scene/Actor/Actor.h"
|
2021-09-23 10:10:39 +02:00
|
|
|
#include "Window.h"
|
2022-04-15 11:19:30 +02:00
|
|
|
#include "Asset/AssetRegistry.h"
|
2021-09-23 10:10:39 +02:00
|
|
|
|
2021-01-19 15:30:00 +01:00
|
|
|
using namespace Seele;
|
|
|
|
|
|
|
|
|
|
InspectorView::InspectorView(Gfx::PGraphics graphics, PWindow window, const ViewportCreateInfo &createInfo)
|
2021-11-13 19:28:18 +01:00
|
|
|
: View(graphics, window, createInfo, "InspectorView")
|
2021-10-15 23:12:29 +02:00
|
|
|
, uiPass(UIPass(graphics, viewport, new Gfx::SwapchainAttachment(window->getGfxHandle())))
|
2022-04-15 11:19:30 +02:00
|
|
|
, textPass(TextPass(graphics, viewport, new Gfx::SwapchainAttachment(window->getGfxHandle())))
|
2021-01-19 15:30:00 +01:00
|
|
|
{
|
2022-04-15 11:19:30 +02:00
|
|
|
AssetRegistry::importFile("./fonts/Calibri.ttf");
|
2021-12-02 13:00:03 +01:00
|
|
|
PRenderGraphResources resources = new RenderGraphResources();
|
|
|
|
|
uiPass.setResources(resources);
|
2022-04-15 11:19:30 +02:00
|
|
|
textPass.setResources(resources);
|
2021-12-02 13:00:03 +01:00
|
|
|
uiPass.publishOutputs();
|
2022-04-15 11:19:30 +02:00
|
|
|
textPass.publishOutputs();
|
2021-12-02 13:00:03 +01:00
|
|
|
uiPass.createRenderPass();
|
2022-04-15 11:19:30 +02:00
|
|
|
textPass.createRenderPass();
|
|
|
|
|
TextRender& render = textPassData.texts.add();
|
|
|
|
|
render.font = AssetRegistry::findFont("Calibri");
|
|
|
|
|
render.text = "Seele Engine";
|
|
|
|
|
render.position = Vector2(0.5f, 0.5f);
|
|
|
|
|
render.scale = 1.0f;
|
|
|
|
|
render.textColor = Vector4(1, 1, 1, 1);
|
2021-01-19 15:30:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
InspectorView::~InspectorView()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-12 14:40:26 +01:00
|
|
|
Job InspectorView::beginUpdate()
|
2021-01-19 15:30:00 +01:00
|
|
|
{
|
2022-01-12 14:40:26 +01:00
|
|
|
co_return;
|
2021-01-19 15:30:00 +01:00
|
|
|
}
|
|
|
|
|
|
2022-01-12 14:40:26 +01:00
|
|
|
Job InspectorView::update()
|
2021-01-19 15:30:00 +01:00
|
|
|
{
|
2022-01-12 14:40:26 +01:00
|
|
|
co_return;
|
2021-01-19 15:30:00 +01:00
|
|
|
}
|
|
|
|
|
|
2021-10-15 23:12:29 +02:00
|
|
|
void InspectorView::commitUpdate()
|
2021-09-23 10:10:39 +02:00
|
|
|
{
|
2021-10-01 19:55:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void InspectorView::prepareRender()
|
|
|
|
|
{
|
2022-04-15 11:19:30 +02:00
|
|
|
textPass.updateViewFrame(textPassData);
|
2021-10-01 19:55:04 +02:00
|
|
|
}
|
|
|
|
|
|
2021-12-02 13:00:03 +01:00
|
|
|
MainJob InspectorView::render()
|
2021-10-01 19:55:04 +02:00
|
|
|
{
|
2022-02-24 22:38:26 +01:00
|
|
|
return uiPass.beginFrame()
|
2022-04-15 11:19:30 +02:00
|
|
|
.then(textPass.beginFrame())
|
2022-02-24 22:38:26 +01:00
|
|
|
.then(uiPass.render())
|
2022-04-15 11:19:30 +02:00
|
|
|
.then(textPass.render())
|
|
|
|
|
.then(uiPass.endFrame())
|
|
|
|
|
.then(textPass.endFrame());
|
2021-09-23 10:10:39 +02:00
|
|
|
}
|
|
|
|
|
|
2021-11-24 12:10:23 +01:00
|
|
|
void InspectorView::keyCallback(KeyCode, InputAction, KeyModifier)
|
2021-09-23 10:10:39 +02:00
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-24 12:10:23 +01:00
|
|
|
void InspectorView::mouseMoveCallback(double, double)
|
2021-09-23 10:10:39 +02:00
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-24 12:10:23 +01:00
|
|
|
void InspectorView::mouseButtonCallback(MouseButton, InputAction, KeyModifier)
|
2021-09-23 10:10:39 +02:00
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-24 12:10:23 +01:00
|
|
|
void InspectorView::scrollCallback(double, double)
|
2021-09-23 10:10:39 +02:00
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-24 12:10:23 +01:00
|
|
|
void InspectorView::fileCallback(int, const char**)
|
2021-01-19 15:30:00 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|