X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fblob_exhibit.cc;h=5e9f213cd9b972a41dad8e9438313574a37ac5fa;hb=0429831551b044dc8e4d6ba7c842e1ce4761ed69;hp=1dcc80e3d0a906750e4066b77b2daf78f594a43d;hpb=004eca3966c8cc7bed607311a90d56eecab1752f;p=laserbrain_demo diff --git a/src/blob_exhibit.cc b/src/blob_exhibit.cc index 1dcc80e..5e9f213 100644 --- a/src/blob_exhibit.cc +++ b/src/blob_exhibit.cc @@ -41,6 +41,7 @@ BlobExhibit::BlobExhibit() BlobExhibit::~BlobExhibit() { + destroy(); delete priv; } @@ -62,8 +63,10 @@ bool BlobExhibit::init() void BlobExhibit::destroy() { - msurf_free(priv->msurf); - priv->msurf = 0; + if(priv->msurf) { + msurf_free(priv->msurf); + priv->msurf = 0; + } } void BlobExhibit::update(float dt) @@ -95,6 +98,10 @@ void BlobExhibit::draw() const glEnable(GL_TEXTURE_GEN_S); glEnable(GL_TEXTURE_GEN_T); + glMatrixMode(GL_TEXTURE); + glLoadIdentity(); + glScalef(1, -1, 1); + glFrontFace(GL_CW); glBegin(GL_TRIANGLES); glColor3f(1, 1, 1); @@ -102,6 +109,9 @@ void BlobExhibit::draw() const glEnd(); glFrontFace(GL_CCW); + glLoadIdentity(); + glMatrixMode(GL_MODELVIEW); + glPopAttrib(); post_draw();