/************************************* * All the interesting work happens here, when * I get called back from OpenGL to draw a frame. * When I am finished drawing, then the graphics * engine will wait until the proper amount of * time has passed and put the drawing on the screen. **************************************/ void callBack(const Interface *pUI, void *p) { Ground *pGround = (Ground *)p; if (pUI->isSpace()) pGround->generateGround(); pGround->draw(); }
/** Draw the scene. */ void draw() { // The lights must be drawn FIRST, so the other scene elements // can get lit! pointLight.draw(); directionalLight.draw(); // Draw robot arm //robotArm.draw(); worm1.draw(); worm2.draw(); ground.draw(); mushroom1.draw(); mushroom2.draw(); }