首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 编程语言 > C/C++ > 用代码设置Ogre配置对话框
【标  题】:用代码设置Ogre配置对话框
【关键字】:Ogre
【来  源】:http://www.cppblog.com/gogoplayer/archive/2006/11/29/15762.html

用代码设置Ogre配置对话框

其实就是手动配置渲染系统,去掉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;
}

《Wicket开发指南一书》在JavaEye提供PDF版本下载:【上一篇】
设置窗口透明度的SetLayeredWindowAttributes函数:【下一篇】
【相关文章】
  • .NET Remoting——practice & progress(1):Configuration Files配置文件
  • .NET Remoting——practice & progress(2):WellKnown已知类型
  • Ogre的2D显示
  • DIY OGRE的面部动画
  • ogre和physx二sdk整合笔记
  • 关注AJAX(4):ComponentArt,母板页和定制UpdateProgress
  • 用Ogre写的第一个程序
  • 完成载入OGRE的mesh部分
  • XSI Vertex Animation and OGRE Facial Animation
  • Ogre粒子系统编辑器
  • 【随机文章】
  • 还是喜欢原来的那个blog
  • CDE问题的troubleshooting
  • [精彩] 转 鸟哥學習 Shell Scripts
  • 即将回成都了,寻求发展机会
  • 实现基于IDEA算法的加密工具(1)
  • JavaScript + CSS 实现动态菜单显示
  • Linux高性能集群-软件体系结构
  • AIX 程序设计大赛-AIX正方形问题算法及Java程序实现(方案三)
  • 开源世界新军: newxy新坐标
  • flash遮罩特效实例精选(4)
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 软讯网络 All Rigths Reserved.