@@ -60,19 +60,18 @@ pp_addhdr('
6060my @internal = (Doc => 'internal', NoPthread => 1);
6161
6262pp_def(
63- 'gl_spheres ',
63+ 'gl_sphere ',
6464 GenericTypes => $F,
65- Pars => 'coords(tri=3,n);
66- float [t ] vertices(tri,nVert=CALC(calc_nVert($COMP(slices),$COMP(stacks))));
67- float [t ] normals(tri,nVert);
68- uint [t ] stripIdx(nIdx=CALC(calc_nIdx($COMP(slices),$COMP(stacks))));',
65+ Pars => '
66+ [o ] vertices(tri=3 ,nVert=CALC(calc_nVert($COMP(slices),$COMP(stacks))));
67+ [o ] normals(tri,nVert);
68+ uint [o ] stripIdx(nIdx=CALC(calc_nIdx($COMP(slices),$COMP(stacks))));',
6969 OtherPars => 'float radius; int slices; int stacks;',
7070 CHeader => <<'EOF',
7171char *fghGenerateSphere(GLfloat radius, GLint slices, GLint stacks, GLfloat *vertices, GLfloat *normals, int nVert);
7272void calc_strip_idx(GLuint *stripIdx, GLint slices, GLint stacks, int nVert);
7373int calc_nVert(GLint slices, GLint stacks);
7474int calc_nIdx(GLint slices, GLint stacks);
75- int calc_numVertIdxsPerPart(GLint slices);
7675EOF
7776 Code => <<'EOF',
7877/* Generate vertices and normals */
@@ -83,6 +82,19 @@ if (err) $CROAK("%s", err);
8382 * strip.
8483 */
8584calc_strip_idx($P(stripIdx), $COMP(slices), $COMP(stacks), $SIZE(nVert));
85+ EOF
86+ @internal
87+ );
88+
89+ pp_def(
90+ 'gl_spheres',
91+ GenericTypes => $F,
92+ Pars => 'coords(tri=3,n); vertices(tri,nVert); normals(tri,nVert); uint stripIdx(nIdx);',
93+ OtherPars => 'int slices; int stacks;',
94+ CHeader => <<'EOF',
95+ int calc_numVertIdxsPerPart(GLint slices);
96+ EOF
97+ Code => <<'EOF',
8698glEnableClientState(GL_VERTEX_ARRAY);
8799glEnableClientState(GL_NORMAL_ARRAY);
88100glVertexPointer(3, GL_FLOAT, 0, $P(vertices));
0 commit comments