Basic crashing text rendering
This commit is contained in:
@@ -2,17 +2,29 @@
|
||||
#include "Graphics/Graphics.h"
|
||||
#include "Scene/Actor/Actor.h"
|
||||
#include "Window.h"
|
||||
#include "Asset/AssetRegistry.h"
|
||||
|
||||
using namespace Seele;
|
||||
|
||||
InspectorView::InspectorView(Gfx::PGraphics graphics, PWindow window, const ViewportCreateInfo &createInfo)
|
||||
: View(graphics, window, createInfo, "InspectorView")
|
||||
, uiPass(UIPass(graphics, viewport, new Gfx::SwapchainAttachment(window->getGfxHandle())))
|
||||
, textPass(TextPass(graphics, viewport, new Gfx::SwapchainAttachment(window->getGfxHandle())))
|
||||
{
|
||||
AssetRegistry::importFile("./fonts/Calibri.ttf");
|
||||
PRenderGraphResources resources = new RenderGraphResources();
|
||||
uiPass.setResources(resources);
|
||||
textPass.setResources(resources);
|
||||
uiPass.publishOutputs();
|
||||
textPass.publishOutputs();
|
||||
uiPass.createRenderPass();
|
||||
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);
|
||||
}
|
||||
|
||||
InspectorView::~InspectorView()
|
||||
@@ -31,19 +43,21 @@ Job InspectorView::update()
|
||||
|
||||
void InspectorView::commitUpdate()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void InspectorView::prepareRender()
|
||||
{
|
||||
|
||||
textPass.updateViewFrame(textPassData);
|
||||
}
|
||||
|
||||
MainJob InspectorView::render()
|
||||
{
|
||||
return uiPass.beginFrame()
|
||||
.then(textPass.beginFrame())
|
||||
.then(uiPass.render())
|
||||
.then(uiPass.endFrame());
|
||||
.then(textPass.render())
|
||||
.then(uiPass.endFrame())
|
||||
.then(textPass.endFrame());
|
||||
}
|
||||
|
||||
void InspectorView::keyCallback(KeyCode, InputAction, KeyModifier)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "View.h"
|
||||
#include "Graphics/RenderPass/RenderGraph.h"
|
||||
#include "Graphics/RenderPass/UIPass.h"
|
||||
#include "Graphics/RenderPass/TextPass.h"
|
||||
#include "UI/Elements/Panel.h"
|
||||
|
||||
namespace Seele
|
||||
@@ -22,8 +23,10 @@ public:
|
||||
void selectActor();
|
||||
protected:
|
||||
UIPass uiPass;
|
||||
TextPass textPass;
|
||||
|
||||
UIPassData uiPassData;
|
||||
TextPassData textPassData;
|
||||
|
||||
UI::PPanel rootPanel;
|
||||
PActor selectedActor;
|
||||
|
||||
@@ -20,7 +20,6 @@ Seele::SceneView::SceneView(Gfx::PGraphics graphics, PWindow owner, const Viewpo
|
||||
{
|
||||
scene = new Scene(graphics);
|
||||
scene->addActor(activeCamera);
|
||||
AssetRegistry::importFile("./fonts/GLSNECB.ttf");
|
||||
AssetRegistry::importFile("C:\\Users\\Dynamitos\\TestSeeleProject\\Assets\\Ayaka\\Avatar_Girl_Sword_Ayaka_Tex_Body_Diffuse.png");
|
||||
AssetRegistry::importFile("C:\\Users\\Dynamitos\\TestSeeleProject\\Assets\\Ayaka\\Avatar_Girl_Sword_Ayaka_Tex_Body_Lightmap.png");
|
||||
AssetRegistry::importFile("C:\\Users\\Dynamitos\\TestSeeleProject\\Assets\\Ayaka\\Avatar_Girl_Sword_Ayaka_Tex_Face_Diffuse.png");
|
||||
|
||||
Reference in New Issue
Block a user