From 325aa53020e37ffce49746b2a853eb0fb4e52b37 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Wed, 4 Mar 2020 14:00:21 -0500 Subject: [PATCH] Add CGraphics::GetViewport --- Runtime/Graphics/CGraphics.cpp | 2 ++ Runtime/Graphics/CGraphics.hpp | 1 + 2 files changed, 3 insertions(+) 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);