其实就是手动配置渲染系统,去掉Ogre自带的对话框,如果会用Ogre的基本框架,下列代码很容易理解
bool RPGApp::configure(void)
{
? ? // Show the configuration dialog and initialise the system
? ? // You can skip this and use root.restoreConfig() to load configuration
? ? // settings if you were sure there are valid ones saved in ogre.cfg
? ? //if(mRoot->showConfigDialog())
? ?RenderSystemList *rsList = mRoot->getAvailableRenderers();
? ?int c=0;
? ?bool foundit = false;
? ?RenderSystem *selectedRenderSystem=0;
? ?while(c < (int) rsList->size()){
? ?? ?selectedRenderSystem = rsList->at(c);
? ?? ?String rname = selectedRenderSystem->getName();
? ?? ?if(rname.compare("Direct3D9 Rendering Subsystem")==0){
? ?? ?? ?foundit=true;
? ?? ?? ?break;
? ?? ?}
? ?? ?c++; // <-- oh how clever
? ?}
? ?if(!foundit) return false; //we didn't find it...
? ?
? ?//we found it, we might as well use it!
? ?selectedRenderSystem->setConfigOption("Full Screen","Yes");?
? ?selectedRenderSystem->setConfigOption("Video Mode","1024 x 768 @ 32-bit colour");
? ?selectedRenderSystem->setConfigOption("Allow NVPerfHUD","No");
? ?selectedRenderSystem->setConfigOption("Anti aliasing","None");
? ?selectedRenderSystem->setConfigOption("Floating-point mode","Fastest");
? ?//selectedRenderSystem->setConfigOption("Rendering Device","RADEON 9200");
? ?selectedRenderSystem->setConfigOption("VSync","No");
? ?mRoot->setRenderSystem(selectedRenderSystem);
? ?
? ? mWindow = mRoot->initialise(true, "Dire Desire");
? ?return true;
}