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)