CEGUI build

CEGUI build     Everygamesneed2dguisystemforplayerinterface,asweknownasOGRE3drenderenginepronouncethatitwilluseCEGUIcomponentforits2dpart,becauseCEGUIisveryprofessionalandpo

大家好,又见面了,我是你们的朋友全栈君。

        Every games need 2d gui system for player interface, as we known as OGRE 3d render engine pronounce that it will use CEGUI component for its 2d part, because CEGUI is very professional and powerful, so I want to see its miracle source code,I’d like to share some experience for newcomer.

Firstly, I download CEGUI 5.0 and dependencies 5.0 – vs8 and build successfully, here are necessary resource:

1. Src: http://prdownloads.sourceforge.net/crayzedsgui/CEGUI-0.5.0b.zip?download
2. Dependecies for vs 2005: http://prdownloads.sourceforge.net/crayzedsgui/CEGUI-DEPS-0.5.0b-vc8.zip?download
3. CEGUI Wiki: http://www.cegui.org.uk/wiki/index.php/Main_Page
4. All: http://sourceforge.net/projects/crayzedsgui/files/

Note: if you use visual studio 2005, must make sure it has sp1 package, will has 0XC0150002 error or not.
vs2005 sp1: http://download.microsoft.com/download/8/0/7/8071514d-9370-45c3-8af1-4ff09a70e59d/VS80sp1-KB926604-X86-CHS.exe

Now let us have a look at these source code file structure, as following,

./bin           all CEGUI base dll which will be compiled by me letter.
./datafiles        all demo resource
./dependencies      all depend on other library
./ImageCodecModules    some image codec source code
./include         all CEGUI head file
./makefiles/premake    cegui and examples’ project, and project configure[Important: config.lua]
./RendererModules     some render modules such as dx9, dx8, irrlich, opengl
./ScriptingModules    cegui lua module
./src           all CEGUI source code
./WindowRendererSets   all real render implement of cegui control like button, edit. latter I will explain in detail.
./XMLParserModules    some xml parser such TinyXML, Xerces etc. because cegui serialize all object to xml file format.
./XMLRefSchema      some schema for loading.

Here we go, secondly I will build a example for demo, check file directory in [./makefiles/premake]. Hold on please, there is a very important thing to do before you execute batch file. You should use which render module for rendering. for example, I want to use directx 9.0 for rendering, in this case please open config.lua using notepad, you will find,

————-
— Renderers
— this controls which renderer modules are built
OPENGL_RENDERER = true   ——-> false
DIRECTX81_RENDERER = false
DIRECTX9_RENDERER = false ——-> true
IRRLICHT_RENDERER = false

I think you understand what to do, just change opengl to false, turn on directx9. Let’s execute 2005 bat file, will produce two solutions, one is CEGUI.sln, building is OK! Here Focus on CEGUISamples.sln. Error will be see when run demo_xxx.exe because of loading resource. latter I will just give some to do and no reason, and you will understand when debuging source code. open CEGuiD3D9BaseApplication.cpp and modify it’s constructor,

// initialise the re quired dirs for the DefaultResourceProvider
CEGUI::DefaultResourceProvider* rp = static_cast<CEGUI::DefaultResourceProvider*> (CEGUI::System::getSingleton().getResourceProvider());
const char* dataPathPrefix = getDataPathPrefix();
char resourcePath[PATH_MAX];

sprintf_s(resourcePath, PATH_MAX, “%s%s”, dataPathPrefix, “datafiles/schemes/”);
rp->setResourceGroupDirectory(“schemes”, resourcePath);
sprintf_s(resourcePath, PATH_MAX, “%s%s”, dataPathPrefix, “datafiles/imagesets/”);
rp->setResourceGroupDirectory(“imagesets”, resourcePath);
sprintf_s(resourcePath, PATH_MAX, “%s%s”, dataPathPrefix, “datafiles/fonts/”);
rp->setResourceGroupDirectory(“fonts”, resourcePath);
sprintf_s(resourcePath, PATH_MAX, “%s%s”, dataPathPrefix, “datafiles/layouts/”);
rp->setResourceGroupDirectory(“layouts”, resourcePath);
sprintf_s(resourcePath, PATH_MAX, “%s%s”, dataPathPrefix, “datafiles/looknfeel/”);
rp->setResourceGroupDirectory(“looknfeels”, resourcePath);
sprintf_s(resourcePath, PATH_MAX, “%s%s”, dataPathPrefix, “datafiles/lua_scripts/”);
rp->setResourceGroupDirectory(“lua_scripts”, resourcePath);

at last add a member function for this class,

const char* CEGuiD3D9BaseApplication::getDataPathPrefix() const
{

// TO ADD:
// return your datafiles full path here
}

the end, good luck to you!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/163749.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • Windows Mobile 6 Professional SDK[通俗易懂]

    Windows Mobile 6 Professional SDK[通俗易懂]WindowsMobile6ProfessionalSDK Lotyong的WindowsMobile6ProfessionalSDKhttp://download.microsoft.com/download/f/2/3/f232f773-7edc-4300-be07-d3b76a5b3a91/Windows%20Mobile%206%20Professional%

    2022年7月12日
    13
  • UDP发送大型文件_不丢包[通俗易懂]

    UDP发送大型文件_不丢包[通俗易懂]先上图1:如果对文件要求不高的话,可以使用UDP,UDP在实际测试中,丢包还是听验证的,但是效率高2:如果文件必须完整,还是使用TCP。Socket进行文件传输,比较稳妥近期的项目中要是用软件升级,系统文件有600M。一般的程序员会说,下载吗,直接下载安装就好了,我也是这样想的,素不知线下的网络的环境有多差,当时一个业务员和我说,要是能实现手机发送文件给设备就好了,毕竟大家都是用手机…

    2022年7月11日
    86
  • 最详细动态规划解析——背包问题

    最详细动态规划解析——背包问题动态规划的定义要解决一个复杂的问题,可以考虑先解决其子问题。这便是典型的递归思想,比如最著名的斐波那契数列,讲递归必举的例子。斐波纳契数列的定义如下:F(0)=1,F(1)=1,F(n)=F(n-1)+F(n-2)(n>=2,n∈N*)用递归可以很快写出这样一个函数,咋一看真牛逼,几行代码就搞定了intfib(inti){if(i<=1){ret

    2022年7月26日
    13
  • navicat激活码2021【2021免费激活】

    (navicat激活码2021)JetBrains旗下有多款编译器工具(如:IntelliJ、WebStorm、PyCharm等)在各编程领域几乎都占据了垄断地位。建立在开源IntelliJ平台之上,过去15年以来,JetBrains一直在不断发展和完善这个平台。这个平台可以针对您的开发工作流进行微调并且能够提供…

    2022年3月21日
    46
  • windows实现mysql读写分离[通俗易懂]

    一、主服务器(master)配置1、修改MySQL配置文件my.ini[mysqld]log-bin=mysql-bin#开启主从复制,主库的配置log-bin-index=mysql-bin.indexserver-id=1#指定主库serverid,主库的id要比从库的id小sync_binlog=1binlog_format=mixed

    2022年4月17日
    38
  • wifi网速慢的原因及解决办法_wifi连接速度不稳定

    wifi网速慢的原因及解决办法_wifi连接速度不稳定最近在家上网,突然wifi贼jb慢了,连信号也不满格了。脑补了下,估计是附近的wifi频段和我们家冲突了。于是yahoo了下,老外推荐软件NetStubler。兴冲冲地下载了一个,结果在我机器上用不了,搜索了下原因,不了了之。于是放弃,问了下度娘,给我推荐了Homedale,不错,还是国产搜索靠谱啊。果然,我家默认的频段为802.11g的channel1,附近有个家伙信号很

    2022年10月20日
    3

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号