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

vertex_decl.hpp « utils « drape - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 296a1d81abc3f83626b642a40c0f5e26fd5b09c4 (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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#pragma once

#include "drape/glsl_types.hpp"
#include "drape/binding_info.hpp"

#include "base/buffer_vector.hpp"

namespace gpu
{

struct BaseVertex
{
  using TPosition = glsl::vec3;
  using TNormal = glsl::vec2;
  using TNormal3d = glsl::vec3;
  using TTexCoord = glsl::vec2;
};

struct AreaVertex : BaseVertex
{
  AreaVertex();
  AreaVertex(TPosition const & position, TTexCoord const & colorTexCoord);

  TPosition m_position;
  TTexCoord m_colorTexCoord;

  static dp::BindingInfo const & GetBindingInfo();
};

struct Area3dVertex : BaseVertex
{
  Area3dVertex();
  Area3dVertex(TPosition const & position, const TPosition & normal, TTexCoord const & colorTexCoord);

  TPosition m_position;
  TNormal3d m_normal;
  TTexCoord m_colorTexCoord;

  static dp::BindingInfo const & GetBindingInfo();
};

struct SolidTexturingVertex : BaseVertex
{
  SolidTexturingVertex();
  SolidTexturingVertex(TPosition const & position, TNormal const & normal, TTexCoord const & colorTexCoord);

  TPosition m_position;
  TNormal m_normal;
  TTexCoord m_colorTexCoord;

  static dp::BindingInfo const & GetBindingInfo();
};

typedef buffer_vector<SolidTexturingVertex, 128> TSolidTexVertexBuffer;

struct TextStaticVertex : BaseVertex
{
  TextStaticVertex();
  TextStaticVertex(TTexCoord const & colorTexCoord, TTexCoord const & maskTexCoord);

  TTexCoord m_colorTexCoord;
  TTexCoord m_maskTexCoord;

  static dp::BindingInfo const & GetBindingInfo();
};

typedef buffer_vector<TextStaticVertex, 128> TTextStaticVertexBuffer;

struct TextOutlinedStaticVertex : BaseVertex
{
public:
  TextOutlinedStaticVertex();
  TextOutlinedStaticVertex(TTexCoord const & colorTexCoord, TTexCoord const & outlineTexCoord,
                           TTexCoord const & maskTexCoord);

  TTexCoord m_colorTexCoord;
  TTexCoord m_outlineTexCoord;
  TTexCoord m_maskTexCoord;

  static dp::BindingInfo const & GetBindingInfo();
};

typedef buffer_vector<TextOutlinedStaticVertex, 128> TTextOutlinedStaticVertexBuffer;

struct TextDynamicVertex : BaseVertex
{
  TextDynamicVertex();
  TextDynamicVertex(TPosition const & position, TNormal const & normal);

  TPosition m_position;
  TNormal m_normal;

  static dp::BindingInfo const & GetBindingInfo();
  static uint32_t GetDynamicStreamID();
};

typedef buffer_vector<TextDynamicVertex, 128> TTextDynamicVertexBuffer;

struct LineVertex : BaseVertex
{
  using TNormal = glsl::vec3;

  LineVertex();
  LineVertex(TPosition const & position, TNormal const & normal, TTexCoord const & color);

  TPosition m_position;
  TNormal m_normal;
  TTexCoord m_colorTexCoord;

  static dp::BindingInfo const & GetBindingInfo();
};

struct DashedLineVertex : BaseVertex
{
  using TNormal = glsl::vec3;
  using TMaskTexCoord = glsl::vec4;

  DashedLineVertex();
  DashedLineVertex(TPosition const & position, TNormal const & normal,
                   TTexCoord const & color, TMaskTexCoord const & mask);

  TPosition m_position;
  TNormal m_normal;
  TTexCoord m_colorTexCoord;
  TMaskTexCoord m_maskTexCoord;

  static dp::BindingInfo const & GetBindingInfo();
};

struct RouteVertex : BaseVertex
{
  typedef glsl::vec3 TLength;

  RouteVertex();
  RouteVertex(TPosition const & position, TNormal const & normal, TLength const & length);

  TPosition m_position;
  TNormal m_normal;
  TLength m_length;

  static dp::BindingInfo const & GetBindingInfo();
};

} // namespace gpu