From 2990843f3183b208ecc1b736e7a6dc6443a477b1 Mon Sep 17 00:00:00 2001 From: Lynix Date: Tue, 4 Mar 2014 19:35:51 +0100 Subject: [PATCH] Added warning Former-commit-id: b6956df1ded62a23140f4c44f0fd8b677c63c981 --- src/Nazara/Graphics/Camera.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Nazara/Graphics/Camera.cpp b/src/Nazara/Graphics/Camera.cpp index eb3f42b0f..ff941eba7 100644 --- a/src/Nazara/Graphics/Camera.cpp +++ b/src/Nazara/Graphics/Camera.cpp @@ -292,6 +292,14 @@ void NzCamera::UpdateViewMatrix() const void NzCamera::UpdateViewport() const { + #if NAZARA_GRAPHICS_SAFE + if (!m_target) + { + NazaraError("Camera has no render target"); + return; + } + #endif + unsigned int width = m_target->GetWidth(); unsigned int height = std::max(m_target->GetHeight(), 1U);