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!

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

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

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)


相关推荐

  • 软件架构介绍

    软件架构介绍软件架构介绍

  • C++\QT常见面试题[通俗易懂]

    C++\QT常见面试题[通俗易懂]1.C与C++的区别2.深拷贝和浅拷贝的区别3.指针和引用的区别4.什么是面向对象,面向对象的三大特征是什么?5.static关键字的用法6.const关键字的用法7.什么是函数重载8.创建的对象有几种方式,有什么区别9.什么是构造函数10.什么是this指针11.抽象类是什么12.什么是封装、继承、多态13.私有继承,保护继承和公有继承的区别14.友元函数15.new和delete16.C++STL容器有哪些17.什么是面向对象编程的开放封闭原则?18.内联函数与宏的区

  • maven版本查看_maven最新版本

    maven版本查看_maven最新版本工作中,我们经常要操作maven以及配置maven,有时还需要向maven中手动添加jar包;那么如何查看maven的版本呢?第一种方法:就是从你安装maven插件的目录文件夹中可以看出;第二种方法:直接使用黑窗口命令查看:但是前提是mavenhome环境变量必须配置好否则无法查看;输入命令 mvn-version 那,如何配置maven的环境变量呢?计算机–右键…

  • ubuntu 微信开发者工具_微信web开发者工具官方下载

    ubuntu 微信开发者工具_微信web开发者工具官方下载下载地址:开发者工具下载解压到/optsudomkdir/opt/wxdt&&sudotar-zxvfwechat-devtools-1.03.2006090.tar.gz-C/opt/wxdtsudoln-s/opt/wxdt/bin/wechat-devtools/usr/bin/wd创建桌面图标文件vim~/.local/share/applications/wedt.desktop写入[DesktopEntry]Encoding=UT

    2022年10月29日
  • git无法删除本地分支_git如何删除远程分支

    git无法删除本地分支_git如何删除远程分支git删除本地分支出现错误转载:https://blog.csdn.net/benben_2015/article/details/79782202删除本地分支经常出现的情况有以下几种:error:Thebranch‘testing’isnotfullymerged.使用gitbranch-dtestin…

    2022年10月10日
  • Maximum execution time of 30 seconds exceeded解决办法

    Maximum execution time of 30 seconds exceeded解决办法

    2021年10月16日

发表回复

您的电子邮箱地址不会被公开。

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