ogre自动档初始化

#include <stdio.h>
#include <ogre.h>
using namespace Ogre;

class MyLogListener:public LogListener
{
public:
 void messageLogged( const String& message, LogMessageLevel lml, bool maskDebug, const String &logName )
 {

 }
};

class MyFrameListener:public FrameListener
{
public:
 bool frameStarted(const FrameEvent& evt)
 {
  return true;
 }
};

int main()
{
 MyLogListener* myLogListener = new MyLogListener;
 LogManager* logMgr = new LogManager;
 Log* log = logMgr->createLog("mylog.log", true, false, true);
 logMgr->setLogDetail(LL_NORMAL);
 log->addListener(myLogListener);
 Root* root = new Root();
 bool rtn = root->showConfigDialog();
 if (rtn)
 {
  root->initialise(true, "My Render Window");
  RenderWindow* window = root->getAutoCreatedWindow();
  MyFrameListener* myFrameListener = new MyFrameListener;
  root->addFrameListener(myFrameListener);
  root->startRendering();
 }
 return 0;
}

posted on 2012-04-27 19:31  紫澜  阅读(175)  评论(0编辑  收藏  举报