added back the demo gui for looking up widgets
[laserbrain_demo] / src / blob_exhibit.cc
index 1dcc80e..5e9f213 100644 (file)
@@ -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();