Commits

Cliff Biffle committed fb9ab20

Switched the point-cloud renderer to use vertex arrays. Interestingly, on Mac OS X 10.6.3, I see no significant in the profiles, and performance is unchanged.

  • Participants
  • Parent commits f24f146

Comments (0)

Files changed (1)

KVRayFieldSpaceModel.m

 #pragma mark --- Internals
 
 - (void) renderAsPointsWithOptions: (NSDictionary *) options {
-  glBegin(GL_POINTS);
   glColor3f(1, 1, 1);
   glNormal3f(0, 0, -1);
-  for (int i = 0; i < 480 * 640; i++) {
-    glVertex3fv(&rays[i].x);    
-  }
-  glEnd();
+  glEnableClientState(GL_VERTEX_ARRAY);
+  glVertexPointer(3, GL_FLOAT, 0, &rays);
+  glDrawArrays(GL_POINTS, 0, 640 * 480);
+  glDisableClientState(GL_VERTEX_ARRAY);
 }
 
 - (void) renderAsSolidWithOptions: (NSDictionary *) options {