diff --git a/Runtime/Graphics/CGraphics.cpp b/Runtime/Graphics/CGraphics.cpp index 678e5d17b..427011d5e 100644 --- a/Runtime/Graphics/CGraphics.cpp +++ b/Runtime/Graphics/CGraphics.cpp @@ -410,6 +410,8 @@ void CGraphics::SetViewportResolution(const zeus::CVector2i& res) { static boo::SWindowRect CachedVP; zeus::CVector2f CGraphics::g_CachedDepthRange = {0.f, 1.f}; +const boo::SWindowRect& CGraphics::GetViewport() { return CachedVP; } + void CGraphics::SetViewport(int leftOff, int bottomOff, int width, int height) { CachedVP.location[0] = leftOff; CachedVP.location[1] = bottomOff; diff --git a/Runtime/Graphics/CGraphics.hpp b/Runtime/Graphics/CGraphics.hpp index 27e811e48..fbea177c7 100644 --- a/Runtime/Graphics/CGraphics.hpp +++ b/Runtime/Graphics/CGraphics.hpp @@ -295,6 +295,7 @@ public: static SClipScreenRect ClipScreenRectFromVS(const zeus::CVector3f& p1, const zeus::CVector3f& p2); static zeus::CVector3f ProjectModelPointToViewportSpace(const zeus::CVector3f& point); static zeus::CVector3f ProjectModelPointToViewportSpace(const zeus::CVector3f& point, float& wOut); + static const boo::SWindowRect& GetViewport(); static void SetViewportResolution(const zeus::CVector2i& res); static void SetViewport(int leftOff, int bottomOff, int width, int height);