From 5174970b2486971e3191238ced53cf6a274c90a0 Mon Sep 17 00:00:00 2001 From: fallenoak Date: Sat, 15 Apr 2023 12:14:33 -0500 Subject: [PATCH] feat(gx): sync projection and view xforms in d3d backend --- src/gx/d3d/CGxDeviceD3d.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/gx/d3d/CGxDeviceD3d.cpp b/src/gx/d3d/CGxDeviceD3d.cpp index 1a8b1f5..99b7f0a 100644 --- a/src/gx/d3d/CGxDeviceD3d.cpp +++ b/src/gx/d3d/CGxDeviceD3d.cpp @@ -1704,7 +1704,19 @@ void CGxDeviceD3d::IStateSyncVertexPtrs() { } void CGxDeviceD3d::IStateSyncXforms() { - // TODO + if (this->m_xforms[GxXform_Projection].m_dirty) { + this->m_d3dDevice->SetTransform(D3DTS_PROJECTION, reinterpret_cast(&this->m_projNative)); + this->m_xforms[GxXform_Projection].m_dirty = 0; + } + + if (this->m_xforms[GxXform_View].m_dirty) { + this->m_d3dDevice->SetTransform(D3DTS_VIEW, reinterpret_cast(&this->m_xforms[GxXform_View].TopConst())); + this->m_xforms[GxXform_View].m_dirty = 0; + } + + // TODO world + + // TODO tex } void CGxDeviceD3d::ITexCreate(CGxTex* texId) {