From e1c22b9ca20ad214a789c04645cffc846a304db4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 2 Sep 2012 18:04:02 +0200 Subject: [PATCH] Don't do anything OpenGL-related inside Camera itself. * The user might not want to call Framebuffer::clear(), because there could be something already rendered with another camera. * The user might not want to call Framebuffer::setViewport(), because there could be different framebuffer attached. --- src/SceneGraph/Camera.cpp | 4 ---- src/SceneGraph/Camera.h | 9 ++++----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/SceneGraph/Camera.cpp b/src/SceneGraph/Camera.cpp index aba491f2a..4d6d3f305 100644 --- a/src/SceneGraph/Camera.cpp +++ b/src/SceneGraph/Camera.cpp @@ -14,7 +14,6 @@ */ #include "Camera.h" -#include "Framebuffer.h" #include "Scene.h" using namespace std; @@ -49,7 +48,6 @@ template Matrix4 aspectRatioFix(AspectRatioPolicy, const Vector2&, cons template Camera::Camera(ObjectType* parent): ObjectType(parent), _aspectRatioPolicy(AspectRatioPolicy::NotPreserved) {} template void Camera::setViewport(const Math::Vector2& size) { - Framebuffer::setViewport({0, 0}, size); _viewport = size; fixAspectRatio(); @@ -65,8 +63,6 @@ templatescene(); CORRADE_ASSERT(s, "Camera: cannot draw without camera attached to scene", ); - Framebuffer::clear(); - /* Recursively draw child objects */ drawChildren(s, cameraMatrix()); } diff --git a/src/SceneGraph/Camera.h b/src/SceneGraph/Camera.h index 2c29bd7f8..df3f82e61 100644 --- a/src/SceneGraph/Camera.h +++ b/src/SceneGraph/Camera.h @@ -112,17 +112,16 @@ template& size); /** * @brief Draw the scene * - * Calls Framebuffer::clear() and draws the scene using drawChildren(). + * Draws the scene using drawChildren(). */ virtual void draw();