Mercurial > hg > Members > kono > Cerium
view example/cube/RenderingEngine.cpp @ 20:31a7ff27ee20
*** empty log message ***
author | gongo |
---|---|
date | Sun, 10 Feb 2008 13:46:26 +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(); }