]> Dogcows Code - chaz/yoink/blobdiff - src/MainLayer.cc
finally fixed broken main loop
[chaz/yoink] / src / MainLayer.cc
index 568f0cd0ebe84b2185945895692d5045c89c7454..5f097ea9438a5cd8e9bd9cd6b8721b3c0f2e991b 100644 (file)
@@ -142,11 +142,13 @@ void MainLayer::setupGL()
 
        glClearColor(0.0, 0.0, 0.0, 1.0);
 
-       glMatrixMode(GL_PROJECTION);
-       glLoadIdentity();
-       gluPerspective(60.0, 1.33333, 1.0, 2500.0);
+       //glMatrixMode(GL_PROJECTION);
+       //glLoadIdentity();
+       //Mf::Scalar ratio = Mf::engine.getVideo()->getWidth() /
+               //Mf::engine.getVideo()->getHeight();
+       //gluPerspective(60.0, ratio, 1.0, 250.0);
 
-       glMatrixMode(GL_MODELVIEW);
+       //glMatrixMode(GL_MODELVIEW);
 }
 
 void MainLayer::contextRecreated()
@@ -272,16 +274,18 @@ int main(int argc, char* argv[])
 
 
        // make sure the engine started up okay
-       if (Mf::engine.getError().isError())
+       const Mf::Error& error = Mf::engine.getError();
+       if (error.isError())
        {
                Mf::ModalDialog dialog;
                dialog.title = PACKAGE_STRING;
-               dialog.text1 = "Fatal Error";
-               dialog.text2 = getErrorString(Mf::engine.getError());
+               dialog.text1 = "Uh oh!";
+               dialog.text2 = getErrorString(error);
                dialog.type = Mf::ModalDialog::CRITICAL;
                dialog.run();
 
-               return 1;
+               // openal errors are not fatal
+               if (error.code() != Mf::Error::OPENAL_INIT) return 1;
        }
 
 
@@ -333,6 +337,7 @@ int main(int argc, char* argv[])
        Mf::Settings& settings = Mf::Settings::getInstance();
        settings.loadFromFile(configFiles);
        settings.parseArgs(argc, argv);
+       Mf::engine.initWithSettings(settings);
 
        std::string iconFile = Mf::Resource::getPath(PACKAGE".png");
 
This page took 0.018105 seconds and 4 git commands to generate.