-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathCubeDrawer.cpp
More file actions
53 lines (41 loc) · 923 Bytes
/
Copy pathCubeDrawer.cpp
File metadata and controls
53 lines (41 loc) · 923 Bytes
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
#include "CubeDrawer.h"
#define cpsCurrentClass CubeDrawer
cpsExportClass()
cpsExportMethod(OnPreRender)
cpsExportMethod(OnPostRender)
#undef cpsCurrentClass
CubeDrawer* CubeDrawer::s_inst;
CubeDrawer* CubeDrawer::getInstance()
{
return s_inst;
}
CubeDrawer::CubeDrawer(cpsObject o)
: super(o)
{
if (s_inst != nullptr) {
cpsDebugPrint("CubeDrawer::s_inst is not null!\n");
}
s_inst = this;
m_data.reserve(1024 * 16);
findField("instance_buffer").getValue(*this, m_buffer);
}
CubeDrawer::~CubeDrawer()
{
if (s_inst != this) {
cpsDebugPrint("CubeDrawer::s_inst is not this!\n");
}
s_inst = nullptr;
}
void CubeDrawer::OnPreRender()
{
// todo
//m_buffer.SetData(m_data);
m_data.clear();
}
void CubeDrawer::OnPostRender()
{
}
CubeCont& CubeDrawer::getInstanceBuffer()
{
return m_data;
}