SpiecsEngine
 
Loading...
Searching...
No Matches
ViewPortResizeQuerier.cpp
Go to the documentation of this file.
1/**
2* @file ViewPortResizeQuerier.cpp.
3* @brief The ViewPortResizeQuerier & NativeScriptRegister Class Implementation.
4* @author Spices.
5*/
6
7#include "Pchheader.h"
9#include "Systems/SlateSystem.h"
10#include "Slate/Imgui/ViewPort/ImguiViewport.h"
11#include "Core/Event/SlateEvent.h"
12#include "Render/Vulkan/VulkanRenderBackend.h"
13
14namespace Spices {
15
17 {
19
20 /**
21 * @brief The first frame, we will not get register pointer.
22 */
23 if (!SlateSystem::GetRegister()) return;
24
25 if (!m_ViewPort.lock()) m_ViewPort = SlateSystem::GetRegister()->GetViewPort();
26
27 if (m_ViewPort.lock()->IsResizedThisFrame())
28 {
29 /**
30 * @brief Might not needed?
31 */
32 VK_CHECK(vkQueueWaitIdle(VulkanRenderBackend::GetState().m_GraphicQueue))
33
34 SlateResizeEvent event(static_cast<uint32_t>(m_ViewPort.lock()->GetPanelSize().x), static_cast<uint32_t>(m_ViewPort.lock()->GetPanelSize().y));
35
37 }
38 }
39}
#define SPICES_PROFILE_ZONE
#define VK_CHECK(expr)
Vulkan Check macro. Verify Vulkan API Effectiveness.
Definition VulkanUtils.h:68
static EventCallbackFn GetEventCallbackFn()
Get Global Root Event Function Pointer.
Definition Event.cpp:17
This Class is the basic Event Class. Inherit from it and create specific event class.
Definition Event.h:96
This Class is inherited from Event Class. Called by Viewport Resize.
Definition SlateEvent.h:18
This Class handles our engine time step during frames. Global Unique.
Definition TimeStep.h:22
virtual void OnTick(TimeStep &ts) override
This interface defines the behave on specific component tick every frame.
Script of handle viewport resize event.
static VulkanState & GetState()
Get VulkanState in use.
This class defines the render backend behaves of Vulkan.