Using PerformanceOverlayUiElement in example apps
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include "Scene/Material.hpp"
|
||||
#include "Scene/Vertex.hpp"
|
||||
#include "Scene/SimpleDrawable.hpp"
|
||||
#include "Scene/UI/PerformanceOverlayUiElement.hpp"
|
||||
#include "Input/InputManager.hpp"
|
||||
#include "Host/GraphicsAppManager.hpp"
|
||||
#include "Math/Math.hpp"
|
||||
@@ -40,6 +41,7 @@ namespace OpenVulkano
|
||||
std::vector<SimpleDrawable> drawablesPool;
|
||||
std::vector<Node> nodesPool;
|
||||
Vector3f_SIMD position = {0, 0, -10};
|
||||
OpenVulkano::Scene::UI::PerformanceOverlayUiElement m_ui;
|
||||
|
||||
public:
|
||||
void Init() override
|
||||
@@ -78,6 +80,8 @@ namespace OpenVulkano
|
||||
|
||||
camController.Init(&cam);
|
||||
camController.SetDefaultKeybindings();
|
||||
|
||||
GetGraphicsAppManager()->GetRenderer()->SetActiveUi(&m_ui);
|
||||
}
|
||||
|
||||
void Tick() override
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "Scene/Camera.hpp"
|
||||
#include "Scene/SimpleAnimationController.hpp"
|
||||
#include "Scene/SequenceAnimationController.hpp"
|
||||
#include "Scene/UI/PerformanceOverlayUiElement.hpp"
|
||||
#include "Input/InputManager.hpp"
|
||||
#include "Host/GraphicsAppManager.hpp"
|
||||
#include "Base/EngineConfiguration.hpp"
|
||||
@@ -46,6 +47,8 @@ namespace OpenVulkano
|
||||
SceneElement m_whiteBox;
|
||||
SceneElement m_redBox;
|
||||
|
||||
Scene::UI::PerformanceOverlayUiElement m_ui;
|
||||
|
||||
void CreateSceneElement(SceneElement *dest, const Math::Vector4f &color, float scale)
|
||||
{
|
||||
dest->m_geometry.InitCube(scale, scale, scale, color);
|
||||
@@ -95,6 +98,8 @@ namespace OpenVulkano
|
||||
m_sequenceAnimationController.AddAnimationStep(Math::PoseF(Math::Utils::normalize(Math::QuaternionF(3, 2, 1, 1)), Math::Vector3f_SIMD(1, 1, -1)), 3);
|
||||
m_sequenceAnimationController.AddAnimationStep(Math::PoseF(Math::Utils::normalize(Math::QuaternionF(0, 0, 1, 1)), Math::Vector3f_SIMD(0, 1, 0)), 1);
|
||||
m_sequenceAnimationController.SetAnimationPoseResetTime(10);
|
||||
|
||||
GetGraphicsAppManager()->GetRenderer()->SetActiveUi(&m_ui);
|
||||
}
|
||||
|
||||
void OnSimpleAnimationCompleted(Scene::SimpleAnimationController *anim)
|
||||
|
||||
Reference in New Issue
Block a user