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

uniform_values_storage.hpp « drape - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3250287f3c1408f07fde3a287bce1fceaa7f6357 (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
#pragma once

#include "drape/uniform_value.hpp"

#include "std/vector.hpp"
#include "std/string.hpp"
#include "std/function.hpp"

namespace dp
{

class UniformValuesStorage
{
public:
  void SetIntValue(string const & name, int32_t v);
  void SetIntValue(string const & name, int32_t v1, int32_t v2);
  void SetIntValue(string const & name, int32_t v1, int32_t v2, int32_t v3);
  void SetIntValue(string const & name, int32_t v1, int32_t v2, int32_t v3, int32_t v4);

  void SetFloatValue(string const & name, float v);
  void SetFloatValue(string const & name, float v1, float v2);
  void SetFloatValue(string const & name, float v1, float v2, float v3);
  void SetFloatValue(string const & name, float v1, float v2, float v3, float v4);

  void SetMatrix4x4Value(string const & name, float const * matrixValue);

  template<typename TFunctor>
  void ForeachValue(TFunctor & functor) const
  {
    for_each(m_uniforms.begin(), m_uniforms.end(), functor);
  }

  bool operator< (UniformValuesStorage const & other) const;

private:
  UniformValue * findByName(string const & name);

private:
  typedef vector<UniformValue> uniforms_t;
  uniforms_t m_uniforms;
};

} // namespace dp