Upload upstream chromium 67.0.3396
[platform/framework/web/chromium-efl.git] / third_party / angle / util / geometry_utils.h
1 //
2 // Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 // geometry_utils:
7 //   Helper library for generating certain sets of geometry.
8 //
9
10 #ifndef UTIL_GEOMETRY_UTILS_H
11 #define UTIL_GEOMETRY_UTILS_H
12
13 #include <cstddef>
14 #include <vector>
15
16 #include <export.h>
17 #include <GLES2/gl2.h>
18
19 #include "common/vector_utils.h"
20
21 struct ANGLE_EXPORT SphereGeometry
22 {
23     SphereGeometry();
24     ~SphereGeometry();
25
26     std::vector<angle::Vector3> positions;
27     std::vector<angle::Vector3> normals;
28     std::vector<GLushort> indices;
29 };
30
31 ANGLE_EXPORT void CreateSphereGeometry(size_t sliceCount, float radius, SphereGeometry *result);
32
33 struct ANGLE_EXPORT CubeGeometry
34 {
35     CubeGeometry();
36     ~CubeGeometry();
37
38     std::vector<angle::Vector3> positions;
39     std::vector<angle::Vector3> normals;
40     std::vector<angle::Vector2> texcoords;
41     std::vector<GLushort> indices;
42 };
43
44 ANGLE_EXPORT void GenerateCubeGeometry(float radius, CubeGeometry *result);
45
46 #endif  // UTIL_GEOMETRY_UTILS_H