refactor(new_editor): centralize win32 frame execution
This commit is contained in:
29
new_editor/app/Platform/Win32/EditorWindowFrameDriver.cpp
Normal file
29
new_editor/app/Platform/Win32/EditorWindowFrameDriver.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#include "Platform/Win32/EditorWindowFrameDriver.h"
|
||||
|
||||
#include "Platform/Win32/EditorWindow.h"
|
||||
|
||||
namespace XCEngine::UI::Editor::App {
|
||||
|
||||
EditorWindowFrameTransferRequests EditorWindowFrameDriver::DriveFrame(
|
||||
EditorWindow& window,
|
||||
EditorContext& editorContext,
|
||||
bool globalTabDragActive) {
|
||||
if (!window.IsRenderReady() ||
|
||||
window.GetHwnd() == nullptr ||
|
||||
window.IsClosing()) {
|
||||
return {};
|
||||
}
|
||||
|
||||
(void)window.ConsumePendingFrameRequestReasons();
|
||||
|
||||
EditorWindowFrameTransferRequests transferRequests =
|
||||
window.RenderFrame(editorContext, globalTabDragActive);
|
||||
if (const HWND hwnd = window.GetHwnd();
|
||||
hwnd != nullptr && IsWindow(hwnd)) {
|
||||
ValidateRect(hwnd, nullptr);
|
||||
}
|
||||
|
||||
return transferRequests;
|
||||
}
|
||||
|
||||
} // namespace XCEngine::UI::Editor::App
|
||||
Reference in New Issue
Block a user