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

defines.hpp « graphics - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 96019e1910259937f0620ed6d80c23010837aab7 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#pragma once

#include "std/string.hpp"

namespace graphics
{
  static const int maxDepth = 20000;
  static const int minDepth = -20000;

  enum EDensity
  {
    EDensityLDPI = 0,
    EDensityMDPI,
    EDensityHDPI,
    EDensityXHDPI,
    EDensityXXHDPI,
    EDensityIPhone6Plus
  };

  /// get density name
  char const * convert(EDensity density);

  /// get density from name
  void convert(char const * name, EDensity & density);

  /// get scaling koefficient for specified density
  double visualScale(EDensity density);

  /// When adding values here,
  /// please check constructor of ResourceManager,
  /// and defines.cpp
  enum ETextureType
  {
    ESmallTexture = 0,
    EMediumTexture,
    ELargeTexture,
    ERenderTargetTexture,
    EStaticTexture,
    EInvalidTexture //< Should be last
  };

  char const * convert(ETextureType type);

  /// When adding values here,
  /// please check constructor of ResourceManager.
  enum EStorageType
  {
    ETinyStorage = 0,
    ESmallStorage,
    EMediumStorage,
    ELargeStorage,
    EInvalidStorage //< Should be last
  };

  char const * convert(EStorageType type);

  enum EShaderType
  {
    EVertexShader,
    EFragmentShader
  };

  enum ESemantic
  {
    ESemPosition,
    ESemNormal,
    ESemTexCoord0,
    ESemSampler0,
    ESemModelView,
    ESemProjection,
    ETransparency,
    ESemLength,
    ERouteHalfWidth,
    ERouteColor,
    ERouteClipLength,
    ERouteTextureRect
  };

  void convert(char const * name, ESemantic & sem);

  enum EDataType
  {
    EInteger,
    EIntegerVec2,
    EIntegerVec3,
    EIntegerVec4,
    EFloat,
    EFloatVec2,
    EFloatVec3,
    EFloatVec4,
    EFloatMat2,
    EFloatMat3,
    EFloatMat4,
    ESampler2D
  };

  unsigned elemSize(EDataType dt);

  enum EPrimitives
  {
    ETriangles,
    ETrianglesFan,
    ETrianglesStrip
  };

  enum EMatrix
  {
    EModelView,
    EProjection
  };

  enum EDepthFunc
  {
    ELessEqual
  };

  enum EPosition
  {
    EPosCenter = 0x00,
    EPosAbove = 0x01,
    EPosUnder = 0x02,
    EPosLeft = 0x04,
    EPosRight = 0x10,
    EPosAboveLeft = EPosAbove | EPosLeft,
    EPosAboveRight = EPosAbove | EPosRight,
    EPosUnderLeft = EPosUnder | EPosLeft,
    EPosUnderRight = EPosUnder | EPosRight
  };
}