[vlmc-devel] [PATCH 5/7] GenericRenderer Implement setRenderTarget

Hugo Beauzée-Luyssen hugo at beauzee.fr
Sun Apr 17 09:34:08 CEST 2016


On 04/16/2016 08:22 AM, Yikai Lu wrote:
> ---
>   src/Renderer/GenericRenderer.cpp | 8 ++++++++
>   src/Renderer/GenericRenderer.h   | 5 +++++
>   2 files changed, 13 insertions(+)
>
> diff --git a/src/Renderer/GenericRenderer.cpp b/src/Renderer/GenericRenderer.cpp
> index 598b59e..49ea01b 100644
> --- a/src/Renderer/GenericRenderer.cpp
> +++ b/src/Renderer/GenericRenderer.cpp
> @@ -27,6 +27,7 @@
>   GenericRenderer::GenericRenderer()
>       : m_sourceRenderer( nullptr )
>       , m_paused( false )
> +    , m_renderTarget( nullptr )
>   {
>       m_eventWatcher = new RendererEventWatcher;
>   }
> @@ -35,6 +36,7 @@ GenericRenderer::~GenericRenderer()
>   {
>       delete m_sourceRenderer;
>       delete m_eventWatcher;
> +    delete m_renderTarget;
>   }
>
>   bool
> @@ -49,6 +51,12 @@ GenericRenderer::isRendering() const
>       return m_isRendering;
>   }
>
> +void
> +GenericRenderer::setRenderTarget( Backend::IRenderTarget *target )

I'm enclined to think this should take a std::unique_ptr instead of a 
raw one, opinion?

> +{
> +    m_renderTarget = target;
> +}
> +
>   #ifdef WITH_GUI
>   RendererEventWatcher*
>   GenericRenderer::eventWatcher()
> diff --git a/src/Renderer/GenericRenderer.h b/src/Renderer/GenericRenderer.h
> index 6fb326a..fbc9a5e 100644
> --- a/src/Renderer/GenericRenderer.h
> +++ b/src/Renderer/GenericRenderer.h
> @@ -29,6 +29,7 @@
>
>   #include "Workflow/Types.h"
>   #include "Tools/RendererEventWatcher.h"
> +#include "Backend/IRenderTarget.h"
>
>   class   Clip;
>   class   Media;
> @@ -135,6 +136,8 @@ public:
>        */
>       bool                            isRendering() const;
>
> +    void                            setRenderTarget( Backend::IRenderTarget* target );
> +
>       RendererEventWatcher*           eventWatcher();
>   protected:
>       Backend::ISourceRenderer*       m_sourceRenderer;
> @@ -150,6 +153,8 @@ protected:
>       bool                            m_paused;
>       bool                            m_isRendering;
>
> +    Backend::IRenderTarget*         m_renderTarget;
> +
>   public slots:
>       /**
>        *  \brief      This SLOT will be called when the time cursor has changed.
>



More information about the Vlmc-devel mailing list