Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unholyballs has a leak and crashes if there are lots of objects #52

Open
shewu opened this issue Jun 14, 2015 · 0 comments
Open

unholyballs has a leak and crashes if there are lots of objects #52

shewu opened this issue Jun 14, 2015 · 0 comments
Labels

Comments

@shewu
Copy link
Owner

shewu commented Jun 14, 2015

screen shot 2015-06-14 at 3 51 43 pm

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

@shewu shewu added the P2 label Jun 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant