/[gzz]/gzz/gfx/librenderables/renderables.py
ViewVC logotype

Diff of /gzz/gfx/librenderables/renderables.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.150 by jvk, Thu Nov 21 12:07:13 2002 UTC revision 1.151 by tjl, Fri Nov 22 15:23:11 2002 UTC
# Line 78  convert = { Line 78  convert = {
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",

Legend:
Removed from v.1.150  
changed lines
  Added in v.1.151

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26