From 18367d26daaa40adb846d976710c14f74d74846c Mon Sep 17 00:00:00 2001 From: Lynix Date: Sat, 17 Jan 2015 00:34:59 +0100 Subject: [PATCH] Added View::SetSize(width, height) Former-commit-id: 9afd04b62e99702720cb10feae2462eaad33a90b --- include/Nazara/Graphics/View.hpp | 1 + src/Nazara/Graphics/View.cpp | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/include/Nazara/Graphics/View.hpp b/include/Nazara/Graphics/View.hpp index e9d0de8da..b7f016afc 100644 --- a/include/Nazara/Graphics/View.hpp +++ b/include/Nazara/Graphics/View.hpp @@ -45,6 +45,7 @@ class NAZARA_API NzView : public NzAbstractViewer, public NzNode, NzRenderTarget float GetZNear() const; void SetSize(const NzVector2f& size); + void SetSize(float width, float height); void SetTarget(const NzRenderTarget* renderTarget); void SetTarget(const NzRenderTarget& renderTarget); void SetTargetRegion(const NzRectf& region); diff --git a/src/Nazara/Graphics/View.cpp b/src/Nazara/Graphics/View.cpp index 045b22a22..fb55c5054 100644 --- a/src/Nazara/Graphics/View.cpp +++ b/src/Nazara/Graphics/View.cpp @@ -24,7 +24,7 @@ m_zNear(-1.f) NzView::NzView(const NzVector2f& size) : NzView() // On délègue { - m_size = size; + SetSize(size); } NzView::~NzView() @@ -147,6 +147,17 @@ float NzView::GetZNear() const return m_zNear; } +void NzView::SetSize(const NzVector2f& size) +{ + SetSize(size.x, size.y); +} + +void NzView::SetSize(float width, float height) +{ + m_size.Set(width, height); + m_projectionMatrixUpdated = false; +} + void NzView::SetTarget(const NzRenderTarget* renderTarget) { if (m_target)