78 |
"CXX": "GLenum", |
"CXX": "GLenum", |
79 |
"pre" : (lambda v, p : "GLenum "+v+" = " \ |
"pre" : (lambda v, p : "GLenum "+v+" = " \ |
80 |
"tokenFromJstring(env, "+p+");") |
"tokenFromJstring(env, "+p+");") |
81 |
} |
}, |
82 |
|
"float[]" : { |
83 |
|
"Java": "float[]", |
84 |
|
"JNI": "jfloatArray", |
85 |
|
"CXX": "vector<float>", |
86 |
|
"pre" : (lambda v,p : """ |
87 |
|
vector<float> %(v)s (env->GetArrayLength(%(p)s)); |
88 |
|
{ |
89 |
|
jfloat *f_ = env->GetFloatArrayElements(%(p)s, 0); |
90 |
|
for(unsigned i_=0; i_<%(v)s.size(); i_++) |
91 |
|
%(v)s[i_] = f_[i_]; |
92 |
|
env->ReleaseFloatArrayElements(%(p)s, f_, JNI_ABORT); |
93 |
|
} |
94 |
|
"""%locals()) |
95 |
|
}, |
96 |
} |
} |
97 |
|
|
98 |
rs = [ |
rs = [ |
99 |
|
|
100 |
|
# Here for testing float[], no other purpose |
101 |
|
{ |
102 |
|
"Type" : "1", |
103 |
|
"Name" : "StupidLinestrip", |
104 |
|
"Data" : "vector<float> arr;", |
105 |
|
"Params" : "float[] arr", |
106 |
|
"ParamCode" : "this->arr = arr; ", |
107 |
|
"RenderCode" : """ |
108 |
|
glBegin(GL_LINE_STRIP); |
109 |
|
for(int i=0; i+1<arr.size(); i+=2) { |
110 |
|
ZPt p(arr[i], arr[i+1], 0); |
111 |
|
coords1.vertex(p); |
112 |
|
} |
113 |
|
glEnd(); |
114 |
|
""" |
115 |
|
}, |
116 |
|
|
117 |
{ |
{ |
118 |
"Type" : "0", |
"Type" : "0", |
119 |
"Name" : "CallList", |
"Name" : "CallList", |