#if defined(__APPLE__) #include #include #include #else #include #endif #include "plane.h" #include "plane_cloud.h" int initialize_naive_drawelements_renderer(void) { return 1; } void update_naive_drawelements_rendererer(double dt) { #if defined(__APPLE__) CGLContextObj CGL_MACRO_CONTEXT = CGLGetCurrentContext(); #endif unsigned num_planes = plane_count(); const float *matrices = plane_matrices(); glVertexPointer(3, GL_FLOAT, 0, PLANE_VERTICES); glEnableClientState(GL_VERTEX_ARRAY); unsigned i; const float *matrix = matrices; for (i = 0; i < num_planes; ++i) { glPushMatrix(); glMultMatrixf(matrix); glDrawElements( GL_TRIANGLES, PLANE_INDEX_COUNT, GL_UNSIGNED_INT, PLANE_INDICES); glPopMatrix(); matrix += 16; } glDisableClientState(GL_VERTEX_ARRAY); }