-
Notifications
You must be signed in to change notification settings - Fork 8
/
r_geom.h
60 lines (47 loc) · 842 Bytes
/
r_geom.h
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
#ifndef R_GEOM_HDR
#define R_GEOM_HDR
#include "r_common.h"
#include "u_pair.h"
namespace m {
struct vec3;
}
namespace r {
struct geom {
geom();
~geom();
void upload(bool index = true);
union {
struct {
GLuint vbo;
GLuint ibo;
};
GLuint buffers[2];
};
GLuint vao;
};
struct quad : geom {
bool upload();
void render();
};
struct sphere : geom {
sphere();
bool upload();
void render();
private:
size_t m_indices;
static constexpr size_t kSlices = 8;
static constexpr size_t kStacks = 4;
};
struct bbox : geom {
bool upload();
void render();
};
struct cone : geom {
bool upload();
void render(bool bottom = true);
private:
u::pair<size_t, size_t> m_indices;
static constexpr int kSlices = 8;
};
}
#endif