Open shewu opened 9 years ago
void UnholyGameViewController::_drawObjects() { glEnable(GL_NORMALIZE); for (auto& iter : world->getMovingRoundObjects()) { MovingRoundObject* obj = iter.second; glPushMatrix(); glTranslatef(obj->center.x, obj->center.y, 0); glScalef(obj->radius, obj->radius, obj->heightRatio*obj->radius); MaterialPtr color = obj->getMaterial(); glColor3f(color->getR()/255.0f, color->getG()/255.0f, color->getB()/255.0f); gluSphere(_quad, 1.0, 50, 50); glPopMatrix(); } glDisable(GL_NORMALIZE); }
crashed because obj == NULL
obj == NULL
crashed because
obj == NULL