From cbb15b23e1153f843074a8ccf21aeda2d9d530ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Tue, 20 Aug 2013 18:03:41 -0300 Subject: [PATCH] Fixed cFrameBuffer rendering inside the buffer things that corresponds outside the buffer. --- src/eepp/graphics/cframebuffer.cpp | 2 -- src/eepp/graphics/cframebufferfbo.cpp | 3 +++ src/eepp/graphics/cframebufferpbuffer.cpp | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/eepp/graphics/cframebuffer.cpp b/src/eepp/graphics/cframebuffer.cpp index c03c9b0e4..ca40d7409 100644 --- a/src/eepp/graphics/cframebuffer.cpp +++ b/src/eepp/graphics/cframebuffer.cpp @@ -62,8 +62,6 @@ void cFrameBuffer::Clear() { } void cFrameBuffer::SetBufferView() { - cGlobalBatchRenderer::instance()->Draw(); - mPrevView = mWindow->GetView(); // Get the user projection matrix diff --git a/src/eepp/graphics/cframebufferfbo.cpp b/src/eepp/graphics/cframebufferfbo.cpp index 2933e2259..f345281dc 100644 --- a/src/eepp/graphics/cframebufferfbo.cpp +++ b/src/eepp/graphics/cframebufferfbo.cpp @@ -2,6 +2,7 @@ #include #include #include +#include namespace EE { namespace Graphics { @@ -117,6 +118,8 @@ bool cFrameBufferFBO::Create( const Uint32& Width, const Uint32& Height, bool De void cFrameBufferFBO::Bind() { if ( mFrameBuffer ) { + cGlobalBatchRenderer::instance()->Draw(); + BindFrameBuffer(); BindRenderBuffer(); diff --git a/src/eepp/graphics/cframebufferpbuffer.cpp b/src/eepp/graphics/cframebufferpbuffer.cpp index 9d0df2ad4..cb9b2198d 100644 --- a/src/eepp/graphics/cframebufferpbuffer.cpp +++ b/src/eepp/graphics/cframebufferpbuffer.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #ifdef EE_GLEW_AVAILABLE @@ -248,6 +249,8 @@ bool cFrameBufferPBuffer::Create( const Uint32& Width, const Uint32& Height, boo void cFrameBufferPBuffer::Bind() { bool ChangeContext = false; + cGlobalBatchRenderer::instance()->Draw(); + #ifdef EE_GLEW_AVAILABLE #if EE_PLATFORM == EE_PLATFORM_WIN