6 #include "RenderableFilters.h"
7 #include "IRenderableFilter.h"
8 #include "WorldMeshRenderable.h"
9 #include "RenderQueue.h"
19 template <
typename TViewType>
25 for(
typename std::vector<TViewType*>::iterator iter = m_views.begin();
26 iter != m_views.end();
29 TViewType* pView = (*iter);
31 UpdateView(renderContext, *pView);
33 renderQueue.EnqueueRenderable(pView->GetRenderable());
37 void AddView(TViewType& view)
40 std::find(m_views.begin(), m_views.end(), &view) == m_views.end(),
41 "Cannot add view, as it has already been added");
43 m_views.push_back(&view);
46 void RemoveView(TViewType& view)
49 std::find(m_views.begin(), m_views.end(), &view) != m_views.end(),
50 "Cannot remove view, as it has not been added");
52 m_views.erase(std::remove(m_views.begin(), m_views.end(), &view));
65 view.GetRenderable()->UpdateMVP(renderContext, 1.0f);
68 const std::vector<TViewType*>& GetViews()
const
73 std::vector<TViewType*> m_views;