Integrate XCUI shell state and runtime frame seams
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#include <XCEngine/UI/Runtime/UISystem.h>
|
||||
|
||||
#include <utility>
|
||||
|
||||
namespace XCEngine {
|
||||
namespace UI {
|
||||
namespace Runtime {
|
||||
@@ -122,6 +124,10 @@ std::size_t UISystem::GetLayerCount() const {
|
||||
const UISystemFrameResult& UISystem::Update(const UIScreenFrameInput& input) {
|
||||
m_lastFrame = {};
|
||||
m_lastFrame.frameIndex = input.frameIndex;
|
||||
m_lastFrame.viewportRect = input.viewportRect;
|
||||
m_lastFrame.submittedInputEventCount = input.events.size();
|
||||
m_lastFrame.deltaTimeSeconds = input.deltaTimeSeconds;
|
||||
m_lastFrame.focused = input.focused;
|
||||
|
||||
if (m_players.empty()) {
|
||||
return m_lastFrame;
|
||||
@@ -177,6 +183,12 @@ const UISystemFrameResult& UISystem::GetLastFrame() const {
|
||||
return m_lastFrame;
|
||||
}
|
||||
|
||||
UISystemFrameResult UISystem::ConsumeLastFrame() {
|
||||
UISystemFrameResult frame = std::move(m_lastFrame);
|
||||
m_lastFrame = {};
|
||||
return frame;
|
||||
}
|
||||
|
||||
const std::vector<std::unique_ptr<UIScreenPlayer>>& UISystem::GetPlayers() const {
|
||||
return m_players;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user