All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
StencilLayersController.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "Rendering.h"
7 #include "LayerIds.h"
8 #include "StencilMapLayerMask.h"
9 
10 #include <map>
11 
12 namespace Eegeo
13 {
14  namespace Rendering
15  {
17  {
18  public:
19 
20  static StencilLayersController* Create();
21 
22  u32 GetStencilBitplaneMask(Eegeo::Rendering::LayerIds::Values layerId) const;
23 
24  void SetEnabledBitplanes(uint bitplanes) { m_enabledBitplanes = bitplanes & StencilMapLayerMask::AllMapLayers; }
25  u32 GetEnabledBitplanes() const { return m_enabledBitplanes; }
26 
27  // todo - temp, move to MAterials
28  void SetDefaultStencilState(Rendering::GLState& glState, const Rendering::RenderableBase& renderable) const;
29 
30  private:
31  typedef std::map<LayerIds::Values, StencilMapLayerMask::Type> LayerIdToStencilMapLayerMask;
32 
33  StencilLayersController(const LayerIdToStencilMapLayerMask& layerIdToStencilMapLayerMask);
34 
35  u32 m_enabledBitplanes;
36  const LayerIdToStencilMapLayerMask m_layerIdToStencilMapLayerMask;
37  };
38  }
39 }