Mercurial > hg > Game > Cerium
view example/cube/RenderingEngine.cpp @ 575:341f1f881a9b draft
Linda API worked. (slightly unreliable)
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 23 Oct 2009 15:53:24 +0900 |
parents | df32980116bd |
children |
line wrap: on
line source
void RenderingEngine::init(int width, int height, int bpp) { } TaskDepend RenderingEngine::update_all(SceneGraph* next, SceneGraph* now, TaskDepend wait) { SceneGraph *t, *nt; t = now; nt = next; //glPushMatrix(); int s=0; while(t) { //t->draw(stack); t->update(t->data_pack, nt->data_pack); if(t->child != NULL) { stack[s++] = t->matrix; //push t = t->child; } else if(t->brother != NULL) { stack[--s] = NULL; //pop stack[s++] = t->matrix; //push t = t->brother; } else { while(t) { if(t->brother != NULL) { stack[--s] = NULL; //pop stack[s++] = t->matrix; //push t = t->brother; break; } else { t = t->parent; if(t) { stack[--s] = NULL; //pop } } } } } //glPopMatrix(); } TaskDepend RenderingEngin::draw_all(SceneGraph* now, TaskDepend wait) { Polygon *t; t = this; //glPushMatrix(); int s=0; while(t) { t->draw(stack); if(t->child != NULL) { stack[s++] = t->matrix; //push t = t->child; } else if(t->brother != NULL) { stack[--s] = NULL; //pop stack[s++] = t->matrix; //push t = t->brother; } else { while(t) { if(t->brother != NULL) { stack[--s] = NULL; //pop stack[s++] = t->matrix; //push t = t->brother; break; } else { t = t->parent; if(t) { stack[--s] = NULL; //pop } } } } } //glPopMatrix(); }