From 7ad6c64358222be43c1d7221c97edfcc9a6663ed Mon Sep 17 00:00:00 2001 From: LaurentGom Date: Mon, 11 Jan 2010 09:33:55 +0000 Subject: [PATCH] Fixed current view not being updated when window is resized (bug introduced with the latest modifications on view handling) git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1344 4e206d99-4929-0410-ac5d-dfc041789085 --- src/SFML/Graphics/RenderTarget.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/SFML/Graphics/RenderTarget.cpp b/src/SFML/Graphics/RenderTarget.cpp index cf320eb1..89a90b02 100644 --- a/src/SFML/Graphics/RenderTarget.cpp +++ b/src/SFML/Graphics/RenderTarget.cpp @@ -72,6 +72,9 @@ void RenderTarget::Draw(const Drawable& object) // Setup the shader myRenderQueue.SetShader(NULL); + // Setup the viewport + myRenderQueue.SetViewport(GetViewport(myCurrentView)); + // Let the object draw itself object.Draw(*this, myRenderQueue); @@ -91,6 +94,9 @@ void RenderTarget::Draw(const Drawable& object, const Shader& shader) // Setup the shader myRenderQueue.SetShader(&shader); + // Setup the viewport + myRenderQueue.SetViewport(GetViewport(myCurrentView)); + // Let the object draw itself object.Draw(*this, myRenderQueue); @@ -122,8 +128,7 @@ void RenderTarget::SetView(const View& view) // Save it myCurrentView = view; - // Send the view's viewport and projection matrix to the render queue - myRenderQueue.SetViewport(GetViewport(view)); + // Send the projection matrix to the render queue myRenderQueue.SetProjection(view.GetMatrix()); }