Welcome to mirror list, hosted at ThFree Co, Russian Federation.

render_context.cpp « graphics - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 081101adc2767c67b20fd898cb8475d97c57c7bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "../base/SRC_FIRST.hpp"
#include "render_context.hpp"

namespace graphics
{
  void RenderContext::setMatrix(EMatrix mt, TMatrix const & m)
  {
    m_matrices[mt] = m;
  }

  RenderContext::TMatrix const & RenderContext::matrix(EMatrix m) const
  {
    map<EMatrix, TMatrix >::const_iterator it = m_matrices.find(m);
    return it->second;
  }

  void RenderContext::startThreadDrawing(unsigned threadSlot)
  {
    ASSERT(m_threadSlot == -1, ());
    m_threadSlot = threadSlot;
  }

  void RenderContext::endThreadDrawing(unsigned threadSlot)
  {
    ASSERT(m_threadSlot != -1, ());
    m_threadSlot = -1;
  }

  RenderContext::RenderContext()
    : m_threadSlot(-1)
  {
    setMatrix(EModelView, math::Identity<float, 4>());
    setMatrix(EProjection, math::Identity<float, 4>());
  }

  RenderContext::~RenderContext()
  {}

  void RenderContext::setResourceManager(const shared_ptr<ResourceManager> &rm)
  {
    m_resourceManager = rm;
  }

  shared_ptr<ResourceManager> const & RenderContext::resourceManager() const
  {
    return m_resourceManager;
  }

  unsigned RenderContext::threadSlot() const
  {
    return m_threadSlot;
  }
}