From 9a15edb6e40c627f7e190b86932e25fd36b2d968 Mon Sep 17 00:00:00 2001 From: fallenoak Date: Sat, 11 Mar 2023 00:09:06 -0600 Subject: [PATCH] feat(gx): partially handle size wm event in d3d backend --- src/gx/CGxDevice.hpp | 1 + src/gx/d3d/CGxDeviceD3d.cpp | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/gx/CGxDevice.hpp b/src/gx/CGxDevice.hpp index 8cdbcbc..5e1f76d 100644 --- a/src/gx/CGxDevice.hpp +++ b/src/gx/CGxDevice.hpp @@ -73,6 +73,7 @@ class CGxDevice { TSHashTable m_shaderList[GxShTargets_Last]; int32_t m_context = 0; int32_t intF5C = 0; + int32_t m_windowVisible = 0; int32_t intF64 = 0; CBoundingBox m_viewport; C44Matrix m_projection; diff --git a/src/gx/d3d/CGxDeviceD3d.cpp b/src/gx/d3d/CGxDeviceD3d.cpp index 4bd3739..82f8207 100644 --- a/src/gx/d3d/CGxDeviceD3d.cpp +++ b/src/gx/d3d/CGxDeviceD3d.cpp @@ -408,7 +408,24 @@ int32_t CGxDeviceD3d::DeviceSetFormat(const CGxFormat& format) { } void CGxDeviceD3d::DeviceWM(EGxWM wm, uintptr_t param1, uintptr_t param2) { - // TODO + switch (wm) { + case GxWM_Size: { + if (param2 == 1 || param2 == 2) { + this->m_windowVisible = 0; + } else { + this->m_windowVisible = 1; + + auto& windowRect = *reinterpret_cast(param1); + this->DeviceSetDefWindow(windowRect); + + if (this->m_d3dDevice && this->m_context) { + // TODO + } + } + + break; + } + } } void CGxDeviceD3d::Draw(CGxBatch* batch, int32_t indexed) {