forked from jvan/pyvrui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgl.i
63 lines (48 loc) · 1.43 KB
/
gl.i
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
//------------------------------------------------------------------------------
// Interface file for the GL directory.
//
//------------------------------------------------------------------------------
/* Includes for generated wrapper code */
%{
#include <GL/GLObject.h>
#include <GL/GLContextData.h>
#include <GL/GLModels.h>
%}
%feature("director") GLObject;
%feature("director") DataItem;
/* Nested classes and structures */
struct DataItem
{
virtual ~NestedDataItem(void) { }
};
%nestedworkround GLObject::DataItem;
%{
typedef GLObject::DataItem DataItem;
%}
/* Interface */
%include <GL/GLModels.h>
class GLObject
{
public:
GLObject(void);
virtual ~GLObject(void);
virtual void initContext(GLContextData& contextData) const = 0;
};
/* Automatically disable garbage collection on DataItem objects */
%pythonprepend GLContextData::addDataItem(const GLObject* thing, GLObject::DataItem* dataItem) %{
args[1].__disown__()
%}
class GLContextData
{
public:
GLContextData(int sTableSize,float sWaterMark =0.9f,float sGrowRate =1.7312543);
~GLContextData(void);
bool isRealized(const GLObject* thing) const;
void addDataItem(const GLObject* thing, GLObject::DataItem* dataItem);
template <class DataItemParam>
DataItemParam* retrieveDataItem(const GLObject* thing);
void removeDataItem(const GLObject* thing);
};
%extend GLContextData {
%template(retrieveDataItem) retrieveDataItem<DataItem>;
};